Adding (final) version of the utmp/wtmp patch from David Lee.
authorJeremy Allison <jra@samba.org>
Fri, 7 Apr 2000 23:34:27 +0000 (23:34 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 7 Apr 2000 23:34:27 +0000 (23:34 +0000)
Also updated documentation.
Jeremy.

WHATSNEW.txt
docs/htmldocs/smb.conf.5.html
docs/manpages/smb.conf.5
docs/yodldocs/smb.conf.5.yo
source/acconfig.h
source/configure
source/configure.in
source/include/config.h.in
source/include/proto.h
source/param/loadparm.c
source/smbd/connection.c

index fa9ef58341e62557cbc28d957da064abb9af3e17..ecc7613554f0fc4534817d0ccab54c72795496aa 100644 (file)
@@ -5,12 +5,6 @@ This is the latest stable release of Samba. This is the
 version that all production Samba servers should be running
 for all current bug-fixes.
 
-TODO Before Official 2.0.7 release
-----------------------------------
-
-Update "Using Samba" html to match 2.0.7 code.
-Update packaging code to include all new files.
-
 New Documentation in 2.0.7
 --------------------------
 
@@ -60,15 +54,16 @@ There are 5 new parameters in the smb.conf file.
 
 utmp
 utmp dir
+utmp hostname
+utmp consolidate
+wtmp directory
 
-These two parameters are only available if the "--with-utmp"
+These parameters are only available if the "--with-utmp"
 option was selected at configure time. The yes/no option "utmp"
 specifies whether utmp records should be recorded on user
-logon/logoff. It defaults to "no". The "utmp dir" (which
-also has a synonym of "utmp directory") parameter is a
-string parameter specifying a pathname to the directory containing
-the utmp file databases. This defaults to "" (the empty string).
-See the smb.conf man page for more details.
+logon/logoff. It defaults to "no". The "utmp dir" and "wtmp dir"
+are string parameters specifying pathnames to the directories containing
+the utmp/wtmp file databases. See the smb.conf man page for more details.
 
 inherit permissions
 
index fdb918cd238206eb877dcdfc926cec4e3b73099a..517fb6099999da01a662af5235fd37e60df716af 100644 (file)
@@ -543,7 +543,9 @@ parameter for details.  Note that some are synonyms.
 <p><li > <a href="smb.conf.5.html#userhosts"><strong>use rhosts</strong></a>
 <p><li > <a href="smb.conf.5.html#usernamelevel"><strong>username level</strong></a>
 <p><li > <a href="smb.conf.5.html#usernamemap"><strong>username map</strong></a>
+<p><li > <a href="smb.conf.5.html#utmpconsolidate"><strong>utmp consolidate</strong></a>
 <p><li > <a href="smb.conf.5.html#utmpdirectory"><strong>utmp directory</strong></a>
+<p><li > <a href="smb.conf.5.html#utmphostname"><strong>utmp hostname</strong></a>
 <p><li > <a href="smb.conf.5.html#validchars"><strong>valid chars</strong></a>
 <p><li > <a href="smb.conf.5.html#winshook"><strong>wins hook</strong></a>
 <p><li > <a href="smb.conf.5.html#winsproxy"><strong>wins proxy</strong></a>
@@ -551,6 +553,7 @@ parameter for details.  Note that some are synonyms.
 <p><li > <a href="smb.conf.5.html#winssupport"><strong>wins support</strong></a>
 <p><li > <a href="smb.conf.5.html#workgroup"><strong>workgroup</strong></a>
 <p><li > <a href="smb.conf.5.html#writeraw"><strong>write raw</strong></a>
+<p><li > <a href="smb.conf.5.html#wtmpdirectory"><strong>wtmp directory</strong></a>
 <p></dl>
 <p><a name="COMPLETELISTOFSERVICEPARAMETERS"></a>
 <h2>COMPLETE LIST OF SERVICE PARAMETERS</h2>
@@ -4679,6 +4682,16 @@ user connecting to a Samba share.
 <code>utmp = False</code>
 <p><strong>Example:</strong>
 <code>utmp = True</code>
+<p><a name="utmpconsolidate"></a>
+<p></p><dt><strong><strong>utmp consolidate(G)</strong></strong><dd>
+<p>This parameter is only available if Samba has been configured and compiled
+with the option <code>--with-utmp</code>.  Normally each share create a utmp record,
+but if there are many connections each with many shares, it can be desirable
+to consolidate the shares down to one-per-connection.
+<p><strong>Default:</strong>
+<code>utmp consolidate = no</code>
+<p><strong>Example:</strong>
+<code>utmp consolidate = yes</code>
 <p><a name="utmpdirectory"></a>
 <p></p><dt><strong><strong>utmp directory(G)</strong></strong><dd>
 <p>This parameter is only available if Samba has been configured and compiled
@@ -4691,6 +4704,16 @@ utmp file the native system is set to use (usually /var/run/utmp on Linux).
 <code>no utmp directory</code>
 <p><strong>Example:</strong>
 <code>utmp directory = /var/adm/</code>
+<p><a name="utmphostname"></a>
+<p></p><dt><strong><strong>utmp hostname(G)</strong></strong><dd>
+<p>This parameter is only available if Samba has been configured and compiled
+with the option <code>--with-utmp</code>. It specifies the ut_host field of the
+utmp and wtmp records.  The default is the NetBIOS name (%m), but a very
+useful alternative might be the Internet/DNS anme (%M).
+<p><strong>Default:</strong>
+<code>utmp hostname = %m</code>
+<p><strong>Example:</strong>
+<code>utmp hostname = %M</code>
 <p><a name="validchars"></a>
 <p></p><dt><strong><strong>valid chars (G)</strong></strong><dd>
 <p>The option allows you to specify additional characters that should be
@@ -4977,6 +5000,20 @@ permitting), but only via spooling operations.
 
 </pre>
 
+<p><a name="wtmpdirectory"></a>
+<p></p><dt><strong><strong>wtmp directory(G)</strong></strong><dd>
+<p>This parameter is only available if Samba has been configured and compiled
+with the option <code>--with-utmp</code>. It specifies a directory pathname that is
+used to store the wtmp or wtmpx files (depending on the UNIX system) that
+record user connections to a Samba server. See also the
+<a href="smb.conf.5.html#utmpdirectory"><strong>"utmp directory"</strong></a> parameter. By default this is
+not set, meaning the system will use either what has been set by
+<a href="smb.conf.5.html#utmp"><strong>"utmp"</strong></a> or whatever wtmp file the native system is set to use
+(usually /var/run/wtmp on Linux).
+<p><strong>Default:</strong>
+<code>no wtmp directory</code>
+<p><strong>Example:</strong>
+<code>wtmp directory = /var/adm/</code>
 <p></dl>
 <p><a name="WARNINGS"></a>
 <h2>WARNINGS</h2>
index 5a42ed6098524d585623ae7d05d8ae03e4d7e342..5b47abd89290436436f7db006668498cdd0496d1 100644 (file)
@@ -919,9 +919,15 @@ parameter for details\&.  Note that some are synonyms\&.
 \fBusername map\fP
 .IP 
 .IP o 
+\fButmp consolidate\fP
+.IP 
+.IP o 
 \fButmp directory\fP
 .IP 
 .IP o 
+\fButmp hostname\fP
+.IP 
+.IP o 
 \fBvalid chars\fP
 .IP 
 .IP o 
@@ -942,6 +948,9 @@ parameter for details\&.  Note that some are synonyms\&.
 .IP o 
 \fBwrite raw\fP
 .IP 
+.IP o 
+\fBwtmp directory\fP
+.IP 
 .PP 
 .SH "COMPLETE LIST OF SERVICE PARAMETERS" 
 .PP 
@@ -6571,6 +6580,19 @@ See also the \fB"utmp directory"\fP parameter\&.
 \fBExample:\fP
 \f(CWutmp = True\fP
 .IP 
+.IP "\fButmp consolidate(G)\fP" 
+.IP 
+This parameter is only available if Samba has been configured and compiled
+with the option \f(CW--with-utmp\fP\&.  Normally each share create a utmp record,
+but if there are many connections each with many shares, it can be desirable
+to consolidate the shares down to one-per-connection\&.
+.IP 
+\fBDefault:\fP
+\f(CWutmp consolidate = no\fP
+.IP 
+\fBExample:\fP
+\f(CWutmp consolidate = yes\fP
+.IP 
 .IP "\fButmp directory(G)\fP" 
 .IP 
 This parameter is only available if Samba has been configured and compiled
@@ -6586,6 +6608,19 @@ utmp file the native system is set to use (usually /var/run/utmp on Linux)\&.
 \fBExample:\fP
 \f(CWutmp directory = /var/adm/\fP
 .IP 
+.IP "\fButmp hostname(G)\fP" 
+.IP 
+This parameter is only available if Samba has been configured and compiled
+with the option \f(CW--with-utmp\fP\&. It specifies the ut_host field of the
+utmp and wtmp records\&.  The default is the NetBIOS name (%m), but a very
+useful alternative might be the Internet/DNS anme (%M)\&.
+.IP 
+\fBDefault:\fP
+\f(CWutmp hostname = %m\fP
+.IP 
+\fBExample:\fP
+\f(CWutmp hostname = %M\fP
+.IP 
 .IP "\fBvalid chars (G)\fP" 
 .IP 
 The option allows you to specify additional characters that should be
@@ -6968,6 +7003,23 @@ permitting), but only via spooling operations\&.
 .DE 
  
 
+.IP 
+.IP "\fBwtmp directory(G)\fP" 
+.IP 
+This parameter is only available if Samba has been configured and compiled
+with the option \f(CW--with-utmp\fP\&. It specifies a directory pathname that is
+used to store the wtmp or wtmpx files (depending on the UNIX system) that
+record user connections to a Samba server\&. See also the
+\fB"utmp directory"\fP parameter\&. By default this is
+not set, meaning the system will use either what has been set by
+\fB"utmp"\fP or whatever wtmp file the native system is set to use
+(usually /var/run/wtmp on Linux)\&.
+.IP 
+\fBDefault:\fP
+\f(CWno wtmp directory\fP
+.IP 
+\fBExample:\fP
+\f(CWwtmp directory = /var/adm/\fP
 .IP 
 .PP 
 .SH "WARNINGS" 
index 2829e74f4e82c2896b393c82222278211d53da70..93f14b2c1a96b3c99ca89c1ed18ebc1137e5ebbe 100644 (file)
@@ -764,8 +764,12 @@ it() link(bf(username level))(usernamelevel)
 
 it() link(bf(username map))(usernamemap)
 
+it() link(bf(utmp consolidate))(utmpconsolidate)
+
 it() link(bf(utmp directory))(utmpdirectory)
 
+it() link(bf(utmp hostname))(utmphostname)
+
 it() link(bf(valid chars))(validchars)
 
 it() link(bf(wins hook))(winshook)
@@ -780,6 +784,8 @@ it() link(bf(workgroup))(workgroup)
 
 it() link(bf(write raw))(writeraw)
 
+it() link(bf(wtmp directory))(wtmpdirectory)
+
 endit()
 
 label(COMPLETELISTOFSERVICEPARAMETERS)
@@ -6463,6 +6469,20 @@ tt(utmp = False)
   bf(Example:)
 tt(utmp = True)
 
+label(utmpconsolidate)
+dit(bf(utmp consolidate(G)))
+
+This parameter is only available if Samba has been configured and compiled
+with the option tt(--with-utmp).  Normally each share create a utmp record,
+but if there are many connections each with many shares, it can be desirable
+to consolidate the shares down to one-per-connection.
+
+  bf(Default:)
+tt(utmp consolidate = no)
+
+  bf(Example:)
+tt(utmp consolidate = yes)
+
 label(utmpdirectory)
 dit(bf(utmp directory(G)))
 
@@ -6479,6 +6499,20 @@ tt(no utmp directory)
   bf(Example:)
 tt(utmp directory = /var/adm/)
 
+label(utmphostname)
+dit(bf(utmp hostname(G)))
+
+This parameter is only available if Samba has been configured and compiled
+with the option tt(--with-utmp). It specifies the ut_host field of the
+utmp and wtmp records.  The default is the NetBIOS name (%m), but a very
+useful alternative might be the Internet/DNS anme (%M).
+
+  bf(Default:)
+tt(utmp hostname = %m)
+
+  bf(Example:)
+tt(utmp hostname = %M)
+
 label(validchars)
 dit(bf(valid chars (G)))
 
@@ -6849,6 +6883,24 @@ verb(
        write ok = yes
 )
 
+label(wtmpdirectory)
+dit(bf(wtmp directory(G)))
+
+This parameter is only available if Samba has been configured and compiled
+with the option tt(--with-utmp). It specifies a directory pathname that is
+used to store the wtmp or wtmpx files (depending on the UNIX system) that
+record user connections to a Samba server. See also the
+link(bf("utmp directory"))(utmpdirectory) parameter. By default this is
+not set, meaning the system will use either what has been set by
+link(bf("utmp"))(utmp) or whatever wtmp file the native system is set to use
+(usually /var/run/wtmp on Linux).
+
+  bf(Default:)
+tt(no wtmp directory)
+
+  bf(Example:)
+tt(wtmp directory = /var/adm/)
+
 endit()
 
 label(WARNINGS)
index bd44381ece8d70e9ebbbb500b0076fae4d2b236f..df8a7af168e1ea9d29cfe7bc27715de89d6cb880 100644 (file)
 #undef USE_SETUIDX
 #undef NEED_SGI_SEMUN_HACK
 #undef SYSCONF_SC_NGROUPS_MAX
+#undef HAVE_UT_UT_NAME
+#undef HAVE_UT_UT_USER
+#undef HAVE_UT_UT_ID
+#undef HAVE_UT_UT_HOST
+#undef HAVE_UT_UT_TIME
+#undef HAVE_UT_UT_TV
 #undef HAVE_UX_UT_SYSLEN
 #undef COMPILER_SUPPORTS_LL
index fb1c55fdd7e9cb2642c0dc7f9dde5fab6c977c04..fba4f0fe6c6bf2c4038c8e66d487ac69ca6d4fba 100755 (executable)
@@ -908,7 +908,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-for ac_prog in mawk gawk nawk awk
+for ac_prog in gawk mawk nawk awk
 do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
@@ -8158,21 +8158,226 @@ EOF
 
 fi
 
+
+echo $ac_n "checking for ut_name in utmp""... $ac_c" 1>&6
+echo "configure:8164: checking for ut_name in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_NAME'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 8170 "configure"
+#include "confdefs.h"
+#include <utmp.h>
+int main() {
+struct utmp ut;  ut.ut_name[0] = 'a';
+; return 0; }
+EOF
+if { (eval echo configure:8177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_NAME=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_NAME=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$samba_cv_HAVE_UT_UT_NAME" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_UT_UT_NAME 1
+EOF
+
+fi 
+
+echo $ac_n "checking for ut_user in utmp""... $ac_c" 1>&6
+echo "configure:8198: checking for ut_user in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_USER'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 8204 "configure"
+#include "confdefs.h"
+#include <utmp.h>
+int main() {
+struct utmp ut;  ut.ut_user[0] = 'a';
+; return 0; }
+EOF
+if { (eval echo configure:8211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_USER=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_USER=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$samba_cv_HAVE_UT_UT_USER" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_UT_UT_USER 1
+EOF
+
+fi 
+
+echo $ac_n "checking for ut_id in utmp""... $ac_c" 1>&6
+echo "configure:8232: checking for ut_id in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_ID'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 8238 "configure"
+#include "confdefs.h"
+#include <utmp.h>
+int main() {
+struct utmp ut;  ut.ut_id[0] = 'a';
+; return 0; }
+EOF
+if { (eval echo configure:8245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_ID=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_ID=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$samba_cv_HAVE_UT_UT_ID" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_UT_UT_ID 1
+EOF
+
+fi 
+
+echo $ac_n "checking for ut_host in utmp""... $ac_c" 1>&6
+echo "configure:8266: checking for ut_host in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_HOST'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 8272 "configure"
+#include "confdefs.h"
+#include <utmp.h>
+int main() {
+struct utmp ut;  ut.ut_host[0] = 'a';
+; return 0; }
+EOF
+if { (eval echo configure:8279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_HOST=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_HOST=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$samba_cv_HAVE_UT_UT_HOST" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_UT_UT_HOST 1
+EOF
+
+fi 
+
+echo $ac_n "checking for ut_time in utmp""... $ac_c" 1>&6
+echo "configure:8300: checking for ut_time in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_TIME'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 8306 "configure"
+#include "confdefs.h"
+#include <utmp.h>
+int main() {
+struct utmp ut;  time_t t; ut.ut_time = t;
+; return 0; }
+EOF
+if { (eval echo configure:8313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_TIME=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_TIME=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$samba_cv_HAVE_UT_UT_TIME" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_UT_UT_TIME 1
+EOF
+
+fi 
+
+echo $ac_n "checking for ut_tv in utmp""... $ac_c" 1>&6
+echo "configure:8334: checking for ut_tv in utmp" >&5
+if eval "test \"`echo '$''{'samba_cv_HAVE_UT_UT_TV'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+cat > conftest.$ac_ext <<EOF
+#line 8340 "configure"
+#include "confdefs.h"
+#include <utmp.h>
+int main() {
+struct utmp ut;  struct timeval tv; ut.ut_tv = tv;
+; return 0; }
+EOF
+if { (eval echo configure:8347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_TV=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  samba_cv_HAVE_UT_UT_TV=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$samba_cv_HAVE_UT_UT_TV" 1>&6
+if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
+    cat >> confdefs.h <<\EOF
+#define HAVE_UT_UT_TV 1
+EOF
+
+fi 
+
 echo $ac_n "checking for ut_syslen in utmpx""... $ac_c" 1>&6
-echo "configure:8163: checking for ut_syslen in utmpx" >&5
+echo "configure:8368: checking for ut_syslen in utmpx" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_UX_UT_SYSLEN'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 8169 "configure"
+#line 8374 "configure"
 #include "confdefs.h"
 #include <utmpx.h>
 int main() {
 struct utmpx ux;  ux.ut_syslen = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:8176: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_UX_UT_SYSLEN=yes
 else
@@ -8193,13 +8398,13 @@ EOF
 fi 
 
 echo $ac_n "checking for kernel oplock type definitions""... $ac_c" 1>&6
-echo "configure:8197: checking for kernel oplock type definitions" >&5
+echo "configure:8402: checking for kernel oplock type definitions" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_KERNEL_OPLOCKS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 8203 "configure"
+#line 8408 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <fcntl.h>
@@ -8207,7 +8412,7 @@ int main() {
 oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:8211: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_KERNEL_OPLOCKS=yes
 else
@@ -8228,7 +8433,7 @@ EOF
 fi
 
 echo $ac_n "checking for irix specific capabilities""... $ac_c" 1>&6
-echo "configure:8232: checking for irix specific capabilities" >&5
+echo "configure:8437: checking for irix specific capabilities" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8237,7 +8442,7 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8241 "configure"
+#line 8446 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/capability.h>
@@ -8252,7 +8457,7 @@ main() {
 }
 
 EOF
-if { (eval echo configure:8256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes
 else
@@ -8280,13 +8485,13 @@ fi
 #
 
 echo $ac_n "checking for int16 typedef included by rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:8284: checking for int16 typedef included by rpc/rpc.h" >&5
+echo "configure:8489: checking for int16 typedef included by rpc/rpc.h" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_INT16_FROM_RPC_RPC_H'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 8290 "configure"
+#line 8495 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if defined(HAVE_RPC_RPC_H)
@@ -8296,7 +8501,7 @@ int main() {
 int16 testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:8300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8505: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes
 else
@@ -8317,13 +8522,13 @@ EOF
 fi
 
 echo $ac_n "checking for uint16 typedef included by rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:8321: checking for uint16 typedef included by rpc/rpc.h" >&5
+echo "configure:8526: checking for uint16 typedef included by rpc/rpc.h" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_UINT16_FROM_RPC_RPC_H'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 8327 "configure"
+#line 8532 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if defined(HAVE_RPC_RPC_H)
@@ -8333,7 +8538,7 @@ int main() {
 uint16 testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:8337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8542: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes
 else
@@ -8354,13 +8559,13 @@ EOF
 fi
 
 echo $ac_n "checking for int32 typedef included by rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:8358: checking for int32 typedef included by rpc/rpc.h" >&5
+echo "configure:8563: checking for int32 typedef included by rpc/rpc.h" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_INT32_FROM_RPC_RPC_H'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 8364 "configure"
+#line 8569 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if defined(HAVE_RPC_RPC_H)
@@ -8370,7 +8575,7 @@ int main() {
 int32 testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:8374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes
 else
@@ -8391,13 +8596,13 @@ EOF
 fi
 
 echo $ac_n "checking for uint32 typedef included by rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:8395: checking for uint32 typedef included by rpc/rpc.h" >&5
+echo "configure:8600: checking for uint32 typedef included by rpc/rpc.h" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_UINT32_FROM_RPC_RPC_H'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 8401 "configure"
+#line 8606 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if defined(HAVE_RPC_RPC_H)
@@ -8407,7 +8612,7 @@ int main() {
 uint32 testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:8411: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes
 else
@@ -8429,13 +8634,13 @@ fi
 
 
 echo $ac_n "checking for conflicting AUTH_ERROR define in rpc/rpc.h""... $ac_c" 1>&6
-echo "configure:8433: checking for conflicting AUTH_ERROR define in rpc/rpc.h" >&5
+echo "configure:8638: checking for conflicting AUTH_ERROR define in rpc/rpc.h" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 8439 "configure"
+#line 8644 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_SYS_SECURITY_H
@@ -8449,7 +8654,7 @@ int main() {
 int testvar;
 ; return 0; }
 EOF
-if { (eval echo configure:8453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no
 else
@@ -8470,16 +8675,16 @@ EOF
 fi
 
 echo $ac_n "checking for test routines""... $ac_c" 1>&6
-echo "configure:8474: checking for test routines" >&5
+echo "configure:8679: checking for test routines" >&5
 if test "$cross_compiling" = yes; then
   echo "configure: warning: cannot run when cross-compiling" 1>&2
 else
   cat > conftest.$ac_ext <<EOF
-#line 8479 "configure"
+#line 8684 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/trivial.c"
 EOF
-if { (eval echo configure:8483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   echo "$ac_t""yes" 1>&6
 else
@@ -8493,7 +8698,7 @@ fi
 
 
 echo $ac_n "checking for ftruncate extend""... $ac_c" 1>&6
-echo "configure:8497: checking for ftruncate extend" >&5
+echo "configure:8702: checking for ftruncate extend" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_FTRUNCATE_EXTEND'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8502,11 +8707,11 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_FTRUNCATE_EXTEND=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8506 "configure"
+#line 8711 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/ftruncate.c"
 EOF
-if { (eval echo configure:8510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_FTRUNCATE_EXTEND=yes
 else
@@ -8529,7 +8734,7 @@ EOF
 fi
 
 echo $ac_n "checking for broken getgroups""... $ac_c" 1>&6
-echo "configure:8533: checking for broken getgroups" >&5
+echo "configure:8738: checking for broken getgroups" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_BROKEN_GETGROUPS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8538,11 +8743,11 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_BROKEN_GETGROUPS=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8542 "configure"
+#line 8747 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/getgroups.c"
 EOF
-if { (eval echo configure:8546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_BROKEN_GETGROUPS=yes
 else
@@ -8565,7 +8770,7 @@ EOF
 fi
 
 echo $ac_n "checking whether getpass should be replaced""... $ac_c" 1>&6
-echo "configure:8569: checking whether getpass should be replaced" >&5
+echo "configure:8774: checking whether getpass should be replaced" >&5
 if eval "test \"`echo '$''{'samba_cv_REPLACE_GETPASS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8573,7 +8778,7 @@ else
 SAVE_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/smbwrapper"
 cat > conftest.$ac_ext <<EOF
-#line 8577 "configure"
+#line 8782 "configure"
 #include "confdefs.h"
 
 #define REPLACE_GETPASS 1
@@ -8586,7 +8791,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:8590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_REPLACE_GETPASS=yes
 else
@@ -8609,7 +8814,7 @@ EOF
 fi
 
 echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6
-echo "configure:8613: checking for working fnmatch" >&5
+echo "configure:8818: checking for working fnmatch" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_FNMATCH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8618,12 +8823,12 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_FNMATCH=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8622 "configure"
+#line 8827 "configure"
 #include "confdefs.h"
 #include <fnmatch.h>
 main() { exit(fnmatch("*.o", "x.o", FNM_PATHNAME) == 0? 0: 1); }
 EOF
-if { (eval echo configure:8627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_FNMATCH=yes
 else
@@ -8646,7 +8851,7 @@ EOF
 fi
 
 echo $ac_n "checking for broken inet_ntoa""... $ac_c" 1>&6
-echo "configure:8650: checking for broken inet_ntoa" >&5
+echo "configure:8855: checking for broken inet_ntoa" >&5
 if eval "test \"`echo '$''{'samba_cv_REPLACE_INET_NTOA'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8655,7 +8860,7 @@ if test "$cross_compiling" = yes; then
   samba_cv_REPLACE_INET_NTOA=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8659 "configure"
+#line 8864 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -8669,7 +8874,7 @@ if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
     strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } 
 exit(1);}
 EOF
-if { (eval echo configure:8673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_REPLACE_INET_NTOA=yes
 else
@@ -8692,7 +8897,7 @@ EOF
 fi
 
 echo $ac_n "checking for sysconf(_SC_NGROUPS_MAX)""... $ac_c" 1>&6
-echo "configure:8696: checking for sysconf(_SC_NGROUPS_MAX)" >&5
+echo "configure:8901: checking for sysconf(_SC_NGROUPS_MAX)" >&5
 if eval "test \"`echo '$''{'samba_cv_SYSCONF_SC_NGROUPS_MAX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8701,12 +8906,12 @@ if test "$cross_compiling" = yes; then
   samba_cv_SYSCONF_SC_NGROUPS_MAX=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8705 "configure"
+#line 8910 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }
 EOF
-if { (eval echo configure:8710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_SYSCONF_SC_NGROUPS_MAX=yes
 else
@@ -8729,7 +8934,7 @@ EOF
 fi
 
 echo $ac_n "checking for root""... $ac_c" 1>&6
-echo "configure:8733: checking for root" >&5
+echo "configure:8938: checking for root" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_ROOT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8738,11 +8943,11 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_ROOT=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8742 "configure"
+#line 8947 "configure"
 #include "confdefs.h"
 main() { exit(getuid() != 0); }
 EOF
-if { (eval echo configure:8746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_ROOT=yes
 else
@@ -8770,7 +8975,7 @@ fi
 # look for a method of finding the list of network interfaces
 iface=no;
 echo $ac_n "checking for iface AIX""... $ac_c" 1>&6
-echo "configure:8774: checking for iface AIX" >&5
+echo "configure:8979: checking for iface AIX" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_IFACE_AIX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8779,7 +8984,7 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_IFACE_AIX=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8783 "configure"
+#line 8988 "configure"
 #include "confdefs.h"
 
 #define HAVE_IFACE_AIX 1
@@ -8787,7 +8992,7 @@ else
 #include "confdefs.h"
 #include "${srcdir-.}/lib/interfaces.c"
 EOF
-if { (eval echo configure:8791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_IFACE_AIX=yes
 else
@@ -8811,7 +9016,7 @@ fi
 
 if test $iface = no; then
 echo $ac_n "checking for iface ifconf""... $ac_c" 1>&6
-echo "configure:8815: checking for iface ifconf" >&5
+echo "configure:9020: checking for iface ifconf" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_IFACE_IFCONF'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8820,7 +9025,7 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_IFACE_IFCONF=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8824 "configure"
+#line 9029 "configure"
 #include "confdefs.h"
 
 #define HAVE_IFACE_IFCONF 1
@@ -8828,7 +9033,7 @@ else
 #include "confdefs.h"
 #include "${srcdir-.}/lib/interfaces.c"
 EOF
-if { (eval echo configure:8832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_IFACE_IFCONF=yes
 else
@@ -8853,7 +9058,7 @@ fi
 
 if test $iface = no; then
 echo $ac_n "checking for iface ifreq""... $ac_c" 1>&6
-echo "configure:8857: checking for iface ifreq" >&5
+echo "configure:9062: checking for iface ifreq" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_IFACE_IFREQ'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8862,7 +9067,7 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_IFACE_IFREQ=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8866 "configure"
+#line 9071 "configure"
 #include "confdefs.h"
 
 #define HAVE_IFACE_IFREQ 1
@@ -8870,7 +9075,7 @@ else
 #include "confdefs.h"
 #include "${srcdir-.}/lib/interfaces.c"
 EOF
-if { (eval echo configure:8874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_IFACE_IFREQ=yes
 else
@@ -8899,7 +9104,7 @@ fi
 seteuid=no;
 if test $seteuid = no; then
 echo $ac_n "checking for setresuid""... $ac_c" 1>&6
-echo "configure:8903: checking for setresuid" >&5
+echo "configure:9108: checking for setresuid" >&5
 if eval "test \"`echo '$''{'samba_cv_USE_SETRESUID'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8908,7 +9113,7 @@ if test "$cross_compiling" = yes; then
   samba_cv_USE_SETRESUID=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8912 "configure"
+#line 9117 "configure"
 #include "confdefs.h"
 
 #define AUTOCONF_TEST 1
@@ -8916,7 +9121,7 @@ else
 #include "confdefs.h"
 #include "${srcdir-.}/lib/util_sec.c"
 EOF
-if { (eval echo configure:8920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_USE_SETRESUID=yes
 else
@@ -8942,7 +9147,7 @@ fi
 
 if test $seteuid = no; then
 echo $ac_n "checking for setreuid""... $ac_c" 1>&6
-echo "configure:8946: checking for setreuid" >&5
+echo "configure:9151: checking for setreuid" >&5
 if eval "test \"`echo '$''{'samba_cv_USE_SETREUID'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8951,7 +9156,7 @@ if test "$cross_compiling" = yes; then
   samba_cv_USE_SETREUID=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8955 "configure"
+#line 9160 "configure"
 #include "confdefs.h"
 
 #define AUTOCONF_TEST 1
@@ -8959,7 +9164,7 @@ else
 #include "confdefs.h"
 #include "${srcdir-.}/lib/util_sec.c"
 EOF
-if { (eval echo configure:8963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_USE_SETREUID=yes
 else
@@ -8984,7 +9189,7 @@ fi
 
 if test $seteuid = no; then
 echo $ac_n "checking for seteuid""... $ac_c" 1>&6
-echo "configure:8988: checking for seteuid" >&5
+echo "configure:9193: checking for seteuid" >&5
 if eval "test \"`echo '$''{'samba_cv_USE_SETEUID'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8993,7 +9198,7 @@ if test "$cross_compiling" = yes; then
   samba_cv_USE_SETEUID=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 8997 "configure"
+#line 9202 "configure"
 #include "confdefs.h"
 
 #define AUTOCONF_TEST 1
@@ -9001,7 +9206,7 @@ else
 #include "confdefs.h"
 #include "${srcdir-.}/lib/util_sec.c"
 EOF
-if { (eval echo configure:9005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_USE_SETEUID=yes
 else
@@ -9026,7 +9231,7 @@ fi
 
 if test $seteuid = no; then
 echo $ac_n "checking for setuidx""... $ac_c" 1>&6
-echo "configure:9030: checking for setuidx" >&5
+echo "configure:9235: checking for setuidx" >&5
 if eval "test \"`echo '$''{'samba_cv_USE_SETUIDX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9035,7 +9240,7 @@ if test "$cross_compiling" = yes; then
   samba_cv_USE_SETUIDX=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9039 "configure"
+#line 9244 "configure"
 #include "confdefs.h"
 
 #define AUTOCONF_TEST 1
@@ -9043,7 +9248,7 @@ else
 #include "confdefs.h"
 #include "${srcdir-.}/lib/util_sec.c"
 EOF
-if { (eval echo configure:9047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_USE_SETUIDX=yes
 else
@@ -9068,7 +9273,7 @@ fi
 
 
 echo $ac_n "checking for shared mmap""... $ac_c" 1>&6
-echo "configure:9072: checking for shared mmap" >&5
+echo "configure:9277: checking for shared mmap" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_SHARED_MMAP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9077,11 +9282,11 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_SHARED_MMAP=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9081 "configure"
+#line 9286 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/shared_mmap.c"
 EOF
-if { (eval echo configure:9085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_SHARED_MMAP=yes
 else
@@ -9108,7 +9313,7 @@ EOF
 fi
 
 echo $ac_n "checking for ftruncate needs root""... $ac_c" 1>&6
-echo "configure:9112: checking for ftruncate needs root" >&5
+echo "configure:9317: checking for ftruncate needs root" >&5
 if eval "test \"`echo '$''{'samba_cv_FTRUNCATE_NEEDS_ROOT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9117,11 +9322,11 @@ if test "$cross_compiling" = yes; then
   samba_cv_FTRUNCATE_NEEDS_ROOT=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9121 "configure"
+#line 9326 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/ftruncroot.c"
 EOF
-if { (eval echo configure:9125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_FTRUNCATE_NEEDS_ROOT=yes
 else
@@ -9144,7 +9349,7 @@ EOF
 fi
 
 echo $ac_n "checking for fcntl locking""... $ac_c" 1>&6
-echo "configure:9148: checking for fcntl locking" >&5
+echo "configure:9353: checking for fcntl locking" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_FCNTL_LOCK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9153,11 +9358,11 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_FCNTL_LOCK=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9157 "configure"
+#line 9362 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/fcntl_lock.c"
 EOF
-if { (eval echo configure:9161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_FCNTL_LOCK=yes
 else
@@ -9180,7 +9385,7 @@ EOF
 fi
 
 echo $ac_n "checking for broken (glibc2.1/x86) 64 bit fcntl locking""... $ac_c" 1>&6
-echo "configure:9184: checking for broken (glibc2.1/x86) 64 bit fcntl locking" >&5
+echo "configure:9389: checking for broken (glibc2.1/x86) 64 bit fcntl locking" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_BROKEN_FCNTL64_LOCKS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9189,11 +9394,11 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9193 "configure"
+#line 9398 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/fcntl_lock64.c"
 EOF
-if { (eval echo configure:9197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes
 else
@@ -9218,7 +9423,7 @@ else
 
 
   echo $ac_n "checking for 64 bit fcntl locking""... $ac_c" 1>&6
-echo "configure:9222: checking for 64 bit fcntl locking" >&5
+echo "configure:9427: checking for 64 bit fcntl locking" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_STRUCT_FLOCK64'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9227,7 +9432,7 @@ else
   samba_cv_HAVE_STRUCT_FLOCK64=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9231 "configure"
+#line 9436 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_UNISTD_H)
@@ -9251,7 +9456,7 @@ exit(1);
 #endif
 }
 EOF
-if { (eval echo configure:9255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_STRUCT_FLOCK64=yes
 else
@@ -9276,7 +9481,7 @@ EOF
 fi
 
 echo $ac_n "checking for sysv ipc""... $ac_c" 1>&6
-echo "configure:9280: checking for sysv ipc" >&5
+echo "configure:9485: checking for sysv ipc" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_SYSV_IPC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9285,11 +9490,11 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_SYSV_IPC=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9289 "configure"
+#line 9494 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/sysv_ipc.c"
 EOF
-if { (eval echo configure:9293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_SYSV_IPC=yes
 else
@@ -9312,7 +9517,7 @@ EOF
 fi
 
 echo $ac_n "checking for IRIX sysv ipc semun problem using gcc""... $ac_c" 1>&6
-echo "configure:9316: checking for IRIX sysv ipc semun problem using gcc" >&5
+echo "configure:9521: checking for IRIX sysv ipc semun problem using gcc" >&5
 if eval "test \"`echo '$''{'samba_cv_NEED_SGI_SEMUN_HACK'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9321,11 +9526,11 @@ if test "$cross_compiling" = yes; then
   samba_cv_NEED_SGI_SEMUN_HACK=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9325 "configure"
+#line 9530 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/sgi_sysv_hack.c"
 EOF
-if { (eval echo configure:9329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_NEED_SGI_SEMUN_HACK=yes
 else
@@ -9348,7 +9553,7 @@ EOF
 fi
 
 echo $ac_n "checking for a crypt that needs truncated salt""... $ac_c" 1>&6
-echo "configure:9352: checking for a crypt that needs truncated salt" >&5
+echo "configure:9557: checking for a crypt that needs truncated salt" >&5
 if eval "test \"`echo '$''{'samba_cv_HAVE_TRUNCATED_SALT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9357,11 +9562,11 @@ if test "$cross_compiling" = yes; then
   samba_cv_HAVE_TRUNCATED_SALT=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 9361 "configure"
+#line 9566 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/crypttest.c"
 EOF
-if { (eval echo configure:9365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:9570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   samba_cv_HAVE_TRUNCATED_SALT=no
 else
@@ -9384,13 +9589,13 @@ EOF
 fi
 
 echo $ac_n "checking for broken nisplus include files""... $ac_c" 1>&6
-echo "configure:9388: checking for broken nisplus include files" >&5
+echo "configure:9593: checking for broken nisplus include files" >&5
 if eval "test \"`echo '$''{'samba_cv_BROKEN_NISPLUS_INCLUDE_FILES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
 cat > conftest.$ac_ext <<EOF
-#line 9394 "configure"
+#line 9599 "configure"
 #include "confdefs.h"
 #include <sys/acl.h>
 #if defined(HAVE_RPCSVC_NIS_H)
@@ -9400,7 +9605,7 @@ int main() {
 return 0;
 ; return 0; }
 EOF
-if { (eval echo configure:9404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no
 else
@@ -9424,7 +9629,7 @@ fi
 #################################################
 # check for smbwrapper support
 echo $ac_n "checking whether to use smbwrapper""... $ac_c" 1>&6
-echo "configure:9428: checking whether to use smbwrapper" >&5
+echo "configure:9633: checking whether to use smbwrapper" >&5
 # Check whether --with-smbwrapper or --without-smbwrapper was given.
 if test "${with_smbwrapper+set}" = set; then
   withval="$with_smbwrapper"
@@ -9468,7 +9673,7 @@ fi
 #################################################
 # check for the AFS filesystem
 echo $ac_n "checking whether to use AFS""... $ac_c" 1>&6
-echo "configure:9472: checking whether to use AFS" >&5
+echo "configure:9677: checking whether to use AFS" >&5
 # Check whether --with-afs or --without-afs was given.
 if test "${with_afs+set}" = set; then
   withval="$with_afs"
@@ -9494,7 +9699,7 @@ fi
 #################################################
 # check for the DFS auth system
 echo $ac_n "checking whether to use DFS auth""... $ac_c" 1>&6
-echo "configure:9498: checking whether to use DFS auth" >&5
+echo "configure:9703: checking whether to use DFS auth" >&5
 # Check whether --with-dfs or --without-dfs was given.
 if test "${with_dfs+set}" = set; then
   withval="$with_dfs"
@@ -9519,7 +9724,7 @@ fi
 #################################################
 # check for Kerberos IV auth system
 echo $ac_n "checking whether to use Kerberos IV""... $ac_c" 1>&6
-echo "configure:9523: checking whether to use Kerberos IV" >&5
+echo "configure:9728: checking whether to use Kerberos IV" >&5
 # Check whether --with-krb4 or --without-krb4 was given.
 if test "${with_krb4+set}" = set; then
   withval="$with_krb4"
@@ -9529,7 +9734,7 @@ if test "${with_krb4+set}" = set; then
 EOF
 
     echo $ac_n "checking for dn_expand in -lresolv""... $ac_c" 1>&6
-echo "configure:9533: checking for dn_expand in -lresolv" >&5
+echo "configure:9738: checking for dn_expand in -lresolv" >&5
 ac_lib_var=`echo resolv'_'dn_expand | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9537,7 +9742,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9541 "configure"
+#line 9746 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9548,7 +9753,7 @@ int main() {
 dn_expand()
 ; return 0; }
 EOF
-if { (eval echo configure:9552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9587,7 +9792,7 @@ fi
 #################################################
 # check for Kerberos 5 auth system
 echo $ac_n "checking whether to use Kerberos 5""... $ac_c" 1>&6
-echo "configure:9591: checking whether to use Kerberos 5" >&5
+echo "configure:9796: checking whether to use Kerberos 5" >&5
 # Check whether --with-krb5 or --without-krb5 was given.
 if test "${with_krb5+set}" = set; then
   withval="$with_krb5"
@@ -9608,7 +9813,7 @@ fi
 #################################################
 # check for automount support
 echo $ac_n "checking whether to use AUTOMOUNT""... $ac_c" 1>&6
-echo "configure:9612: checking whether to use AUTOMOUNT" >&5
+echo "configure:9817: checking whether to use AUTOMOUNT" >&5
 # Check whether --with-automount or --without-automount was given.
 if test "${with_automount+set}" = set; then
   withval="$with_automount"
@@ -9633,7 +9838,7 @@ fi
 #################################################
 # check for smbmount support
 echo $ac_n "checking whether to use SMBMOUNT""... $ac_c" 1>&6
-echo "configure:9637: checking whether to use SMBMOUNT" >&5
+echo "configure:9842: checking whether to use SMBMOUNT" >&5
 # Check whether --with-smbmount or --without-smbmount was given.
 if test "${with_smbmount+set}" = set; then
   withval="$with_smbmount"
@@ -9662,7 +9867,7 @@ fi
 #################################################
 # check for a PAM password database
 echo $ac_n "checking whether to use PAM password database""... $ac_c" 1>&6
-echo "configure:9666: checking whether to use PAM password database" >&5
+echo "configure:9871: checking whether to use PAM password database" >&5
 # Check whether --with-pam or --without-pam was given.
 if test "${with_pam+set}" = set; then
   withval="$with_pam"
@@ -9689,7 +9894,7 @@ fi
 #################################################
 # check for a LDAP password database
 echo $ac_n "checking whether to use LDAP password database""... $ac_c" 1>&6
-echo "configure:9693: checking whether to use LDAP password database" >&5
+echo "configure:9898: checking whether to use LDAP password database" >&5
 # Check whether --with-ldap or --without-ldap was given.
 if test "${with_ldap+set}" = set; then
   withval="$with_ldap"
@@ -9715,7 +9920,7 @@ fi
 #################################################
 # check for a NISPLUS password database
 echo $ac_n "checking whether to use NISPLUS password database""... $ac_c" 1>&6
-echo "configure:9719: checking whether to use NISPLUS password database" >&5
+echo "configure:9924: checking whether to use NISPLUS password database" >&5
 # Check whether --with-nisplus or --without-nisplus was given.
 if test "${with_nisplus+set}" = set; then
   withval="$with_nisplus"
@@ -9740,7 +9945,7 @@ fi
 #################################################
 # check for a NISPLUS_HOME support 
 echo $ac_n "checking whether to use NISPLUS_HOME""... $ac_c" 1>&6
-echo "configure:9744: checking whether to use NISPLUS_HOME" >&5
+echo "configure:9949: checking whether to use NISPLUS_HOME" >&5
 # Check whether --with-nisplus-home or --without-nisplus-home was given.
 if test "${with_nisplus_home+set}" = set; then
   withval="$with_nisplus_home"
@@ -9765,7 +9970,7 @@ fi
 #################################################
 # check for the secure socket layer
 echo $ac_n "checking whether to use SSL""... $ac_c" 1>&6
-echo "configure:9769: checking whether to use SSL" >&5
+echo "configure:9974: checking whether to use SSL" >&5
 # Check whether --with-ssl or --without-ssl was given.
 if test "${with_ssl+set}" = set; then
   withval="$with_ssl"
@@ -9824,7 +10029,7 @@ fi
 #################################################
 # check for syslog logging
 echo $ac_n "checking whether to use syslog logging""... $ac_c" 1>&6
-echo "configure:9828: checking whether to use syslog logging" >&5
+echo "configure:10033: checking whether to use syslog logging" >&5
 # Check whether --with-syslog or --without-syslog was given.
 if test "${with_syslog+set}" = set; then
   withval="$with_syslog"
@@ -9849,7 +10054,7 @@ fi
 #################################################
 # check for a shared memory profiling support
 echo $ac_n "checking whether to use profiling""... $ac_c" 1>&6
-echo "configure:9853: checking whether to use profiling" >&5
+echo "configure:10058: checking whether to use profiling" >&5
 # Check whether --with-profile or --without-profile was given.
 if test "${with_profile+set}" = set; then
   withval="$with_profile"
@@ -9875,7 +10080,7 @@ fi
 #################################################
 # check for experimental netatalk resource fork support
 echo $ac_n "checking whether to support netatalk""... $ac_c" 1>&6
-echo "configure:9879: checking whether to support netatalk" >&5
+echo "configure:10084: checking whether to support netatalk" >&5
 # Check whether --with-netatalk or --without-netatalk was given.
 if test "${with_netatalk+set}" = set; then
   withval="$with_netatalk"
@@ -9902,7 +10107,7 @@ fi
 QUOTAOBJS=noquotas.o
 
 echo $ac_n "checking whether to support disk-quotas""... $ac_c" 1>&6
-echo "configure:9906: checking whether to support disk-quotas" >&5
+echo "configure:10111: checking whether to support disk-quotas" >&5
 # Check whether --with-quotas or --without-quotas was given.
 if test "${with_quotas+set}" = set; then
   withval="$with_quotas"
@@ -9926,7 +10131,7 @@ fi
 # check for experimental utmp accounting
 
 echo $ac_n "checking whether to support utmp accounting""... $ac_c" 1>&6
-echo "configure:9930: checking whether to support utmp accounting" >&5
+echo "configure:10135: checking whether to support utmp accounting" >&5
 # Check whether --with-utmp or --without-utmp was given.
 if test "${with_utmp+set}" = set; then
   withval="$with_utmp"
 #################################################
 # these tests are taken from the GNU fileutils package
 echo "checking how to get filesystem space usage" 1>&6
-echo "configure:10056: checking how to get filesystem space usage" >&5
+echo "configure:10261: checking how to get filesystem space usage" >&5
 space=no
 
 # Test for statvfs64.
 if test $space = no; then
   # SVR4
   echo $ac_n "checking statvfs64 function (SVR4)""... $ac_c" 1>&6
-echo "configure:10063: checking statvfs64 function (SVR4)" >&5
+echo "configure:10268: checking statvfs64 function (SVR4)" >&5
 if eval "test \"`echo '$''{'fu_cv_sys_stat_statvfs64'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10067,7 +10272,7 @@ else
   fu_cv_sys_stat_statvfs64=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 10071 "configure"
+#line 10276 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_UNISTD_H)
@@ -10081,7 +10286,7 @@ else
     exit (statvfs64 (".", &fsd));
   }
 EOF
-if { (eval echo configure:10085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   fu_cv_sys_stat_statvfs64=yes
 else
 if test $space = no; then
   # SVR4
   echo $ac_n "checking statvfs function (SVR4)""... $ac_c" 1>&6
-echo "configure:10118: checking statvfs function (SVR4)" >&5
+echo "configure:10323: checking statvfs function (SVR4)" >&5
 if eval "test \"`echo '$''{'fu_cv_sys_stat_statvfs'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 10123 "configure"
+#line 10328 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/statvfs.h>
@@ -10127,7 +10332,7 @@ int main() {
 struct statvfs fsd; statvfs (0, &fsd);
 ; return 0; }
 EOF
-if { (eval echo configure:10131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   fu_cv_sys_stat_statvfs=yes
 else
@@ -10152,7 +10357,7 @@ fi
 if test $space = no; then
   # DEC Alpha running OSF/1
   echo $ac_n "checking for 3-argument statfs function (DEC OSF/1)""... $ac_c" 1>&6
-echo "configure:10156: checking for 3-argument statfs function (DEC OSF/1)" >&5
+echo "configure:10361: checking for 3-argument statfs function (DEC OSF/1)" >&5
   if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs3_osf1'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10160,7 +10365,7 @@ else
   fu_cv_sys_stat_statfs3_osf1=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 10164 "configure"
+#line 10369 "configure"
 #include "confdefs.h"
 
 #include <sys/param.h>
@@ -10173,7 +10378,7 @@ else
     exit (statfs (".", &fsd, sizeof (struct statfs)));
   }
 EOF
-if { (eval echo configure:10177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   fu_cv_sys_stat_statfs3_osf1=yes
 else
@@ -10200,7 +10405,7 @@ fi
 if test $space = no; then
 # AIX
   echo $ac_n "checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)""... $ac_c" 1>&6
-echo "configure:10204: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5
+echo "configure:10409: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5
   if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs2_bsize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10208,7 +10413,7 @@ else
   fu_cv_sys_stat_statfs2_bsize=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 10212 "configure"
+#line 10417 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_SYS_PARAM_H
@@ -10227,7 +10432,7 @@ else
   exit (statfs (".", &fsd));
   }
 EOF
-if { (eval echo configure:10231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   fu_cv_sys_stat_statfs2_bsize=yes
 else
@@ -10254,7 +10459,7 @@ fi
 if test $space = no; then
 # SVR3
   echo $ac_n "checking for four-argument statfs (AIX-3.2.5, SVR3)""... $ac_c" 1>&6
-echo "configure:10258: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5
+echo "configure:10463: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5
   if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs4'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10262,7 +10467,7 @@ else
   fu_cv_sys_stat_statfs4=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 10266 "configure"
+#line 10471 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/statfs.h>
@@ -10272,7 +10477,7 @@ else
   exit (statfs (".", &fsd, sizeof fsd, 0));
   }
 EOF
-if { (eval echo configure:10276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   fu_cv_sys_stat_statfs4=yes
 else
@@ -10299,7 +10504,7 @@ fi
 if test $space = no; then
 # 4.4BSD and NetBSD
   echo $ac_n "checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)""... $ac_c" 1>&6
-echo "configure:10303: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5
+echo "configure:10508: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5
   if eval "test \"`echo '$''{'fu_cv_sys_stat_statfs2_fsize'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10307,7 +10512,7 @@ else
   fu_cv_sys_stat_statfs2_fsize=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 10311 "configure"
+#line 10516 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
@@ -10323,7 +10528,7 @@ else
   exit (statfs (".", &fsd));
   }
 EOF
-if { (eval echo configure:10327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   fu_cv_sys_stat_statfs2_fsize=yes
 else
@@ -10350,7 +10555,7 @@ fi
 if test $space = no; then
   # Ultrix
   echo $ac_n "checking for two-argument statfs with struct fs_data (Ultrix)""... $ac_c" 1>&6
-echo "configure:10354: checking for two-argument statfs with struct fs_data (Ultrix)" >&5
+echo "configure:10559: checking for two-argument statfs with struct fs_data (Ultrix)" >&5
   if eval "test \"`echo '$''{'fu_cv_sys_stat_fs_data'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -10358,7 +10563,7 @@ else
   fu_cv_sys_stat_fs_data=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 10362 "configure"
+#line 10567 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #ifdef HAVE_SYS_PARAM_H
@@ -10378,7 +10583,7 @@ else
   exit (statfs (".", &fsd) != 1);
   }
 EOF
-if { (eval echo configure:10382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   fu_cv_sys_stat_fs_data=yes
 else
@@ -10412,7 +10617,7 @@ fi
 #
 echo "checking if large file support can be enabled"
 cat > conftest.$ac_ext <<EOF
-#line 10416 "configure"
+#line 10621 "configure"
 #include "confdefs.h"
 
 #if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
@@ -10425,7 +10630,7 @@ int main() {
 int i
 ; return 0; }
 EOF
-if { (eval echo configure:10429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10634: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes
 else
@@ -10450,11 +10655,11 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 10454 "configure"
+#line 10659 "configure"
 #include "confdefs.h"
 #include "${srcdir-.}/tests/summary.c"
 EOF
-if { (eval echo configure:10458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:10663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   echo "configure OK";
 else
index 826e69c4bcda234c2b48c77cfdc4f36c20dfe234..c6da4fcf77a3be0f752f87d5575db08ccab4de1d 100644 (file)
@@ -707,6 +707,59 @@ if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
     AC_DEFINE(HAVE_UTIMBUF)
 fi
 
+dnl  utmp and utmpx come in many flavours
+dnl  We need to check for many of them
+dnl  But we don't need to do each and every one, because our code uses
+dnl  mostly just the utmp (not utmpx) fields.
+
+AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[
+AC_TRY_COMPILE([#include <utmp.h>],
+[struct utmp ut;  ut.ut_name[0] = 'a';],
+samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)])
+if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
+    AC_DEFINE(HAVE_UT_UT_NAME)
+fi 
+
+AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[
+AC_TRY_COMPILE([#include <utmp.h>],
+[struct utmp ut;  ut.ut_user[0] = 'a';],
+samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)])
+if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
+    AC_DEFINE(HAVE_UT_UT_USER)
+fi 
+
+AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[
+AC_TRY_COMPILE([#include <utmp.h>],
+[struct utmp ut;  ut.ut_id[0] = 'a';],
+samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)])
+if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
+    AC_DEFINE(HAVE_UT_UT_ID)
+fi 
+
+AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[
+AC_TRY_COMPILE([#include <utmp.h>],
+[struct utmp ut;  ut.ut_host[0] = 'a';],
+samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)])
+if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
+    AC_DEFINE(HAVE_UT_UT_HOST)
+fi 
+
+AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[
+AC_TRY_COMPILE([#include <utmp.h>],
+[struct utmp ut;  time_t t; ut.ut_time = t;],
+samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)])
+if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
+    AC_DEFINE(HAVE_UT_UT_TIME)
+fi 
+
+AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[
+AC_TRY_COMPILE([#include <utmp.h>],
+[struct utmp ut;  struct timeval tv; ut.ut_tv = tv;],
+samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)])
+if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
+    AC_DEFINE(HAVE_UT_UT_TV)
+fi 
+
 AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
 AC_TRY_COMPILE([#include <utmpx.h>],
 [struct utmpx ux;  ux.ut_syslen = 0;],
index 14eaabc9fa79415e43cc33dbe583f893ea22c203..d230974f44c727ab782fcec0de3f941bec24f26f 100644 (file)
 #undef USE_SETUIDX
 #undef NEED_SGI_SEMUN_HACK
 #undef SYSCONF_SC_NGROUPS_MAX
+#undef HAVE_UT_UT_NAME
+#undef HAVE_UT_UT_USER
+#undef HAVE_UT_UT_ID
+#undef HAVE_UT_UT_HOST
+#undef HAVE_UT_UT_TIME
+#undef HAVE_UT_UT_TV
 #undef HAVE_UX_UT_SYSLEN
 #undef COMPILER_SUPPORTS_LL
 
index c9178e18793094b58e2bbb83622200a5a3ffb133..2c4fadaa5af4f67ed1e01e53bfa9fe7740952153 100644 (file)
@@ -1021,6 +1021,9 @@ char *lp_serverstring(void);
 char *lp_printcapname(void);
 char *lp_lockdir(void);
 char *lp_utmpdir(void);
+char *lp_wtmpdir(void);
+char *lp_utmp_hostname(void);
+BOOL lp_utmp_consolidate(void);
 char *lp_rootdir(void);
 char *lp_source_environment(void);
 char *lp_defaultservice(void);
index 11f0bf3fe94129535149e1dca338fd7fecf20441..611e5afda6319c56f1c89123659c1537c078d6f8 100644 (file)
@@ -161,6 +161,9 @@ typedef struct
   char *szWINSHook;
 #ifdef WITH_UTMP
   char *szUtmpDir;
+  char *szWtmpDir;
+  char *szUtmpHostname;
+  BOOL bUtmpConsolidate;
 #endif /* WITH_UTMP */
   char *szSourceEnv;
   int max_log_size;
@@ -820,6 +823,10 @@ static struct parm_struct parm_table[] =
 #ifdef WITH_UTMP
   {"utmp directory",   P_STRING,  P_GLOBAL, &Globals.szUtmpDir,         NULL,   NULL,  0},
   {"utmp dir",         P_STRING,  P_GLOBAL, &Globals.szUtmpDir,         NULL,   NULL,  0},
+  {"wtmp directory",   P_STRING,  P_GLOBAL, &Globals.szWtmpDir,         NULL,   NULL,  0},
+  {"wtmp dir",         P_STRING,  P_GLOBAL, &Globals.szWtmpDir,         NULL,   NULL,  0},
+  {"utmp hostname",    P_STRING,  P_GLOBAL, &Globals.szUtmpHostname,    NULL,   NULL,  0},
+  {"utmp consolidate", P_BOOL,    P_GLOBAL, &Globals.bUtmpConsolidate,  NULL,   NULL,  0},
 #endif /* WITH_UTMP */
   {"default service",  P_STRING,  P_GLOBAL, &Globals.szDefaultService,  NULL,   NULL,  0},
   {"default",          P_STRING,  P_GLOBAL, &Globals.szDefaultService,  NULL,   NULL,  0},
@@ -907,6 +914,9 @@ static void init_globals(void)
   string_set(&Globals.szRootdir, "/");
 #ifdef WITH_UTMP
   string_set(&Globals.szUtmpDir, "");
+  string_set(&Globals.szWtmpDir, "");
+  string_set(&Globals.szUtmpHostname, "%m");
+  Globals.bUtmpConsolidate = False;
 #endif /* WITH_UTMP */
   string_set(&Globals.szSmbrun, SMBRUN);
   string_set(&Globals.szSocketAddress, "0.0.0.0");
@@ -1177,6 +1187,9 @@ FN_GLOBAL_STRING(lp_printcapname,&Globals.szPrintcapname)
 FN_GLOBAL_STRING(lp_lockdir,&Globals.szLockDir)
 #ifdef WITH_UTMP
 FN_GLOBAL_STRING(lp_utmpdir,&Globals.szUtmpDir)
+FN_GLOBAL_STRING(lp_wtmpdir,&Globals.szWtmpDir)
+FN_GLOBAL_STRING(lp_utmp_hostname,&Globals.szUtmpHostname)
+FN_GLOBAL_BOOL(lp_utmp_consolidate,&Globals.bUtmpConsolidate)
 #endif /* WITH_UTMP */
 FN_GLOBAL_STRING(lp_rootdir,&Globals.szRootdir)
 FN_GLOBAL_STRING(lp_source_environment,&Globals.szSourceEnv)
index 5e361d8899c2ec26beb854f6878cbd4f7a947aed..b2fbb479a35f889ea2baa73ca3f6ce793613bb70 100644 (file)
@@ -28,7 +28,7 @@ extern int DEBUGLEVEL;
 
 #ifdef WITH_UTMP
 static void utmp_yield(pid_t pid, const connection_struct *conn, int i);
-static void utmp_claim(const struct connect_record *crec, const connection_struct *conn, int i);
+static void utmp_claim(const struct connect_record *crec, connection_struct *conn, int i);
 #endif
 
 /****************************************************************************
@@ -258,6 +258,9 @@ OS status:
        HPUX 9.x:  Not tested.  Appears not to have "x".
        IRIX 6.5:  Not tested.  Appears to have "x".
 
+OS observations:
+       Almost every OS seems to have its own quirks.
+
 Notes:
        The 4 byte 'ut_id' component is vital to distinguish connections,
        of which there could be several hundered or even thousand.
@@ -289,6 +292,14 @@ Notes:
 
 #include <utmp.h>
 
+/*
+ * Apparently AIX has utmpx.h but doesn't implement it.
+ * The test for this ought to be (a) more automatic (b) elsewhere.
+ */
+#if defined (AIX)
+#undef HAVE_UTMPX_H
+#endif
+
 #ifdef HAVE_UTMPX_H
 #include <utmpx.h>
 #endif
@@ -320,60 +331,130 @@ ut_id_encode(int i, char *fourbyte)
        return(i);      /* 0: good; else overflow */
 }
 
-static int utmp_fill(struct utmp *u, const connection_struct *conn, pid_t pid, int i)
+/*
+ * Fill in a utmp (not utmpx) template
+ */
+static int utmp_fill(struct utmp *u, const connection_struct *conn, pid_t pid,
+  int i, pstring host)
 {
+#if defined(HAVE_UT_UT_TIME)
        struct timeval timeval;
-       int rc;
+#endif /* defined(HAVE_UT_UT_TIME) */
+       int rc = 0;
 
+#if defined(HAVE_UT_UT_USER)
        pstrcpy(u->ut_user, conn->user);
-       rc = ut_id_encode(i, u->ut_id);
+#endif /* defined(HAVE_UT_UT_USER) */
+
+#if defined(HAVE_UT_UT_NAME)
+       pstrcpy(u->ut_name, conn->user);
+#endif /* defined(HAVE_UT_UT_NAME) */
+
        slprintf(u->ut_line, 12, "smb/%d", i);
 
        u->ut_pid = pid;
 
+#if defined(HAVE_UT_UT_TIME)
        gettimeofday(&timeval, NULL);
        u->ut_time = timeval.tv_sec;
+#endif /* defined(HAVE_UT_UT_TIME) */
+
+#if defined(HAVE_UT_UT_TV)
+       gettimeofday(&timeval, NULL);
+       u->ut_tv = timeval;
+#endif /* defined(HAVE_UT_UT_TV) */
+
+#if defined(HAVE_UT_UT_HOST)
+       if (host) {
+               pstrcpy(u->ut_host, host);
+       }
+#endif /* defined(HAVE_UT_UT_HOST) */
+
+#if defined(HAVE_UT_UT_ID)
+       rc = ut_id_encode(i, u->ut_id);
+#endif /* defined(HAVE_UT_UT_ID) */
 
        return(rc);
 }
 
-/* Default path (if possible) */
+/*
+ * Default paths to various {u,w}tmp{,x} files
+ */
 #ifdef HAVE_UTMPX_H
 
-# ifdef UTMPX_FILE
-static char *ut_pathname = UTMPX_FILE;
+static char *ux_pathname =
+# if defined (UTMPX_FILE)
+       UTMPX_FILE ;
+# elif defined (_UTMPX_FILE)
+       _UTMPX_FILE ;
+# elif defined (_PATH_UTMPX)
+       _PATH_UTMPX ;
 # else
-static char *ut_pathname = "";
+       "" ;
 # endif
-# ifdef WTMPX_FILE
-static char *wt_pathname = WTMPX_FILE;
+
+static char *wx_pathname =
+# if defined (WTMPX_FILE)
+       WTMPX_FILE ;
+# elif defined (_WTMPX_FILE)
+       _WTMPX_FILE ;
+# elif defined (_PATH_WTMPX)
+       _PATH_WTMPX ;
 # else
-static char *wt_pathname = "";
+       "" ;
 # endif
 
-#else  /* HAVE_UTMPX_H */
+#endif /* HAVE_UTMPX_H */
 
-# ifdef UTMP_FILE
-static char *ut_pathname = UTMP_FILE;
+static char *ut_pathname =
+# if defined (UTMP_FILE)
+       UTMP_FILE ;
+# elif defined (_UTMP_FILE)
+       _UTMP_FILE ;
+# elif defined (_PATH_UTMP)
+       _PATH_UTMP ;
 # else
-static char *ut_pathname = "";
+       "" ;
 # endif
-# ifdef WTMP_FILE
-static char *wt_pathname = WTMP_FILE;
+
+static char *wt_pathname =
+# if defined (WTMP_FILE)
+       WTMP_FILE ;
+# elif defined (_WTMP_FILE)
+       _WTMP_FILE ;
+# elif defined (_PATH_WTMP)
+       _PATH_WTMP ;
 # else
-static char *wt_pathname = "";
+       "" ;
 # endif
 
-#endif /* HAVE_UTMPX_H */
-
-static void uw_pathname(pstring fname, const char *uw_name)
+/*
+ * Get name of {u,w}tmp{,x} file.
+ *     return: fname contains filename
+ *             Possibly empty if this code not yet ported to this system.
+ *
+ * utmp{,x}:  try "utmp dir", then default (a define)
+ * wtmp{,x}:  try "wtmp dir", then "utmp dir", then default (a define)
+ */
+static void uw_pathname(pstring fname, const char *uw_name, const char *uw_default)
 {
        pstring dirname;
 
-       pstrcpy(dirname,lp_utmpdir());
-       trim_string(dirname,"","/");
+       pstrcpy(dirname, "");
+
+       /* For w-files, first look for explicit "wtmp dir" */
+       if (uw_name[0] == 'w') {
+               pstrcpy(dirname,lp_wtmpdir());
+               trim_string(dirname,"","/");
+       }
+
+       /* For u-files and non-explicit w-dir, look for "utmp dir" */
+       if (dirname == 0 || strlen(dirname) == 0) {
+               pstrcpy(dirname,lp_utmpdir());
+               trim_string(dirname,"","/");
+       }
 
-       /* Given directory: use it */
+       /* If explicit directory above, use it */
        if (dirname != 0 && strlen(dirname) != 0) {
                pstrcpy(fname, dirname);
                pstrcat(fname, "/");
@@ -381,21 +462,17 @@ static void uw_pathname(pstring fname, const char *uw_name)
                return;
        }
 
-       /* No given directory: attempt to use default paths */
-       if (uw_name[0] == 'u') {
-               pstrcpy(fname, ut_pathname);
-               return;
-       }
-
-       if (uw_name[0] == 'w') {
-               pstrcpy(fname, wt_pathname);
-               return;
+       /* No explicit directory: attempt to use default paths */
+       if (strlen(uw_default) == 0) {
+               /* No explicit setting, no known default.
+                * Has it yet been ported to this OS?
+                */
+               DEBUG(2,("uw_pathname: unable to determine pathname\n"));
        }
-
-       pstrcpy(fname, "");
+       pstrcpy(fname, uw_default);
 }
 
-static void utmp_update(const struct utmp *u, const char *host)
+static void utmp_update(const struct utmp *u, pstring host)
 {
        pstring fname;
 
@@ -410,31 +487,35 @@ static void utmp_update(const struct utmp *u, const char *host)
                pstrcpy(ux.ut_host, host);
        }
 
-       uw_pathname(fname, "utmpx");
+       uw_pathname(fname, "utmpx", ux_pathname);
        DEBUG(2,("utmp_update: fname:%s\n", fname));
        if (strlen(fname) != 0) {
                utmpxname(fname);
        }
+       setutxent();
        uxrc = pututxline(&ux);
+       endutxent();
        if (uxrc == NULL) {
                DEBUG(2,("utmp_update: pututxline() failed\n"));
                return;
        }
 
-       uw_pathname(fname, "wtmpx");
+       uw_pathname(fname, "wtmpx", wx_pathname);
        DEBUG(2,("utmp_update: fname:%s\n", fname));
        if (strlen(fname) != 0) {
                updwtmpx(fname, &ux);
        }
 #else
-       uw_pathname(fname, "utmp");
+       uw_pathname(fname, "utmp", ut_pathname);
        DEBUG(2,("utmp_update: fname:%s\n", fname));
        if (strlen(fname) != 0) {
                utmpname(fname);
        }
+       setutent();
        pututline(u);
+       endutent();
 
-       uw_pathname(fname, "wtmp");
+       uw_pathname(fname, "wtmp", wt_pathname);
 
        /* *** Hmmm.  Appending wtmp (as distinct from overwriting utmp) has
        me baffled.  How is it to be done? *** */
@@ -444,28 +525,36 @@ static void utmp_update(const struct utmp *u, const char *host)
 static void utmp_yield(pid_t pid, const connection_struct *conn, int i)
 {
        struct utmp u;
+       int nopen;
 
        if (! lp_utmp(SNUM(conn))) {
                DEBUG(2,("utmp_yield: lp_utmp() NULL\n"));
                return;
        }
 
-       DEBUG(2,("utmp_yield: conn: user:%s cnum:%d i:%d\n",
-         conn->user, conn->cnum, i));
+       nopen = conn_num_open();
+       DEBUG(2,("utmp_yield: conn: user:%s cnum:%d i:%d (nopen:%d)\n",
+         conn->user, conn->cnum, i, nopen));
+
+       if (lp_utmp_consolidate() && nopen > 1) {
+               DEBUG(2,("utmp_yield: utmp consolidate: %d entries open\n", nopen));
+               return;
+       }
 
        memset((char *)&u, '\0', sizeof(struct utmp));
        u.ut_type = DEAD_PROCESS;
        u.ut_exit.e_termination = 0;
        u.ut_exit.e_exit = 0;
-       if (utmp_fill(&u, conn, pid, i) == 0) {
+       if (utmp_fill(&u, conn, pid, i, NULL) == 0) {
                utmp_update(&u, NULL);
        }
 }
 
-static void utmp_claim(const struct connect_record *crec, const connection_struct *conn, int i)
+static void utmp_claim(const struct connect_record *crec, connection_struct *conn, int i)
 {
-       extern int Client;
        struct utmp u;
+       pstring host;
+       int nopen;
 
        if (conn == NULL) {
                DEBUG(2,("utmp_claim: conn NULL\n"));
@@ -477,16 +566,32 @@ static void utmp_claim(const struct connect_record *crec, const connection_struc
                return;
        }
 
-       DEBUG(2,("utmp_claim: conn: user:%s cnum:%d i:%d\n",
-         conn->user, conn->cnum, i));
-       DEBUG(2,("utmp_claim: crec: pid:%d, cnum:%d name:%s addr:%s mach:%s DNS:%s\n",
-         crec->pid, crec->cnum, crec->name, crec->addr, crec->machine, client_name(Client)));
+       nopen = conn_num_open();
+       if (lp_utmp_consolidate() && nopen > 1) {
+               DEBUG(2,("utmp_claim: utmp consolidate: %d entries open\n", nopen));
+               return;
+       }
+
+       pstrcpy(host, lp_utmp_hostname());
+       if (host == 0 || strlen(host) == 0) {
+               pstrcpy(host, crec->machine);
+       }
+       else {
+               /* explicit "utmp host": expand for any "%" variables */
+               standard_sub(conn, host);
+       }
+
+       nopen = conn_num_open();
+       DEBUG(2,("utmp_claim: conn: user:%s cnum:%d i:%d (nopen:%d)\n",
+         conn->user, conn->cnum, i, nopen));
+       DEBUG(2,("utmp_claim: crec: pid:%d, cnum:%d name:%s addr:%s mach:%s host:%s\n",
+         crec->pid, crec->cnum, crec->name, crec->addr, crec->machine, host));
 
 
        memset((char *)&u, '\0', sizeof(struct utmp));
        u.ut_type = USER_PROCESS;
-       if (utmp_fill(&u, conn, crec->pid, i) == 0) {
-               utmp_update(&u, crec->machine);
+       if (utmp_fill(&u, conn, crec->pid, i, host) == 0) {
+               utmp_update(&u, host);
        }
 }