Bug 5184 - BUG: source/smbd/utmp.c missing HAVE_UPDWTMPX check before using updwtmpx()
Summary: BUG: source/smbd/utmp.c missing HAVE_UPDWTMPX check before using updwtmpx()
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.0.28
Hardware: x86 Mac OS X
: P3 normal
Target Milestone: none
Assignee: Tim Potter
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-09 21:45 UTC by Eric Cronin
Modified: 2008-03-24 14:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Cronin 2008-01-09 21:45:03 UTC
In 10.5 Mac OS X added enough utmpx support to make it past the first two preprocessor checks around line 390 of src/smbd/utmp.c and on to the utmpx block which uses updwtmpx().  Unfortunately, as ./configure correctly surmised, 10.5 doesn't have that.  Seems to be a straightforward logic error in the preprocessor guard checks, fixable with the patch below.  (Not sure if this is Odd or not in the comment.)

--- smbd/utmp.c.orig    2008-01-09 20:25:53.000000000 -0500
+++ smbd/utmp.c 2008-01-09 20:30:08.000000000 -0500
@@ -398,6 +398,10 @@
        /* Odd.  Have utmpx.h but no "getutmpx()".  Drop to non-x stuff */
        DEBUG(1,("utmp_update: have utmpx.h but no getutmpx() function\n"));
        utmp_nox_update(u, claim);
+#elif !defined(HAVE_UPDWTMPX)
+    /* Have utmpx.h but no "updwtmpx()".  Drop to non-x stuff */
+    DEBUG(1,("utmp_update: have utmpx.h but no updwtmpx() function\n"));
+    utmp_nox_update(u, claim);
 #else
        pstring uname, wname;
        struct utmpx ux, *uxrc;
Comment 1 James Peach 2008-03-24 14:35:41 UTC
Pushed patch to branch v3-2-test as commit f19d1e3d93d0d9dfe80372c6c5635f1047f9aa88.

thanks!