diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/Makefile.in | 4 | ||||
-rw-r--r-- | source3/acconfig.h | 1 | ||||
-rwxr-xr-x | source3/configure | 335 | ||||
-rw-r--r-- | source3/configure.in | 19 | ||||
-rw-r--r-- | source3/include/config.h.in | 16 | ||||
-rw-r--r-- | source3/include/includes.h | 4 | ||||
-rw-r--r-- | source3/include/ntdomain.h | 6 | ||||
-rw-r--r-- | source3/include/proto.h | 4 | ||||
-rw-r--r-- | source3/include/smb.h | 156 | ||||
-rw-r--r-- | source3/lib/genrand.c | 4 | ||||
-rw-r--r-- | source3/lib/smbrun.c | 6 | ||||
-rw-r--r-- | source3/lib/system.c | 101 | ||||
-rw-r--r-- | source3/lib/util.c | 13 | ||||
-rw-r--r-- | source3/nmbd/nmbd.c | 2 | ||||
-rw-r--r-- | source3/nmbd/nmbd_browsesync.c | 2 | ||||
-rw-r--r-- | source3/passdb/ldap.c | 2 | ||||
-rw-r--r-- | source3/passdb/passdb.c | 2 | ||||
-rw-r--r-- | source3/passdb/smbpass.c | 10 | ||||
-rw-r--r-- | source3/script/mkproto.awk | 2 | ||||
-rw-r--r-- | source3/smbd/chgpasswd.c | 6 | ||||
-rw-r--r-- | source3/smbd/open.c | 24 | ||||
-rw-r--r-- | source3/smbd/oplock.c | 46 | ||||
-rw-r--r-- | source3/smbd/reply.c | 2 | ||||
-rw-r--r-- | source3/smbd/server.c | 12 | ||||
-rw-r--r-- | source3/tests/summary.c | 5 | ||||
-rw-r--r-- | source3/utils/smbpasswd.c | 8 | ||||
-rw-r--r-- | source3/utils/torture.c | 10 |
27 files changed, 478 insertions, 324 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in index 3df658a5d6..0ef6e32afc 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -186,7 +186,7 @@ RPCCLIENT_OBJ = rpcclient/rpcclient.o \ $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) \ $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_OBJ) # rpcclient/cmd_netlogon.o \ -# rpcclient/cmd_srvsvc.o \ +# rpcclient/cmd_srvsvc.o CLIENT_OBJ = client/client.o client/clientutil.o client/clitar.o \ $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) @@ -319,7 +319,7 @@ uninstallcp: @$(SHELL) $(srcdir)/script/uninstallcp.sh $(CODEPAGEDIR) $(CODEPAGELIST) clean: - -rm -f core */*~ *~ */*.o + -rm -f core */*~ *~ */*.o $(PROGS) $(SPROGS) proto: @echo rebuilding include/proto.h diff --git a/source3/acconfig.h b/source3/acconfig.h index 276372fdac..2271f8bec3 100644 --- a/source3/acconfig.h +++ b/source3/acconfig.h @@ -66,3 +66,4 @@ #undef STAT_STATVFS64 #undef HAVE_LIBREADLINE #undef HAVE_KERNEL_OPLOCKS +#undef HAVE_IRIX_SPECIFIC_CAPABILITIES diff --git a/source3/configure b/source3/configure index dc3e3ab381..79c5845f95 100755 --- a/source3/configure +++ b/source3/configure @@ -1873,7 +1873,7 @@ else fi done -for ac_hdr in readline/history.h +for ac_hdr in readline/history.h sys/capability.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -3778,9 +3778,64 @@ else fi done +for ac_func in srandom random srand rand +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3785: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3790 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + echo $ac_n "checking for long long""... $ac_c" 1>&6 -echo "configure:3784: checking for long long" >&5 +echo "configure:3839: checking for long long" >&5 if eval "test \"`echo '$''{'samba_cv_have_longlong'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3789,12 +3844,12 @@ if test "$cross_compiling" = yes; then samba_cv_have_longlong=cross else cat > conftest.$ac_ext <<EOF -#line 3793 "configure" +#line 3848 "configure" #include "confdefs.h" #include <stdio.h> main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); } EOF -if { (eval echo configure:3798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_have_longlong=yes else @@ -3817,7 +3872,7 @@ EOF fi echo $ac_n "checking for 64 bit off_t""... $ac_c" 1>&6 -echo "configure:3821: checking for 64 bit off_t" >&5 +echo "configure:3876: checking for 64 bit off_t" >&5 if eval "test \"`echo '$''{'samba_cv_SIZEOF_OFF_T'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3826,13 +3881,13 @@ if test "$cross_compiling" = yes; then samba_cv_SIZEOF_OFF_T=cross else cat > conftest.$ac_ext <<EOF -#line 3830 "configure" +#line 3885 "configure" #include "confdefs.h" #include <stdio.h> #include <sys/stat.h> main() { exit((sizeof(off_t) == 8) ? 0 : 1); } EOF -if { (eval echo configure:3836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_SIZEOF_OFF_T=yes else @@ -3855,7 +3910,7 @@ EOF fi echo $ac_n "checking for off64_t""... $ac_c" 1>&6 -echo "configure:3859: checking for off64_t" >&5 +echo "configure:3914: checking for off64_t" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_OFF64_T'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3864,13 +3919,13 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_OFF64_T=cross else cat > conftest.$ac_ext <<EOF -#line 3868 "configure" +#line 3923 "configure" #include "confdefs.h" #include <stdio.h> #include <sys/stat.h> main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); } EOF -if { (eval echo configure:3874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_OFF64_T=yes else @@ -3893,7 +3948,7 @@ EOF fi echo $ac_n "checking for 64 bit ino_t""... $ac_c" 1>&6 -echo "configure:3897: checking for 64 bit ino_t" >&5 +echo "configure:3952: checking for 64 bit ino_t" >&5 if eval "test \"`echo '$''{'samba_cv_SIZEOF_INO_T'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3902,13 +3957,13 @@ if test "$cross_compiling" = yes; then samba_cv_SIZEOF_INO_T=cross else cat > conftest.$ac_ext <<EOF -#line 3906 "configure" +#line 3961 "configure" #include "confdefs.h" #include <stdio.h> #include <sys/stat.h> main() { exit((sizeof(ino_t) == 8) ? 0 : 1); } EOF -if { (eval echo configure:3912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_SIZEOF_INO_T=yes else @@ -3931,7 +3986,7 @@ EOF fi echo $ac_n "checking for ino64_t""... $ac_c" 1>&6 -echo "configure:3935: checking for ino64_t" >&5 +echo "configure:3990: checking for ino64_t" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_INO64_T'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3940,13 +3995,13 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_INO64_T=cross else cat > conftest.$ac_ext <<EOF -#line 3944 "configure" +#line 3999 "configure" #include "confdefs.h" #include <stdio.h> #include <sys/stat.h> main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); } EOF -if { (eval echo configure:3950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_INO64_T=yes else @@ -3969,7 +4024,7 @@ EOF fi echo $ac_n "checking for union semun""... $ac_c" 1>&6 -echo "configure:3973: checking for union semun" >&5 +echo "configure:4028: checking for union semun" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_UNION_SEMUN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3978,7 +4033,7 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_UNION_SEMUN=cross else cat > conftest.$ac_ext <<EOF -#line 3982 "configure" +#line 4037 "configure" #include "confdefs.h" #include <sys/types.h> @@ -3986,7 +4041,7 @@ else #include <sys/sem.h> main() { union semun ss; exit(0); } EOF -if { (eval echo configure:3990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_UNION_SEMUN=yes else @@ -4009,7 +4064,7 @@ EOF fi echo $ac_n "checking for unsigned char""... $ac_c" 1>&6 -echo "configure:4013: checking for unsigned char" >&5 +echo "configure:4068: checking for unsigned char" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_UNSIGNED_CHAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4018,12 +4073,12 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_UNSIGNED_CHAR=cross else cat > conftest.$ac_ext <<EOF -#line 4022 "configure" +#line 4077 "configure" #include "confdefs.h" #include <stdio.h> main() { char c; c=250; exit((c > 0)?0:1); } EOF -if { (eval echo configure:4027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_UNSIGNED_CHAR=yes else @@ -4046,13 +4101,13 @@ EOF fi echo $ac_n "checking for sin_len in sock""... $ac_c" 1>&6 -echo "configure:4050: checking for sin_len in sock" >&5 +echo "configure:4105: checking for sin_len in sock" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_SOCK_SIN_LEN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4056 "configure" +#line 4111 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/socket.h> @@ -4061,7 +4116,7 @@ int main() { struct sockaddr_in sock; sock.sin_len = sizeof(sock); ; return 0; } EOF -if { (eval echo configure:4065: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_SOCK_SIN_LEN=yes else @@ -4082,20 +4137,20 @@ EOF fi echo $ac_n "checking for __FILE__ macro""... $ac_c" 1>&6 -echo "configure:4086: checking for __FILE__ macro" >&5 +echo "configure:4141: checking for __FILE__ macro" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_FILE_MACRO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4092 "configure" +#line 4147 "configure" #include "confdefs.h" #include <stdio.h> int main() { printf("%s\n", __FILE__); ; return 0; } EOF -if { (eval echo configure:4099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_FILE_MACRO=yes else @@ -4116,20 +4171,20 @@ EOF fi echo $ac_n "checking for __FUNCTION__ macro""... $ac_c" 1>&6 -echo "configure:4120: checking for __FUNCTION__ macro" >&5 +echo "configure:4175: checking for __FUNCTION__ macro" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_FUNCTION_MACRO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4126 "configure" +#line 4181 "configure" #include "confdefs.h" #include <stdio.h> int main() { printf("%s\n", __FUNCTION__); ; return 0; } EOF -if { (eval echo configure:4133: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_FUNCTION_MACRO=yes else @@ -4150,7 +4205,7 @@ EOF fi echo $ac_n "checking if gettimeofday takes tz argument""... $ac_c" 1>&6 -echo "configure:4154: checking if gettimeofday takes tz argument" >&5 +echo "configure:4209: checking if gettimeofday takes tz argument" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_GETTIMEOFDAY_TZ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4159,14 +4214,14 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_GETTIMEOFDAY_TZ=cross else cat > conftest.$ac_ext <<EOF -#line 4163 "configure" +#line 4218 "configure" #include "confdefs.h" #include <sys/time.h> #include <unistd.h> main() { struct timeval tv; exit(gettimeofday(&tv, NULL));} EOF -if { (eval echo configure:4170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_GETTIMEOFDAY_TZ=yes else @@ -4190,7 +4245,7 @@ fi echo $ac_n "checking for broken readdir""... $ac_c" 1>&6 -echo "configure:4194: checking for broken readdir" >&5 +echo "configure:4249: checking for broken readdir" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_BROKEN_READDIR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4199,7 +4254,7 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_BROKEN_READDIR=cross else cat > conftest.$ac_ext <<EOF -#line 4203 "configure" +#line 4258 "configure" #include "confdefs.h" #include <sys/types.h> #include <dirent.h> @@ -4207,7 +4262,7 @@ main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d); if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 && di->d_name[0] == 0) exit(0); exit(1);} EOF -if { (eval echo configure:4211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_BROKEN_READDIR=yes else @@ -4230,13 +4285,13 @@ EOF fi echo $ac_n "checking for utimbuf""... $ac_c" 1>&6 -echo "configure:4234: checking for utimbuf" >&5 +echo "configure:4289: checking for utimbuf" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_UTIMBUF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4240 "configure" +#line 4295 "configure" #include "confdefs.h" #include <sys/types.h> #include <utime.h> @@ -4244,7 +4299,7 @@ int main() { struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf)); ; return 0; } EOF -if { (eval echo configure:4248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_UTIMBUF=yes else @@ -4265,13 +4320,13 @@ EOF fi echo $ac_n "checking for kernel oplock type definitions""... $ac_c" 1>&6 -echo "configure:4269: checking for kernel oplock type definitions" >&5 +echo "configure:4324: 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 4275 "configure" +#line 4330 "configure" #include "confdefs.h" #include <sys/types.h> #include <fcntl.h> @@ -4279,7 +4334,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:4283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_KERNEL_OPLOCKS=yes else @@ -4299,18 +4354,60 @@ EOF fi +echo $ac_n "checking for irix specific capabilities""... $ac_c" 1>&6 +echo "configure:4359: 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 + +cat > conftest.$ac_ext <<EOF +#line 4365 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/capability.h> +int main() { +cap_t cap; + + if ((cap = cap_get_proc()) == NULL) + exit(1); + cap->cap_effective |= CAP_NETWORK_MGT; + cap->cap_inheritable |= CAP_NETWORK_MGT; + if (cap_set_proc(cap) == -1) + exit(1); + +; return 0; } +EOF +if { (eval echo configure:4381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no +fi +rm -f conftest* +fi + +echo "$ac_t""$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" 1>&6 +if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_IRIX_SPECIFIC_CAPABILITIES 1 +EOF + +fi echo $ac_n "checking for test routines""... $ac_c" 1>&6 -echo "configure:4305: checking for test routines" >&5 +echo "configure:4402: 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 4310 "configure" +#line 4407 "configure" #include "confdefs.h" #include "${srcdir-.}/tests/trivial.c" EOF -if { (eval echo configure:4314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 else @@ -4324,7 +4421,7 @@ fi echo $ac_n "checking for ftruncate extend""... $ac_c" 1>&6 -echo "configure:4328: checking for ftruncate extend" >&5 +echo "configure:4425: 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 @@ -4333,11 +4430,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_FTRUNCATE_EXTEND=cross else cat > conftest.$ac_ext <<EOF -#line 4337 "configure" +#line 4434 "configure" #include "confdefs.h" #include "${srcdir-.}/tests/ftruncate.c" EOF -if { (eval echo configure:4341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_FTRUNCATE_EXTEND=yes else @@ -4360,7 +4457,7 @@ EOF fi echo $ac_n "checking for broken getgroups""... $ac_c" 1>&6 -echo "configure:4364: checking for broken getgroups" >&5 +echo "configure:4461: 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 @@ -4369,11 +4466,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_BROKEN_GETGROUPS=cross else cat > conftest.$ac_ext <<EOF -#line 4373 "configure" +#line 4470 "configure" #include "confdefs.h" #include "${srcdir-.}/tests/getgroups.c" EOF -if { (eval echo configure:4377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_BROKEN_GETGROUPS=yes else @@ -4396,7 +4493,7 @@ EOF fi echo $ac_n "checking whether getpass should be replaced""... $ac_c" 1>&6 -echo "configure:4400: checking whether getpass should be replaced" >&5 +echo "configure:4497: 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 @@ -4404,7 +4501,7 @@ else SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I${srcdir-.}/include -I${srcdir-.}/ubiqx" cat > conftest.$ac_ext <<EOF -#line 4408 "configure" +#line 4505 "configure" #include "confdefs.h" #define REPLACE_GETPASS 1 @@ -4417,7 +4514,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:4421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_REPLACE_GETPASS=yes else @@ -4440,7 +4537,7 @@ EOF fi echo $ac_n "checking for broken inet_ntoa""... $ac_c" 1>&6 -echo "configure:4444: checking for broken inet_ntoa" >&5 +echo "configure:4541: 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 @@ -4449,7 +4546,7 @@ if test "$cross_compiling" = yes; then samba_cv_REPLACE_INET_NTOA=cross else cat > conftest.$ac_ext <<EOF -#line 4453 "configure" +#line 4550 "configure" #include "confdefs.h" #include <stdio.h> @@ -4461,7 +4558,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:4465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_REPLACE_INET_NTOA=yes else @@ -4484,7 +4581,7 @@ EOF fi echo $ac_n "checking for root""... $ac_c" 1>&6 -echo "configure:4488: checking for root" >&5 +echo "configure:4585: checking for root" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_ROOT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4493,11 +4590,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_ROOT=cross else cat > conftest.$ac_ext <<EOF -#line 4497 "configure" +#line 4594 "configure" #include "confdefs.h" main() { exit(getuid() != 0); } EOF -if { (eval echo configure:4501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_ROOT=yes else @@ -4523,7 +4620,7 @@ fi netmask=no; echo $ac_n "checking for netmask ifconf""... $ac_c" 1>&6 -echo "configure:4527: checking for netmask ifconf" >&5 +echo "configure:4624: checking for netmask ifconf" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_NETMASK_IFCONF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4532,14 +4629,14 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_NETMASK_IFCONF=cross else cat > conftest.$ac_ext <<EOF -#line 4536 "configure" +#line 4633 "configure" #include "confdefs.h" #define HAVE_NETMASK_IFCONF 1 #define AUTOCONF 1 #include "${srcdir-.}/lib/netmask.c" EOF -if { (eval echo configure:4543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_NETMASK_IFCONF=yes else @@ -4563,7 +4660,7 @@ fi if test $netmask = no; then echo $ac_n "checking for netmask ifreq""... $ac_c" 1>&6 -echo "configure:4567: checking for netmask ifreq" >&5 +echo "configure:4664: checking for netmask ifreq" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_NETMASK_IFREQ'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4572,14 +4669,14 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_NETMASK_IFREQ=cross else cat > conftest.$ac_ext <<EOF -#line 4576 "configure" +#line 4673 "configure" #include "confdefs.h" #define HAVE_NETMASK_IFREQ 1 #define AUTOCONF 1 #include "${srcdir-.}/lib/netmask.c" EOF -if { (eval echo configure:4583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_NETMASK_IFREQ=yes else @@ -4604,7 +4701,7 @@ fi if test $netmask = no; then echo $ac_n "checking for netmask AIX""... $ac_c" 1>&6 -echo "configure:4608: checking for netmask AIX" >&5 +echo "configure:4705: checking for netmask AIX" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_NETMASK_AIX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4613,14 +4710,14 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_NETMASK_AIX=cross else cat > conftest.$ac_ext <<EOF -#line 4617 "configure" +#line 4714 "configure" #include "confdefs.h" #define HAVE_NETMASK_AIX 1 #define AUTOCONF 1 #include "${srcdir-.}/lib/netmask.c" EOF -if { (eval echo configure:4624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_NETMASK_AIX=yes else @@ -4644,7 +4741,7 @@ fi fi echo $ac_n "checking for trapdoor seteuid""... $ac_c" 1>&6 -echo "configure:4648: checking for trapdoor seteuid" >&5 +echo "configure:4745: checking for trapdoor seteuid" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_TRAPDOOR_UID'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4653,11 +4750,11 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 4657 "configure" +#line 4754 "configure" #include "confdefs.h" #include "${srcdir-.}/tests/trapdoor.c" EOF -if { (eval echo configure:4661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_TRAPDOOR_UID=no else @@ -4680,7 +4777,7 @@ EOF fi echo $ac_n "checking for shared mmap""... $ac_c" 1>&6 -echo "configure:4684: checking for shared mmap" >&5 +echo "configure:4781: 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 @@ -4689,11 +4786,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_SHARED_MMAP=cross else cat > conftest.$ac_ext <<EOF -#line 4693 "configure" +#line 4790 "configure" #include "confdefs.h" #include "${srcdir-.}/tests/shared_mmap.c" EOF -if { (eval echo configure:4697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_SHARED_MMAP=yes else @@ -4716,7 +4813,7 @@ EOF fi echo $ac_n "checking for fcntl locking""... $ac_c" 1>&6 -echo "configure:4720: checking for fcntl locking" >&5 +echo "configure:4817: 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 @@ -4725,11 +4822,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_FCNTL_LOCK=cross else cat > conftest.$ac_ext <<EOF -#line 4729 "configure" +#line 4826 "configure" #include "confdefs.h" #include "${srcdir-.}/tests/fcntl_lock.c" EOF -if { (eval echo configure:4733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_FCNTL_LOCK=yes else @@ -4752,7 +4849,7 @@ EOF fi echo $ac_n "checking for 64 bit fcntl locking""... $ac_c" 1>&6 -echo "configure:4756: checking for 64 bit fcntl locking" >&5 +echo "configure:4853: 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 @@ -4761,7 +4858,7 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_STRUCT_FLOCK64=cross else cat > conftest.$ac_ext <<EOF -#line 4765 "configure" +#line 4862 "configure" #include "confdefs.h" #include <stdio.h> @@ -4782,7 +4879,7 @@ exit(1); #endif } EOF -if { (eval echo configure:4786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_STRUCT_FLOCK64=yes else @@ -4805,7 +4902,7 @@ EOF fi echo $ac_n "checking for sysv ipc""... $ac_c" 1>&6 -echo "configure:4809: checking for sysv ipc" >&5 +echo "configure:4906: 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 @@ -4814,11 +4911,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_SYSV_IPC=cross else cat > conftest.$ac_ext <<EOF -#line 4818 "configure" +#line 4915 "configure" #include "confdefs.h" #include "${srcdir-.}/tests/sysv_ipc.c" EOF -if { (eval echo configure:4822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_SYSV_IPC=yes else @@ -4843,7 +4940,7 @@ fi ################################################# # check for the AFS filesystem echo $ac_n "checking whether to use AFS""... $ac_c" 1>&6 -echo "configure:4847: checking whether to use AFS" >&5 +echo "configure:4944: 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" @@ -4869,7 +4966,7 @@ fi ################################################# # check for the DFS auth system echo $ac_n "checking whether to use DFS auth""... $ac_c" 1>&6 -echo "configure:4873: checking whether to use DFS auth" >&5 +echo "configure:4970: 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" @@ -4894,7 +4991,7 @@ fi ################################################# # check for automount support echo $ac_n "checking whether to use AUTOMOUNT""... $ac_c" 1>&6 -echo "configure:4898: checking whether to use AUTOMOUNT" >&5 +echo "configure:4995: 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" @@ -4919,7 +5016,7 @@ fi ################################################# # check for a LDAP password database echo $ac_n "checking whether to use LDAP password database""... $ac_c" 1>&6 -echo "configure:4923: checking whether to use LDAP password database" >&5 +echo "configure:5020: 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" @@ -4944,7 +5041,7 @@ fi ################################################# # check for a NISPLUS password database echo $ac_n "checking whether to use NISPLUS password database""... $ac_c" 1>&6 -echo "configure:4948: checking whether to use NISPLUS password database" >&5 +echo "configure:5045: 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" @@ -4969,7 +5066,7 @@ fi ################################################# # check for a NISPLUS_HOME support echo $ac_n "checking whether to use NISPLUS_HOME""... $ac_c" 1>&6 -echo "configure:4973: checking whether to use NISPLUS_HOME" >&5 +echo "configure:5070: 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" @@ -4994,7 +5091,7 @@ fi ################################################# # check for the secure socket layer echo $ac_n "checking whether to use SSL""... $ac_c" 1>&6 -echo "configure:4998: checking whether to use SSL" >&5 +echo "configure:5095: 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" @@ -5019,7 +5116,7 @@ fi ################################################# # check for experimental mmap support echo $ac_n "checking whether to use MMAP""... $ac_c" 1>&6 -echo "configure:5023: checking whether to use MMAP" >&5 +echo "configure:5120: checking whether to use MMAP" >&5 # Check whether --with-mmap or --without-mmap was given. if test "${with_mmap+set}" = set; then withval="$with_mmap" @@ -5044,7 +5141,7 @@ fi ################################################# # check for syslog logging echo $ac_n "checking whether to use syslog logging""... $ac_c" 1>&6 -echo "configure:5048: checking whether to use syslog logging" >&5 +echo "configure:5145: 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" @@ -5069,7 +5166,7 @@ fi ################################################# # check for experimental netatalk resource fork support echo $ac_n "checking whether to support netatalk""... $ac_c" 1>&6 -echo "configure:5073: checking whether to support netatalk" >&5 +echo "configure:5170: 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" @@ -5095,14 +5192,14 @@ fi ################################################# # these tests are taken from the GNU fileutils package echo "checking how to get filesystem space usage" 1>&6 -echo "configure:5099: checking how to get filesystem space usage" >&5 +echo "configure:5196: 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:5106: checking statvfs64 function (SVR4)" >&5 +echo "configure:5203: 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 @@ -5110,7 +5207,7 @@ else fu_cv_sys_stat_statvfs64=cross else cat > conftest.$ac_ext <<EOF -#line 5114 "configure" +#line 5211 "configure" #include "confdefs.h" #include <sys/types.h> @@ -5121,7 +5218,7 @@ else exit (statfs64 (".", &fsd)); } EOF -if { (eval echo configure:5125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statvfs64=yes else @@ -5154,12 +5251,12 @@ fi if test $space = no; then # SVR4 echo $ac_n "checking statvfs function (SVR4)""... $ac_c" 1>&6 -echo "configure:5158: checking statvfs function (SVR4)" >&5 +echo "configure:5255: 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 5163 "configure" +#line 5260 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/statvfs.h> @@ -5167,7 +5264,7 @@ int main() { struct statvfs fsd; statvfs (0, &fsd); ; return 0; } EOF -if { (eval echo configure:5171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* fu_cv_sys_stat_statvfs=yes else @@ -5192,7 +5289,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:5196: checking for 3-argument statfs function (DEC OSF/1)" >&5 +echo "configure:5293: 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 @@ -5200,7 +5297,7 @@ else fu_cv_sys_stat_statfs3_osf1=no else cat > conftest.$ac_ext <<EOF -#line 5204 "configure" +#line 5301 "configure" #include "confdefs.h" #include <sys/param.h> @@ -5213,7 +5310,7 @@ else exit (statfs (".", &fsd, sizeof (struct statfs))); } EOF -if { (eval echo configure:5217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statfs3_osf1=yes else @@ -5240,7 +5337,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:5244: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 +echo "configure:5341: 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 @@ -5248,7 +5345,7 @@ else fu_cv_sys_stat_statfs2_bsize=no else cat > conftest.$ac_ext <<EOF -#line 5252 "configure" +#line 5349 "configure" #include "confdefs.h" #ifdef HAVE_SYS_PARAM_H @@ -5267,7 +5364,7 @@ else exit (statfs (".", &fsd)); } EOF -if { (eval echo configure:5271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statfs2_bsize=yes else @@ -5294,7 +5391,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:5298: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 +echo "configure:5395: 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 @@ -5302,7 +5399,7 @@ else fu_cv_sys_stat_statfs4=no else cat > conftest.$ac_ext <<EOF -#line 5306 "configure" +#line 5403 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/statfs.h> @@ -5312,7 +5409,7 @@ else exit (statfs (".", &fsd, sizeof fsd, 0)); } EOF -if { (eval echo configure:5316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statfs4=yes else @@ -5339,7 +5436,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:5343: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 +echo "configure:5440: 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 @@ -5347,7 +5444,7 @@ else fu_cv_sys_stat_statfs2_fsize=no else cat > conftest.$ac_ext <<EOF -#line 5351 "configure" +#line 5448 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef HAVE_SYS_PARAM_H @@ -5363,7 +5460,7 @@ else exit (statfs (".", &fsd)); } EOF -if { (eval echo configure:5367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_statfs2_fsize=yes else @@ -5390,7 +5487,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:5394: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 +echo "configure:5491: 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 @@ -5398,7 +5495,7 @@ else fu_cv_sys_stat_fs_data=no else cat > conftest.$ac_ext <<EOF -#line 5402 "configure" +#line 5499 "configure" #include "confdefs.h" #include <sys/types.h> #ifdef HAVE_SYS_PARAM_H @@ -5418,7 +5515,7 @@ else exit (statfs (".", &fsd) != 1); } EOF -if { (eval echo configure:5422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then fu_cv_sys_stat_fs_data=yes else @@ -5447,11 +5544,11 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <<EOF -#line 5451 "configure" +#line 5548 "configure" #include "confdefs.h" #include "${srcdir-.}/tests/summary.c" EOF -if { (eval echo configure:5455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo "configure OK"; else diff --git a/source3/configure.in b/source3/configure.in index ba7320ff4a..edecd135fd 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -40,7 +40,7 @@ AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h) AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h) AC_CHECK_HEADERS(shadow.h netinet/tcp.h sys/security.h security/pam_appl.h) AC_CHECK_HEADERS(stropts.h poll.h readline.h history.h readline/readline.h) -AC_CHECK_HEADERS(readline/history.h) +AC_CHECK_HEADERS(readline/history.h sys/capability.h) AC_CHECK_SIZEOF(int,cross) AC_CHECK_SIZEOF(long,cross) @@ -161,6 +161,7 @@ AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf putprpwnam) AC_CHECK_FUNCS(setuidx setgroups mktime rename ftruncate stat64 fstat64 lstat64) AC_CHECK_FUNCS(set_auth_parameters atexit grantpt getspnam dup2 lseek64 ftruncate64) AC_CHECK_FUNCS(fseek64 ftell64 bigcrypt getprpwnam setluid yp_get_default_domain getpwanam) +AC_CHECK_FUNCS(srandom random srand rand) AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[ AC_TRY_RUN([#include <stdio.h> @@ -289,6 +290,22 @@ if test x"$samba_cv_HAVE_KERNEL_OPLOCKS" = x"yes"; then AC_DEFINE(HAVE_KERNEL_OPLOCKS) fi +AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[ +AC_TRY_COMPILE([#include <sys/types.h> +#include <sys/capability.h>], +[cap_t cap; + + if ((cap = cap_get_proc()) == NULL) + exit(1); + cap->cap_effective |= CAP_NETWORK_MGT; + cap->cap_inheritable |= CAP_NETWORK_MGT; + if (cap_set_proc(cap) == -1) + exit(1); +], +samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no)]) +if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then + AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES) +fi AC_MSG_CHECKING([for test routines]) AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"], diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 4f199f0df3..e0b62031c5 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -123,6 +123,7 @@ #undef STAT_STATVFS64 #undef HAVE_LIBREADLINE #undef HAVE_KERNEL_OPLOCKS +#undef HAVE_IRIX_SPECIFIC_CAPABILITIES /* The number of bytes in a int. */ #undef SIZEOF_INT @@ -247,6 +248,12 @@ /* Define if you have the putprpwnam function. */ #undef HAVE_PUTPRPWNAM +/* Define if you have the rand function. */ +#undef HAVE_RAND + +/* Define if you have the random function. */ +#undef HAVE_RANDOM + /* Define if you have the rdchk function. */ #undef HAVE_RDCHK @@ -280,6 +287,12 @@ /* Define if you have the sigprocmask function. */ #undef HAVE_SIGPROCMASK +/* Define if you have the srand function. */ +#undef HAVE_SRAND + +/* Define if you have the srandom function. */ +#undef HAVE_SRANDOM + /* Define if you have the stat64 function. */ #undef HAVE_STAT64 @@ -397,6 +410,9 @@ /* Define if you have the <stropts.h> header file. */ #undef HAVE_STROPTS_H +/* Define if you have the <sys/capability.h> header file. */ +#undef HAVE_SYS_CAPABILITY_H + /* Define if you have the <sys/dir.h> header file. */ #undef HAVE_SYS_DIR_H diff --git a/source3/include/includes.h b/source3/include/includes.h index 5b47e6fa35..2ec134b7c6 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -265,6 +265,10 @@ #include <poll.h> #endif +#ifdef HAVE_SYS_CAPABILITY_H +#include <sys/capability.h> +#endif + #ifndef uchar #define uchar unsigned char #endif diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 5cdd2849f8..efe7e663a0 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -122,5 +122,11 @@ typedef struct } rid_name; +struct acct_info +{ + fstring acct_name; /* account name */ + uint32 smb_userid; /* domain-relative RID */ +}; + #endif /* _NT_DOMAIN_H */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 91906eefea..c1397884b7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -183,6 +183,10 @@ char *dos_getwd(char *s); int sys_chown(char *fname,int uid,int gid); int sys_chroot(char *dname); struct hostent *sys_gethostbyname(char *name); +BOOL set_process_capability( uint32 cap_flag, BOOL enable ); +BOOL set_inherited_process_capability( uint32 cap_flag, BOOL enable ); +long sys_random(void); +void sys_srandom(unsigned int seed); /*The following definitions come from lib/time.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index cc62234268..e1baac8f6f 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1401,9 +1401,6 @@ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_SAMB /* case handling */ enum case_handling {CASE_LOWER,CASE_UPPER}; -/* display info */ -enum action_type { ACTION_HEADER, ACTION_ENUMERATE, ACTION_FOOTER }; - #ifdef WITH_SSL /* SSL version options */ enum ssl_version_enum {SMB_SSL_V2,SMB_SSL_V3,SMB_SSL_V23,SMB_SSL_TLS1}; @@ -1544,6 +1541,12 @@ extern int unix_ERR_code; #define OPLOCK_BREAK_INODE_OFFSET (OPLOCK_BREAK_DEV_OFFSET + sizeof(SMB_DEV_T)) #define OPLOCK_BREAK_MSG_LEN (OPLOCK_BREAK_INODE_OFFSET + sizeof(SMB_INO_T)) +/* + * Capabilities abstracted for different systems. + */ + +#define KERNEL_OPLOCK_CAPABILITY 0x1 + #if defined(HAVE_KERNEL_OPLOCKS) /* * Oplock break command code sent via the kernel interface. @@ -1591,151 +1594,8 @@ struct nmb_name { unsigned int name_type; }; -struct cli_state { - int fd; - int cnum; - int pid; - int mid; - int uid; - int protocol; - int sec_mode; - int rap_error; - int privilages; - - fstring eff_name; - fstring desthost; - fstring user_name; - fstring domain; - - fstring share; - fstring dev; - struct nmb_name called; - struct nmb_name calling; - fstring full_dest_host_name; - struct in_addr dest_ip; - - struct pwd_info pwd; - char cryptkey[8]; - uint32 sesskey; - int serverzone; - uint32 servertime; - int readbraw_supported; - int writebraw_supported; - int timeout; - int max_xmit; - char *outbuf; - char *inbuf; - int bufsize; - int initialised; - /* - * Only used in NT domain calls. - */ - uint32 nt_error; /* NT RPC error code. */ - uint16 nt_pipe_fnum; /* Pipe handle. */ - unsigned char sess_key[16]; /* Current session key. */ - DOM_CRED clnt_cred; /* Client credential. */ - fstring mach_acct; /* MYNAME$. */ - fstring srv_name_slash; /* \\remote server. */ - fstring clnt_name_slash; /* \\local client. */ -}; - -struct acct_info -{ - fstring acct_name; /* account name */ - uint32 smb_userid; /* domain-relative RID */ -}; - -struct nt_client_info -{ - /************* \PIPE\NETLOGON stuff ******************/ - - fstring mach_acct; - - uint8 sess_key[16]; - DOM_CRED clnt_cred; - DOM_CRED rtn_cred; - - NET_ID_INFO_CTR ctr; - NET_USER_INFO_3 user_info3; - - /************** \PIPE\lsarpc stuff ********************/ - - POLICY_HND lsa_info_pol; - - /* domain member */ - fstring level3_dom; - fstring level3_sid; - - /* domain controller */ - fstring level5_dom; - fstring level5_sid; - - /************** \PIPE\samr stuff ********************/ - - POLICY_HND samr_pol_connect; - POLICY_HND samr_pol_open_domain; - POLICY_HND samr_pol_open_user; - - struct acct_info *sam; - int num_sam_entries; -}; - - -struct tar_client_info -{ - int blocksize; - BOOL inc; - BOOL reset; - BOOL excl; - char type; - int attrib; - char **cliplist; - int clipn; - int tp; - int num_files; - int buf_size; - int bytes_written; - char *buf; - int handle; - int print_mode; - char *file_mode; -}; - -struct client_info -{ - struct in_addr dest_ip; - fstring dest_host; - fstring query_host; - uint8 name_type; - - fstring myhostname; - fstring mach_acct; - - pstring cur_dir; - pstring base_dir; - pstring file_sel; - - fstring service; - fstring share; - fstring svc_type; - - time_t newer_than; - int archive_level; - int dir_total; - int put_total_time_ms; - int put_total_size; - int get_total_time_ms; - int get_total_size; - int print_mode; - BOOL translation; - BOOL recurse_dir; - BOOL prompt; - BOOL lowercase; - BOOL abort_mget; - - struct tar_client_info tar; - struct nt_client_info dom; -}; +#include "client.h" +#include "rpcclient.h" /* * Size of new password account encoding string. DO NOT CHANGE. diff --git a/source3/lib/genrand.c b/source3/lib/genrand.c index c36cdd4b8c..bb1922e4f5 100644 --- a/source3/lib/genrand.c +++ b/source3/lib/genrand.c @@ -192,7 +192,7 @@ void generate_random_buffer( unsigned char *out, int len, BOOL re_seed) unsigned char *p; if(!done_reseed || re_seed) { - srandom(do_reseed(md4_buf)); + sys_srandom(do_reseed(md4_buf)); done_reseed = True; } @@ -218,7 +218,7 @@ void generate_random_buffer( unsigned char *out, int len, BOOL re_seed) memcpy(md4_buf, tmp_buf, sizeof(md4_buf)); /* XOR in output from random(). */ for(i = 0; i < 4; i++) - SIVAL(tmp_buf, i*4, (IVAL(tmp_buf, i*4) ^ (uint32)random())); + SIVAL(tmp_buf, i*4, (IVAL(tmp_buf, i*4) ^ (uint32)sys_random())); memcpy(p, tmp_buf, copy_len); p += copy_len; len -= copy_len; diff --git a/source3/lib/smbrun.c b/source3/lib/smbrun.c index d2abf0e952..86d7cf9e03 100644 --- a/source3/lib/smbrun.c +++ b/source3/lib/smbrun.c @@ -89,6 +89,12 @@ int smbrun(char *cmd,char *outfile,BOOL shared) int uid = current_user.uid; int gid = current_user.gid; + /* + * Lose any kernel oplock capabilities we may have. + */ + set_process_capability(KERNEL_OPLOCK_CAPABILITY, False); + set_inherited_process_capability(KERNEL_OPLOCK_CAPABILITY, False); + #ifndef HAVE_EXECL int ret; pstring syscmd; diff --git a/source3/lib/system.c b/source3/lib/system.c index c3d97e0350..f474633dd1 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -533,3 +533,104 @@ struct hostent *sys_gethostbyname(char *name) return(gethostbyname(name)); #endif /* REDUCE_ROOT_DNS_LOOKUPS */ } + + +/************************************************************************** + Try and abstract process capabilities (for systems that have them). +****************************************************************************/ + +BOOL set_process_capability( uint32 cap_flag, BOOL enable ) +{ +#if defined(HAVE_IRIX_SPECIFIC_CAPABILITIES) + if(cap_flag == KERNEL_OPLOCK_CAPABILITY) + { + cap_t cap = cap_get_proc(); + + if (cap == NULL) { + DEBUG(0,("set_process_capability: cap_get_proc failed. Error was %s\n", + strerror(errno))); + return False; + } + + if(enable) + cap->cap_effective |= CAP_NETWORK_MGT; + else + cap->cap_effective &= ~CAP_NETWORK_MGT; + + if (cap_set_proc(cap) == -1) { + DEBUG(0,("set_process_capability: cap_set_proc failed. Error was %s\n", + strerror(errno))); + return False; + } + + DEBUG(10,("set_process_capability: Set KERNEL_OPLOCK_CAPABILITY.\n")); + } +#endif + return True; +} + +/************************************************************************** + Try and abstract inherited process capabilities (for systems that have them). +****************************************************************************/ + +BOOL set_inherited_process_capability( uint32 cap_flag, BOOL enable ) +{ +#if defined(HAVE_IRIX_SPECIFIC_CAPABILITIES) + if(cap_flag == KERNEL_OPLOCK_CAPABILITY) + { + cap_t cap = cap_get_proc(); + + if (cap == NULL) { + DEBUG(0,("set_inherited_process_capability: cap_get_proc failed. Error was %s\n", + strerror(errno))); + return False; + } + + if(enable) + cap->cap_inheritable |= CAP_NETWORK_MGT; + else + cap->cap_inheritable &= ~CAP_NETWORK_MGT; + + if (cap_set_proc(cap) == -1) { + DEBUG(0,("set_inherited_process_capability: cap_set_proc failed. Error was %s\n", + strerror(errno))); + return False; + } + + DEBUG(10,("set_inherited_process_capability: Set KERNEL_OPLOCK_CAPABILITY.\n")); + } +#endif + return True; +} + +/************************************************************************** + Wrapper for random(). +****************************************************************************/ + +long sys_random(void) +{ +#if defined(HAVE_RANDOM) + return (long)random(); +#elif defined(HAVE_RAND) + return (long)rand(); +#else + DEBUG(0,("Error - no random function available !\n")); + exit(1); +#endif +} + +/************************************************************************** + Wrapper for srandom(). +****************************************************************************/ + +void sys_srandom(unsigned int seed) +{ +#if defined(HAVE_SRANDOM) + srandom(seed); +#elif defined(HAVE_SRAND) + srand(seed); +#else + DEBUG(0,("Error - no srandom function available !\n")); + exit(1); +#endif +} diff --git a/source3/lib/util.c b/source3/lib/util.c index 8569881b3f..72eb1a89c3 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -4328,6 +4328,19 @@ BOOL fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type) errno = 0; ret = fcntl(fd,op,&lock); + if (errno == EFBIG) + { + if( DEBUGLVL( 0 )) + { + dbgtext("fcntl_lock: WARNING: lock request at offset %.0f, length %.0f returned\n", (double)offset,(double)count); + dbgtext("a 'file too large' error. This can happen when using 64 bit lock offsets\n"); + dbgtext("on 32 bit NFS mounted file systems. Retrying with 32 bit truncated length.\n"); + } + /* 32 bit NFS file system, retry with smaller offset */ + errno = 0; + lock.l_len = count & 0xffffffff; + ret = fcntl(fd,op,&lock); + } if (errno != 0) DEBUG(3,("fcntl lock gave errno %d (%s)\n",errno,strerror(errno))); diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index ba72724d2b..bdafdd44fc 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -557,7 +557,7 @@ static void usage(char *pname) StartupTime = time(NULL); - srandom(time(NULL) ^ getpid()); + sys_srandom(time(NULL) ^ getpid()); TimeInit(); diff --git a/source3/nmbd/nmbd_browsesync.c b/source3/nmbd/nmbd_browsesync.c index 5969395ef7..da514076e6 100644 --- a/source3/nmbd/nmbd_browsesync.c +++ b/source3/nmbd/nmbd_browsesync.c @@ -593,7 +593,7 @@ void sync_all_dmbs(time_t t) /* sync with a probability of 1/count */ for (work=unicast_subnet->workgrouplist; work; work = work->next) { if (strcmp(global_myworkgroup, work->work_group)) { - if (((unsigned)random()) % count != 0) continue; + if (((unsigned)sys_random()) % count != 0) continue; lastrun = t; diff --git a/source3/passdb/ldap.c b/source3/passdb/ldap.c index 80ba6be3a7..59c6cd3d4f 100644 --- a/source3/passdb/ldap.c +++ b/source3/passdb/ldap.c @@ -708,7 +708,7 @@ static BOOL modadd_ldap21pwd_entry(struct sam_passwd *newpwd, int flag) make_a_mod(&mods, ldap_state, "rid", rid); make_a_mod(&mods, ldap_state, "pwdLastSet", lst); - make_a_mod(&mods, ldap_state, "userAccountControl", pdb_encode_acct_ctrl(newpwd->acct_ctrl)); + make_a_mod(&mods, ldap_state, "userAccountControl", pdb_encode_acct_ctrl(newpwd->acct_ctrl,NEW_PW_FORMAT_SPACE_PADDED_LEN)); ldap_modify_s(ldap_struct, dn, mods); diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 6633088245..15b2e8ed50 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -558,7 +558,7 @@ uint16 pdb_decode_acct_ctrl(char *p) case 'L': { acct_ctrl |= ACB_AUTOLOCK ; break; /* 'L'ocked account. */ } case 'X': { acct_ctrl |= ACB_PWNOEXP ; break; /* No 'X'piry on password */ } case 'I': { acct_ctrl |= ACB_DOMTRUST ; break; /* 'I'nterdomain trust account. */ } - case ' ': + case ' ': { break; } case ':': case '\n': case '\0': diff --git a/source3/passdb/smbpass.c b/source3/passdb/smbpass.c index cff049dcd5..e67a9c9768 100644 --- a/source3/passdb/smbpass.c +++ b/source3/passdb/smbpass.c @@ -770,6 +770,16 @@ static BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override) p += 33; /* Move to the first character of the line after the NT password. */ + /* + * If both NT and lanman passwords are provided - reset password + * not required flag. + */ + + if(pwd->smb_passwd != NULL || pwd->smb_nt_passwd != NULL) { + /* Reqiure password in the future (should ACB_DISABLED also be reset?) */ + pwd->acct_ctrl &= ~(ACB_PWNOTREQ); + } + if (*p == '[') { i = 0; diff --git a/source3/script/mkproto.awk b/source3/script/mkproto.awk index 565f7c1e55..88b0490354 100644 --- a/source3/script/mkproto.awk +++ b/source3/script/mkproto.awk @@ -80,7 +80,7 @@ END { next; } -!/^connection_struct|^pipes_struct|^file_fd_struct|^files_struct|^connection_struct|^uid_t|^gid_t|^unsigned|^mode_t|^DIR|^user|^int|^char|^uint|^struct|^BOOL|^void|^time|^smb_shm_offset_t|^shm_offset_t|^enum remote_arch_types|^FILE|^SMB_OFF_T|^size_t|^ssize_t|^SMB_BIG_UINT/ { +!/^connection_struct|^pipes_struct|^file_fd_struct|^files_struct|^connection_struct|^uid_t|^gid_t|^unsigned|^mode_t|^DIR|^user|^int|^long|^char|^uint|^struct|^BOOL|^void|^time|^smb_shm_offset_t|^shm_offset_t|^enum remote_arch_types|^FILE|^SMB_OFF_T|^size_t|^ssize_t|^SMB_BIG_UINT/ { next; } diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c index 4dc6d29e3c..4131bc9297 100644 --- a/source3/smbd/chgpasswd.c +++ b/source3/smbd/chgpasswd.c @@ -343,6 +343,12 @@ static BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequenc } else { /* CHILD */ + /* + * Lose any oplock capabilities. + */ + set_process_capability(KERNEL_OPLOCK_CAPABILITY, False); + set_inherited_process_capability(KERNEL_OPLOCK_CAPABILITY, False); + /* make sure it doesn't freeze */ alarm(20); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 64f28ddfe2..2b2f0f0524 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -535,18 +535,30 @@ static void open_file(files_struct *fsp,connection_struct *conn, conn->num_files_open)); } +} +/**************************************************************************** + If it's a read-only file, and we were compiled with mmap enabled, + try and mmap the file. This is split out from open_file() above + as mmap'ing the file can cause the kernel reference count to + be incremented, which can cause kernel oplocks to be refused. + Splitting this call off allows the kernel oplock to be granted, then + the file mmap'ed. +****************************************************************************/ + +static void mmap_open_file(files_struct *fsp) +{ #if WITH_MMAP /* mmap it if read-only */ if (!fsp->can_write) { - fsp->mmap_size = file_size(fname); + fsp->mmap_size = file_size(fsp->fsp_name); if (fsp->mmap_size < MAX_MMAP_SIZE) { fsp->mmap_ptr = (char *)mmap(NULL,fsp->mmap_size, PROT_READ,MAP_SHARED,fsp->fd_ptr->fd,0); if (fsp->mmap_ptr == (char *)-1 || !fsp->mmap_ptr) { DEBUG(3,("Failed to mmap() %s - %s\n", - fname,strerror(errno))); + fsp->fsp_name,strerror(errno))); fsp->mmap_ptr = NULL; } } @@ -554,7 +566,6 @@ static void open_file(files_struct *fsp,connection_struct *conn, #endif } - /**************************************************************************** C. Hoch 11/22/95 Helper for open_file_shared. @@ -938,6 +949,13 @@ dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev, (dou if ((flags2&O_TRUNC) && file_existed) truncate_unless_locked(fsp,conn,token,&share_locked); + + /* + * Attempt to mmap a read only file. + * Moved until after a kernel oplock may + * be granted due to reference count issues. JRA. + */ + mmap_open_file(fsp); } if (share_locked && lp_share_modes(SNUM(conn))) diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index b418e7cd54..27d802c151 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -240,39 +240,9 @@ BOOL set_file_oplock(files_struct *fsp) { #if defined(HAVE_KERNEL_OPLOCKS) if(lp_kernel_oplocks()) { -#if 0 /* for now. */ - extern struct current_user current_user; -#endif - int saved_errno; - int fcntl_ret; -#if 0 /* for now. */ - /* - * Go back to being root. - */ - - unbecome_user(); -#endif - - fcntl_ret = fcntl(fsp->fd_ptr->fd, F_OPLKREG, oplock_pipe_write); - saved_errno = errno; - -#if 0 /* for now. */ - /* - * Go back to being the correct user. - */ - if(!become_user(fsp->conn, current_user.vuid)) - { - DEBUG( 0, ( "set_file_oplock: unable to re-become user!" ) ); - DEBUGADD( 0, ( "Shutting down server\n" ) ); - close_sockets(); - close(oplock_sock); - exit_server("unable to re-become user"); - } -#endif - - if(fcntl_ret < 0) { - if(saved_errno != EAGAIN) { + if(fcntl(fsp->fd_ptr->fd, F_OPLKREG, oplock_pipe_write) < 0 ) { + if(errno != EAGAIN) { DEBUG(0,("set_file_oplock: Unable to get kernel oplock on file %s, dev = %x, \ inode = %.0f. Error was %s\n", fsp->fsp_name, (unsigned int)fsp->fd_ptr->dev, (double)fsp->fd_ptr->inode, @@ -284,6 +254,10 @@ inode = %.0f. Another process had the file open.\n", } return False; } + + DEBUG(10,("set_file_oplock: got kernel oplock on file %s, dev = %x, inode = %.0f\n", + fsp->fsp_name, (unsigned int)fsp->fd_ptr->dev, (double)fsp->fd_ptr->inode)); + } #endif /* HAVE_KERNEL_OPLOCKS */ @@ -305,7 +279,8 @@ inode = %.0f. Another process had the file open.\n", static void release_file_oplock(files_struct *fsp) { #if defined(HAVE_KERNEL_OPLOCKS) - if(fsp->granted_oplock && lp_kernel_oplocks()) + + if(lp_kernel_oplocks()) { if( DEBUGLVL( 10 )) { @@ -320,7 +295,7 @@ oplock state of %x.\n", fsp->fsp_name, (unsigned int)fsp->fd_ptr->dev, } /* - * Remove the kernel oplock on this file. + * Remote the kernel oplock on this file. */ if(fcntl(fsp->fd_ptr->fd, F_OPLKACK, OP_REVOKE) < 0) @@ -1057,6 +1032,9 @@ void check_kernel_oplocks(void) int pfd[2]; pstring tmpname; + set_process_capability(KERNEL_OPLOCK_CAPABILITY,True); + set_inherited_process_capability(KERNEL_OPLOCK_CAPABILITY,True); + slprintf( tmpname, sizeof(tmpname)-1, "/tmp/ot.%d.XXXXXX", (unsigned int)getpid()); mktemp(tmpname); diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 21fa2e9a79..63bbcbcdba 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3544,7 +3544,7 @@ int reply_lockingX(connection_struct *conn, char *inbuf,char *outbuf,int length, #endif uint16 num_ulocks = SVAL(inbuf,smb_vwv6); uint16 num_locks = SVAL(inbuf,smb_vwv7); - SMB_OFF_T count, offset; + SMB_OFF_T count = 0, offset = 0; int32 lock_timeout = IVAL(inbuf,smb_vwv4); int i; char *data; diff --git a/source3/smbd/server.c b/source3/smbd/server.c index e1b5e42764..fb97cf8380 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -240,6 +240,14 @@ max can be %d\n", that client substitutions will be done correctly in the process. */ reset_globals_after_fork(); + + /* + * Ensure this child has kernel oplock + * capabilities, but not it's children. + */ + set_process_capability(KERNEL_OPLOCK_CAPABILITY, True); + set_inherited_process_capability(KERNEL_OPLOCK_CAPABILITY, False); + return True; } /* The parent doesn't need this socket */ @@ -661,8 +669,6 @@ static void usage(char *pname) DEBUG(3,( "loaded services\n")); - check_kernel_oplocks(); - if (!is_daemon && !is_a_socket(0)) { DEBUG(0,("standard input is not a socket, assuming -D option\n")); is_daemon = True; @@ -673,6 +679,8 @@ static void usage(char *pname) become_daemon(); } + check_kernel_oplocks(); + if (!directory_exist(lp_lockdir(), NULL)) { mkdir(lp_lockdir(), 0755); } diff --git a/source3/tests/summary.c b/source3/tests/summary.c index b89bac86ac..3db510495a 100644 --- a/source3/tests/summary.c +++ b/source3/tests/summary.c @@ -24,5 +24,10 @@ main() exit(1); #endif +#if !((defined(HAVE_RANDOM) || defined(HAVE_RAND)) && (defined(HAVE_SRANDOM) || defined(HAVE_SRAND))) + printf("ERROR: No random or srandom routine!\n"); + exit(1); +#endif + exit(0); } diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index 8953b6d138..2ac44fbdec 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -639,9 +639,13 @@ int main(int argc, char **argv) smb_pwent->smb_nt_passwd = new_nt_p16; } smb_pwent->acct_ctrl &= ~ACB_DISABLED; - } else if (set_no_password) + } else if (set_no_password) { smb_pwent->acct_ctrl |= ACB_PWNOTREQ; - else { + /* This is needed to preserve ACB_PWNOTREQ in mod_smbfilepwd_entry */ + smb_pwent->smb_passwd = NULL; + smb_pwent->smb_nt_passwd = NULL; + } else { + smb_pwent->acct_ctrl &= ~ACB_PWNOTREQ; smb_pwent->smb_passwd = new_p16; smb_pwent->smb_nt_passwd = new_nt_p16; } diff --git a/source3/utils/torture.c b/source3/utils/torture.c index 2bee5f3769..3e29c5a00a 100644 --- a/source3/utils/torture.c +++ b/source3/utils/torture.c @@ -130,7 +130,7 @@ static BOOL rw_torture(struct cli_state *c, int numops) for (i=0;i<numops;i++) { - unsigned n = (unsigned)random()%10; + unsigned n = (unsigned)sys_random()%10; if (i % 10 == 0) { printf("%d\r", i); fflush(stdout); } @@ -611,7 +611,7 @@ static void run_unlinktest(void) static void rand_buf(char *buf, int len) { while (len--) { - *buf = random(); + *buf = sys_random(); buf++; } } @@ -639,8 +639,8 @@ static void run_randomipc(void) } for (i=0;i<1000;i++) { - api = random() % 500; - param_len = random() % 64; + api = sys_random() % 500; + param_len = sys_random() % 64; rand_buf(param, param_len); @@ -860,7 +860,7 @@ static void create_procs(int nprocs, int numops) for (i=0;i<nprocs;i++) { if (fork() == 0) { int mypid = getpid(); - srandom(mypid ^ time(NULL)); + sys_srandom(mypid ^ time(NULL)); run_torture(numops); _exit(0); } |