From 4cee58780cb15fe5889b9dd0dc34459512d75062 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 23 Nov 1998 21:51:05 +0000 Subject: unix instance of group database API (This used to be commit e76f593b3572ac881f1aa1fb3326d8b7169b0078) --- source3/Makefile.in | 14 +- source3/configure | 766 ++++++++++++++++++++------------------ source3/configure.in | 3 +- source3/include/includes.h | 1 + source3/include/proto.h | 91 +++-- source3/include/rpc_samr.h | 6 +- source3/include/smb.h | 9 + source3/lib/util.c | 17 +- source3/lib/util_sid.c | 11 +- source3/lsarpcd/srv_lsa.c | 34 +- source3/param/loadparm.c | 40 ++ source3/passdb/passdb.c | 2 +- source3/passdb/passgrp.c | 6 +- source3/passdb/smbpass.c | 24 +- source3/passdb/smbpassgroup.c | 12 +- source3/passdb/smbpassgroupunix.c | 239 ++++++++++++ source3/rpc_parse/parse_misc.c | 2 +- source3/rpc_parse/parse_samr.c | 2 +- source3/rpc_server/srv_lookup.c | 338 +++++++++-------- source3/rpc_server/srv_lsa.c | 34 +- source3/rpc_server/srv_samr.c | 44 ++- source3/rpc_server/srv_sid.c | 65 ++-- source3/script/mkproto.awk | 2 +- source3/smbd/groupname.c | 606 ------------------------------ source3/smbd/nttrans.c | 4 +- source3/smbd/server.c | 20 +- 26 files changed, 1098 insertions(+), 1294 deletions(-) create mode 100644 source3/passdb/smbpassgroupunix.c delete mode 100644 source3/smbd/groupname.c (limited to 'source3') diff --git a/source3/Makefile.in b/source3/Makefile.in index e439fccd50..cfc964aa5f 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -100,7 +100,8 @@ LIB_OBJ = lib/charcnv.o lib/charset.o lib/debug.o lib/fault.o \ lib/getsmbpass.o lib/interface.o lib/kanji.o lib/md4.o \ lib/membuffer.o lib/netmask.o lib/pidfile.o lib/replace.o \ lib/signal.o lib/slprintf.o lib/system.o lib/time.o lib/ufc.o \ - lib/util.o lib/genrand.o lib/username.o lib/access.o lib/smbrun.o \ + lib/util.o lib/genrand.o lib/username.o \ + lib/access.o lib/smbrun.o \ lib/bitmap.o lib/crc32.o lib/util_sid.o lib/snprintf.o \ lib/util_str.o lib/util_unistr.o \ lib/util_file.o mem_man/mem_man.o \ @@ -150,21 +151,22 @@ LOCKING_OBJ = locking/locking.o locking/locking_shm.o locking/locking_slow.o \ locking/shmem.o locking/shmem_sysv.o GROUPDB_OBJ = groupdb/groupdb.o groupdb/groupfile.o \ - groupdb/aliasdb.o groupdb/aliasfile.o + groupdb/aliasdb.o groupdb/aliasfile.o \ + groupdb/groupunix.o groupdb/aliasunix.o \ + passdb/passgrp.o passdb/smbpassgroup.o \ + passdb/smbpassgroupunix.o PASSDB_OBJ = passdb/passdb.o passdb/smbpassfile.o passdb/smbpass.o \ passdb/pass_check.o passdb/ldap.o passdb/nispass.o \ - passdb/passgrp.o passdb/smbpassgroup.o \ - passdb/smbpasschange.o + passdb/smbpasschange.o SMBD_OBJ1 = smbd/server.o smbd/files.o smbd/chgpasswd.o smbd/connection.o \ smbd/dfree.o smbd/dir.o smbd/password.o smbd/conn.o smbd/fileio.o \ - smbd/ipc.o smbd/mangle.o smbd/negprot.o \ + smbd/ipc.o smbd/mangle.o smbd/negprot.o smbd/groupname.o \ smbd/message.o smbd/nttrans.o smbd/pipes.o smbd/predict.o \ smbd/$(QUOTAOBJS) smbd/reply.o smbd/ssl.o smbd/trans2.o smbd/uid.o \ smbd/dosmode.o smbd/filename.o smbd/open.o smbd/close.o smbd/blocking.o \ smbd/process.o smbd/oplock.o smbd/service.o smbd/error.o \ - smbd/groupname.o PRINTING_OBJ = printing/pcap.o printing/print_svid.o printing/printing.o diff --git a/source3/configure b/source3/configure index cd0696bdeb..4113c75347 100755 --- a/source3/configure +++ b/source3/configure @@ -1531,7 +1531,7 @@ else fi done -for ac_hdr in unistd.h utime.h grp.h sys/id.h limits.h memory.h net/route.h net/if.h +for ac_hdr in sys/param.h ctype.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1571,7 +1571,7 @@ else fi done -for ac_hdr in compat.h rpc/rpc.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h sys/param.h ctype.h +for ac_hdr in unistd.h utime.h grp.h sys/id.h limits.h memory.h net/route.h net/if.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1611,7 +1611,7 @@ else fi done -for ac_hdr in sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h +for ac_hdr in compat.h rpc/rpc.h sys/param.h ctype.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1651,7 +1651,7 @@ else fi done -for ac_hdr in sys/filio.h string.h strings.h stdlib.h sys/socket.h +for ac_hdr in sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1691,7 +1691,7 @@ else fi done -for ac_hdr in sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h +for ac_hdr in sys/filio.h string.h strings.h stdlib.h sys/socket.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1731,7 +1731,7 @@ else fi done -for ac_hdr in sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h +for ac_hdr in sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1771,7 +1771,7 @@ else fi done -for ac_hdr in shadow.h netinet/tcp.h sys/security.h security/pam_appl.h +for ac_hdr in sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1811,7 +1811,7 @@ else fi done -for ac_hdr in stropts.h poll.h readline.h history.h readline/readline.h +for ac_hdr in shadow.h netinet/tcp.h sys/security.h security/pam_appl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1851,7 +1851,7 @@ else fi done -for ac_hdr in readline/history.h sys/capability.h syscall.h sys/syscall.h +for ac_hdr in stropts.h poll.h readline.h history.h readline/readline.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1891,7 +1891,7 @@ else fi done -for ac_hdr in sys/acl.h sys/cdefs.h glob.h +for ac_hdr in readline/history.h sys/capability.h syscall.h sys/syscall.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1931,9 +1931,49 @@ else fi done +for ac_hdr in sys/acl.h sys/cdefs.h glob.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1939: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:1937: checking size of int" >&5 +echo "configure:1977: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1941,7 +1981,7 @@ else ac_cv_sizeof_int=cross else cat > conftest.$ac_ext < main() @@ -1952,7 +1992,7 @@ main() exit(0); } EOF -if { (eval echo configure:1956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -1972,7 +2012,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:1976: checking size of long" >&5 +echo "configure:2016: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1980,7 +2020,7 @@ else ac_cv_sizeof_long=cross else cat > conftest.$ac_ext < main() @@ -1991,7 +2031,7 @@ main() exit(0); } EOF -if { (eval echo configure:1995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -2011,7 +2051,7 @@ EOF echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:2015: checking size of short" >&5 +echo "configure:2055: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2019,7 +2059,7 @@ else ac_cv_sizeof_short=cross else cat > conftest.$ac_ext < main() @@ -2030,7 +2070,7 @@ main() exit(0); } EOF -if { (eval echo configure:2034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -2051,12 +2091,12 @@ EOF echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2055: checking for working const" >&5 +echo "configure:2095: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2126,21 +2166,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2130: checking for inline" >&5 +echo "configure:2170: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2184: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2166,14 +2206,14 @@ EOF esac echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:2170: checking whether byte ordering is bigendian" >&5 +echo "configure:2210: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -2184,11 +2224,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2228: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -2199,7 +2239,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -2219,7 +2259,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -2256,14 +2296,14 @@ EOF fi echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:2260: checking whether char is unsigned" >&5 +echo "configure:2300: checking whether char is unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_char_unsigned=yes else @@ -2320,12 +2360,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2324: checking return type of signal handlers" >&5 +echo "configure:2364: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2342,7 +2382,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2386: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2361,12 +2401,12 @@ EOF echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:2365: checking for uid_t in sys/types.h" >&5 +echo "configure:2405: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -2395,12 +2435,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:2399: checking for mode_t" >&5 +echo "configure:2439: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2428,12 +2468,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2432: checking for off_t" >&5 +echo "configure:2472: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2461,12 +2501,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2465: checking for size_t" >&5 +echo "configure:2505: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2494,12 +2534,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2498: checking for pid_t" >&5 +echo "configure:2538: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2527,12 +2567,12 @@ EOF fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:2531: checking for st_rdev in struct stat" >&5 +echo "configure:2571: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2540,7 +2580,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:2544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else @@ -2561,12 +2601,12 @@ EOF fi echo $ac_n "checking for d_off in dirent""... $ac_c" 1>&6 -echo "configure:2565: checking for d_off in dirent" >&5 +echo "configure:2605: checking for d_off in dirent" >&5 if eval "test \"`echo '$''{'ac_cv_dirent_d_off'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2576,7 +2616,7 @@ int main() { struct dirent d; d.d_off; ; return 0; } EOF -if { (eval echo configure:2580: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_dirent_d_off=yes else @@ -2597,12 +2637,12 @@ EOF fi echo $ac_n "checking for ino_t""... $ac_c" 1>&6 -echo "configure:2601: checking for ino_t" >&5 +echo "configure:2641: checking for ino_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2630,12 +2670,12 @@ EOF fi echo $ac_n "checking for loff_t""... $ac_c" 1>&6 -echo "configure:2634: checking for loff_t" >&5 +echo "configure:2674: checking for loff_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_loff_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2663,12 +2703,12 @@ EOF fi echo $ac_n "checking for offset_t""... $ac_c" 1>&6 -echo "configure:2667: checking for offset_t" >&5 +echo "configure:2707: checking for offset_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_offset_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2696,12 +2736,12 @@ EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:2700: checking for ssize_t" >&5 +echo "configure:2740: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2730,20 +2770,20 @@ fi echo $ac_n "checking for errno in errno.h""... $ac_c" 1>&6 -echo "configure:2734: checking for errno in errno.h" >&5 +echo "configure:2774: checking for errno in errno.h" >&5 if eval "test \"`echo '$''{'samba_cv_errno'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int i = errno ; return 0; } EOF -if { (eval echo configure:2747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_errno=yes else @@ -2765,20 +2805,20 @@ fi # stupid glibc has the functions but no declaration. grrrr. echo $ac_n "checking for setresuid declaration""... $ac_c" 1>&6 -echo "configure:2769: checking for setresuid declaration" >&5 +echo "configure:2809: checking for setresuid declaration" >&5 if eval "test \"`echo '$''{'samba_cv_have_setresuid_decl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int i = (int)setresuid ; return 0; } EOF -if { (eval echo configure:2782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_have_setresuid_decl=yes else @@ -2800,20 +2840,20 @@ fi # stupid glibc has the functions but no declaration. grrrr. echo $ac_n "checking for crypt declaration""... $ac_c" 1>&6 -echo "configure:2804: checking for crypt declaration" >&5 +echo "configure:2844: checking for crypt declaration" >&5 if eval "test \"`echo '$''{'samba_cv_have_crypt_decl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int i = (int)crypt ; return 0; } EOF -if { (eval echo configure:2817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2857: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_have_crypt_decl=yes else @@ -2836,7 +2876,7 @@ fi # and glibc has setresuid under linux but the function does # nothing until kernel 2.1.44! very dumb. echo $ac_n "checking for real setresuid""... $ac_c" 1>&6 -echo "configure:2840: checking for real setresuid" >&5 +echo "configure:2880: checking for real setresuid" >&5 if eval "test \"`echo '$''{'samba_cv_have_setresuid'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2845,12 +2885,12 @@ else samba_cv_have_setresuid=cross else cat > conftest.$ac_ext < main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);} EOF -if { (eval echo configure:2854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_have_setresuid=yes else @@ -2873,7 +2913,7 @@ EOF fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2877: checking for 8-bit clean memcmp" >&5 +echo "configure:2917: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2881,7 +2921,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -2914,12 +2954,12 @@ test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" for ac_func in crypt do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2918: checking for $ac_func" >&5 +echo "configure:2958: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2968,7 +3008,7 @@ done if test x"$ac_cv_func_crypt" = x"no"; then echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:2972: checking for crypt in -lcrypt" >&5 +echo "configure:3012: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2976,7 +3016,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3019,7 +3059,7 @@ fi # might need libdl for this to work if test "$ac_cv_header_security_pam_appl_h" = "yes"; then echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6 -echo "configure:3023: checking for main in -ldl" >&5 +echo "configure:3063: checking for main in -ldl" >&5 ac_lib_var=`echo dl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3027,14 +3067,14 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3065,12 +3105,12 @@ fi for ac_func in pam_authenticate do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3069: checking for $ac_func" >&5 +echo "configure:3109: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3119,7 +3159,7 @@ done if test x"$ac_cv_func_pam_authenticate" = x"no"; then echo $ac_n "checking for pam_authenticate in -lpam""... $ac_c" 1>&6 -echo "configure:3123: checking for pam_authenticate in -lpam" >&5 +echo "configure:3163: checking for pam_authenticate in -lpam" >&5 ac_lib_var=`echo pam'_'pam_authenticate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3127,7 +3167,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpam $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3170,7 +3210,7 @@ fi if test "$ac_cv_header_readline_h" = "yes" || test "$ac_cv_header_readline_readline_h" = "yes"; then echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:3174: checking for readline in -lreadline" >&5 +echo "configure:3214: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3178,7 +3218,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3228,12 +3268,12 @@ fi for ac_func in connect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3232: checking for $ac_func" >&5 +echo "configure:3272: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3284,7 +3324,7 @@ if test x"$ac_cv_func_connect" = x"no"; then case "$LIBS" in *-lnsl*) ;; *) echo $ac_n "checking for printf in -lnsl_s""... $ac_c" 1>&6 -echo "configure:3288: checking for printf in -lnsl_s" >&5 +echo "configure:3328: checking for printf in -lnsl_s" >&5 ac_lib_var=`echo nsl_s'_'printf | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3292,7 +3332,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl_s $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3334,7 +3374,7 @@ fi case "$LIBS" in *-lnsl*) ;; *) echo $ac_n "checking for printf in -lnsl""... $ac_c" 1>&6 -echo "configure:3338: checking for printf in -lnsl" >&5 +echo "configure:3378: checking for printf in -lnsl" >&5 ac_lib_var=`echo nsl'_'printf | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3342,7 +3382,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3384,7 +3424,7 @@ fi case "$LIBS" in *-lsocket*) ;; *) echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:3388: checking for connect in -lsocket" >&5 +echo "configure:3428: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3392,7 +3432,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3434,7 +3474,7 @@ fi case "$LIBS" in *-linet*) ;; *) echo $ac_n "checking for connect in -linet""... $ac_c" 1>&6 -echo "configure:3438: checking for connect in -linet" >&5 +echo "configure:3478: checking for connect in -linet" >&5 ac_lib_var=`echo inet'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3442,7 +3482,7 @@ else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3496,12 +3536,12 @@ fi for ac_func in waitpid getcwd strdup strerror chown chmod chroot do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3500: checking for $ac_func" >&5 +echo "configure:3540: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3551,12 +3591,12 @@ done for ac_func in fstat strchr utime utimes getrlimit fsync execl bzero memset do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3555: checking for $ac_func" >&5 +echo "configure:3595: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3606,12 +3646,12 @@ done for ac_func in memmove vsnprintf snprintf setsid glob strpbrk pipe crypt16 getauthuid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3610: checking for $ac_func" >&5 +echo "configure:3650: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3661,12 +3701,12 @@ done for ac_func in strftime sigprocmask sigblock sigaction innetgr setnetgrent getnetgrent endnetgrent do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3665: checking for $ac_func" >&5 +echo "configure:3705: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3716,12 +3756,12 @@ done for ac_func in initgroups select rdchk getgrnam pathconf putprpwnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3720: checking for $ac_func" >&5 +echo "configure:3760: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3771,12 +3811,12 @@ done for ac_func in setuidx setgroups mktime rename ftruncate stat64 fstat64 lstat64 fopen64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3775: checking for $ac_func" >&5 +echo "configure:3815: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3826,12 +3866,12 @@ done for ac_func in set_auth_parameters atexit grantpt getspnam dup2 lseek64 ftruncate64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3830: checking for $ac_func" >&5 +echo "configure:3870: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3881,12 +3921,12 @@ done for ac_func in fseek64 ftell64 bigcrypt getprpwnam setluid yp_get_default_domain getpwanam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3885: checking for $ac_func" >&5 +echo "configure:3925: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3936,12 +3976,12 @@ done for ac_func in srandom random srand rand setenv mmap64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3940: checking for $ac_func" >&5 +echo "configure:3980: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3992,12 +4032,12 @@ done for ac_func in syscall do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3996: checking for $ac_func" >&5 +echo "configure:4036: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4048,12 +4088,12 @@ done for ac_func in _dup _dup2 _opendir _readdir _seekdir _telldir _closedir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4052: checking for $ac_func" >&5 +echo "configure:4092: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4103,12 +4143,12 @@ done for ac_func in __dup __dup2 __opendir __readdir __seekdir __telldir __closedir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4107: checking for $ac_func" >&5 +echo "configure:4147: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4158,12 +4198,12 @@ done for ac_func in __getcwd _getcwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4162: checking for $ac_func" >&5 +echo "configure:4202: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4213,12 +4253,12 @@ done for ac_func in __xstat __fxstat __lxstat do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4217: checking for $ac_func" >&5 +echo "configure:4257: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4268,12 +4308,12 @@ done for ac_func in _stat _lstat _fstat __stat __lstat __fstat do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4272: checking for $ac_func" >&5 +echo "configure:4312: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4323,12 +4363,12 @@ done for ac_func in _acl __acl _facl __facl _open __open _chdir __chdir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4327: checking for $ac_func" >&5 +echo "configure:4367: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4378,12 +4418,12 @@ done for ac_func in _close __close _fchdir __fchdir _fcntl __fcntl do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4382: checking for $ac_func" >&5 +echo "configure:4422: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4433,12 +4473,12 @@ done for ac_func in getdents _getdents __getdents _lseek __lseek _read __read do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4437: checking for $ac_func" >&5 +echo "configure:4477: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4488,12 +4528,12 @@ done for ac_func in _write __write _fork __fork do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4492: checking for $ac_func" >&5 +echo "configure:4532: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4543,12 +4583,12 @@ done for ac_func in _stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4547: checking for $ac_func" >&5 +echo "configure:4587: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4598,12 +4638,12 @@ done for ac_func in __sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4602: checking for $ac_func" >&5 +echo "configure:4642: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4653,12 +4693,12 @@ done for ac_func in pread _pread __pread pread64 _pread64 __pread64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4657: checking for $ac_func" >&5 +echo "configure:4697: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4708,12 +4748,12 @@ done for ac_func in pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4712: checking for $ac_func" >&5 +echo "configure:4752: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4763,12 +4803,12 @@ done for ac_func in open64 _open64 __open64 creat64 do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4767: checking for $ac_func" >&5 +echo "configure:4807: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4826,7 +4866,7 @@ if test x"$ac_cv_func_putprpwnam" = x"no"; then case "$LIBS" in *-lsecurity*) ;; *) echo $ac_n "checking for putprpwnam in -lsecurity""... $ac_c" 1>&6 -echo "configure:4830: checking for putprpwnam in -lsecurity" >&5 +echo "configure:4870: checking for putprpwnam in -lsecurity" >&5 ac_lib_var=`echo security'_'putprpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4834,7 +4874,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsecurity $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4876,7 +4916,7 @@ fi case "$LIBS" in *-lsec*) ;; *) echo $ac_n "checking for putprpwnam in -lsec""... $ac_c" 1>&6 -echo "configure:4880: checking for putprpwnam in -lsec" >&5 +echo "configure:4920: checking for putprpwnam in -lsec" >&5 ac_lib_var=`echo sec'_'putprpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4884,7 +4924,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsec $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4936,7 +4976,7 @@ if test x"$ac_cv_func_set_auth_parameters" = x"no"; then case "$LIBS" in *-lsecurity*) ;; *) echo $ac_n "checking for set_auth_parameters in -lsecurity""... $ac_c" 1>&6 -echo "configure:4940: checking for set_auth_parameters in -lsecurity" >&5 +echo "configure:4980: checking for set_auth_parameters in -lsecurity" >&5 ac_lib_var=`echo security'_'set_auth_parameters | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4944,7 +4984,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsecurity $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4986,7 +5026,7 @@ fi case "$LIBS" in *-lsec*) ;; *) echo $ac_n "checking for set_auth_parameters in -lsec""... $ac_c" 1>&6 -echo "configure:4990: checking for set_auth_parameters in -lsec" >&5 +echo "configure:5030: checking for set_auth_parameters in -lsec" >&5 ac_lib_var=`echo sec'_'set_auth_parameters | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4994,7 +5034,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsec $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5046,7 +5086,7 @@ if test x"$ac_cv_func_getspnam" = x"no"; then case "$LIBS" in *-lsecurity*) ;; *) echo $ac_n "checking for getspnam in -lsecurity""... $ac_c" 1>&6 -echo "configure:5050: checking for getspnam in -lsecurity" >&5 +echo "configure:5090: checking for getspnam in -lsecurity" >&5 ac_lib_var=`echo security'_'getspnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5054,7 +5094,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsecurity $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5096,7 +5136,7 @@ fi case "$LIBS" in *-lsec*) ;; *) echo $ac_n "checking for getspnam in -lsec""... $ac_c" 1>&6 -echo "configure:5100: checking for getspnam in -lsec" >&5 +echo "configure:5140: checking for getspnam in -lsec" >&5 ac_lib_var=`echo sec'_'getspnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5104,7 +5144,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsec $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5156,7 +5196,7 @@ if test x"$ac_cv_func_bigcrypt" = x"no"; then case "$LIBS" in *-lsecurity*) ;; *) echo $ac_n "checking for bigcrypt in -lsecurity""... $ac_c" 1>&6 -echo "configure:5160: checking for bigcrypt in -lsecurity" >&5 +echo "configure:5200: checking for bigcrypt in -lsecurity" >&5 ac_lib_var=`echo security'_'bigcrypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5164,7 +5204,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsecurity $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5206,7 +5246,7 @@ fi case "$LIBS" in *-lsec*) ;; *) echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6 -echo "configure:5210: checking for bigcrypt in -lsec" >&5 +echo "configure:5250: checking for bigcrypt in -lsec" >&5 ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5214,7 +5254,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsec $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5266,7 +5306,7 @@ if test x"$ac_cv_func_getprpwnam" = x"no"; then case "$LIBS" in *-lsecurity*) ;; *) echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6 -echo "configure:5270: checking for getprpwnam in -lsecurity" >&5 +echo "configure:5310: checking for getprpwnam in -lsecurity" >&5 ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5274,7 +5314,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsecurity $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5316,7 +5356,7 @@ fi case "$LIBS" in *-lsec*) ;; *) echo $ac_n "checking for getprpwnam in -lsec""... $ac_c" 1>&6 -echo "configure:5320: checking for getprpwnam in -lsec" >&5 +echo "configure:5360: checking for getprpwnam in -lsec" >&5 ac_lib_var=`echo sec'_'getprpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5324,7 +5364,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsec $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5433,7 +5473,7 @@ EOF *dgux*) # Extract the first word of "groff", so it can be a program name with args. set dummy groff; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:5437: checking for $ac_word" >&5 +echo "configure:5477: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ROFF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5459,7 +5499,7 @@ else fi ;; *sysv4.2*) echo $ac_n "checking for strcasecmp in -lresolv""... $ac_c" 1>&6 -echo "configure:5463: checking for strcasecmp in -lresolv" >&5 +echo "configure:5503: checking for strcasecmp in -lresolv" >&5 ac_lib_var=`echo resolv'_'strcasecmp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5467,7 +5507,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5510,7 +5550,7 @@ esac # try to work out how to produce pic code with this compiler PICFLAG="" echo $ac_n "checking whether ${CC-cc} accepts -fpic""... $ac_c" 1>&6 -echo "configure:5514: checking whether ${CC-cc} accepts -fpic" >&5 +echo "configure:5554: checking whether ${CC-cc} accepts -fpic" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_fpic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5530,7 +5570,7 @@ if test $ac_cv_prog_cc_fpic = yes; then fi if test x$PICFLAG = x; then echo $ac_n "checking whether ${CC-cc} accepts -Kpic""... $ac_c" 1>&6 -echo "configure:5534: checking whether ${CC-cc} accepts -Kpic" >&5 +echo "configure:5574: checking whether ${CC-cc} accepts -Kpic" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_Kpic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5551,7 +5591,7 @@ echo "$ac_t""$ac_cv_prog_cc_Kpic" 1>&6 fi if test x$PICFLAG = x; then echo $ac_n "checking whether ${CC-cc} accepts -KPIC""... $ac_c" 1>&6 -echo "configure:5555: checking whether ${CC-cc} accepts -KPIC" >&5 +echo "configure:5595: checking whether ${CC-cc} accepts -KPIC" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_KPIC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5574,7 +5614,7 @@ fi ################ echo $ac_n "checking for long long""... $ac_c" 1>&6 -echo "configure:5578: checking for long long" >&5 +echo "configure:5618: 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 @@ -5583,12 +5623,12 @@ if test "$cross_compiling" = yes; then samba_cv_have_longlong=cross else cat > conftest.$ac_ext < main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); } EOF -if { (eval echo configure:5592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_have_longlong=yes else @@ -5611,7 +5651,7 @@ EOF fi echo $ac_n "checking for 64 bit off_t""... $ac_c" 1>&6 -echo "configure:5615: checking for 64 bit off_t" >&5 +echo "configure:5655: 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 @@ -5620,13 +5660,13 @@ if test "$cross_compiling" = yes; then samba_cv_SIZEOF_OFF_T=cross else cat > conftest.$ac_ext < #include main() { exit((sizeof(off_t) == 8) ? 0 : 1); } EOF -if { (eval echo configure:5630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5670: \"$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 @@ -5649,7 +5689,7 @@ EOF fi echo $ac_n "checking for off64_t""... $ac_c" 1>&6 -echo "configure:5653: checking for off64_t" >&5 +echo "configure:5693: 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 @@ -5658,13 +5698,13 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_OFF64_T=cross else cat > conftest.$ac_ext < #include 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:5668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5708: \"$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 @@ -5687,7 +5727,7 @@ EOF fi echo $ac_n "checking for 64 bit ino_t""... $ac_c" 1>&6 -echo "configure:5691: checking for 64 bit ino_t" >&5 +echo "configure:5731: 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 @@ -5696,13 +5736,13 @@ if test "$cross_compiling" = yes; then samba_cv_SIZEOF_INO_T=cross else cat > conftest.$ac_ext < #include main() { exit((sizeof(ino_t) == 8) ? 0 : 1); } EOF -if { (eval echo configure:5706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5746: \"$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 @@ -5725,7 +5765,7 @@ EOF fi echo $ac_n "checking for ino64_t""... $ac_c" 1>&6 -echo "configure:5729: checking for ino64_t" >&5 +echo "configure:5769: 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 @@ -5734,13 +5774,13 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_INO64_T=cross else cat > conftest.$ac_ext < #include 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:5744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5784: \"$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 @@ -5763,7 +5803,7 @@ EOF fi echo $ac_n "checking for union semun""... $ac_c" 1>&6 -echo "configure:5767: checking for union semun" >&5 +echo "configure:5807: 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 @@ -5772,7 +5812,7 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_UNION_SEMUN=cross else cat > conftest.$ac_ext < @@ -5780,7 +5820,7 @@ else #include main() { union semun ss; exit(0); } EOF -if { (eval echo configure:5784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5824: \"$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 @@ -5803,7 +5843,7 @@ EOF fi echo $ac_n "checking for unsigned char""... $ac_c" 1>&6 -echo "configure:5807: checking for unsigned char" >&5 +echo "configure:5847: 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 @@ -5812,12 +5852,12 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_UNSIGNED_CHAR=cross else cat > conftest.$ac_ext < main() { char c; c=250; exit((c > 0)?0:1); } EOF -if { (eval echo configure:5821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5861: \"$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 @@ -5840,13 +5880,13 @@ EOF fi echo $ac_n "checking for sin_len in sock""... $ac_c" 1>&6 -echo "configure:5844: checking for sin_len in sock" >&5 +echo "configure:5884: 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 < #include @@ -5855,7 +5895,7 @@ int main() { struct sockaddr_in sock; sock.sin_len = sizeof(sock); ; return 0; } EOF -if { (eval echo configure:5859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_SOCK_SIN_LEN=yes else @@ -5876,13 +5916,13 @@ EOF fi echo $ac_n "checking whether seekdir returns void""... $ac_c" 1>&6 -echo "configure:5880: checking whether seekdir returns void" >&5 +echo "configure:5920: checking whether seekdir returns void" >&5 if eval "test \"`echo '$''{'samba_cv_SEEKDIR_RETURNS_VOID'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5891,7 +5931,7 @@ int main() { return 0; ; return 0; } EOF -if { (eval echo configure:5895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_SEEKDIR_RETURNS_VOID=yes else @@ -5912,20 +5952,20 @@ EOF fi echo $ac_n "checking for __FILE__ macro""... $ac_c" 1>&6 -echo "configure:5916: checking for __FILE__ macro" >&5 +echo "configure:5956: 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 < int main() { printf("%s\n", __FILE__); ; return 0; } EOF -if { (eval echo configure:5929: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_FILE_MACRO=yes else @@ -5946,20 +5986,20 @@ EOF fi echo $ac_n "checking for __FUNCTION__ macro""... $ac_c" 1>&6 -echo "configure:5950: checking for __FUNCTION__ macro" >&5 +echo "configure:5990: 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 < int main() { printf("%s\n", __FUNCTION__); ; return 0; } EOF -if { (eval echo configure:5963: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_FUNCTION_MACRO=yes else @@ -5980,7 +6020,7 @@ EOF fi echo $ac_n "checking if gettimeofday takes tz argument""... $ac_c" 1>&6 -echo "configure:5984: checking if gettimeofday takes tz argument" >&5 +echo "configure:6024: 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 @@ -5989,14 +6029,14 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_GETTIMEOFDAY_TZ=cross else cat > conftest.$ac_ext < #include main() { struct timeval tv; exit(gettimeofday(&tv, NULL));} EOF -if { (eval echo configure:6000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6040: \"$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 @@ -6020,7 +6060,7 @@ fi echo $ac_n "checking for broken readdir""... $ac_c" 1>&6 -echo "configure:6024: checking for broken readdir" >&5 +echo "configure:6064: 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 @@ -6029,7 +6069,7 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_BROKEN_READDIR=cross else cat > conftest.$ac_ext < #include @@ -6037,7 +6077,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:6041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6081: \"$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 @@ -6060,13 +6100,13 @@ EOF fi echo $ac_n "checking for utimbuf""... $ac_c" 1>&6 -echo "configure:6064: checking for utimbuf" >&5 +echo "configure:6104: 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 < #include @@ -6074,7 +6114,7 @@ int main() { struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf)); ; return 0; } EOF -if { (eval echo configure:6078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_UTIMBUF=yes else @@ -6095,13 +6135,13 @@ EOF fi echo $ac_n "checking for kernel oplock type definitions""... $ac_c" 1>&6 -echo "configure:6099: checking for kernel oplock type definitions" >&5 +echo "configure:6139: 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 < #include @@ -6109,7 +6149,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:6113: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_KERNEL_OPLOCKS=yes else @@ -6130,7 +6170,7 @@ EOF fi echo $ac_n "checking for irix specific capabilities""... $ac_c" 1>&6 -echo "configure:6134: checking for irix specific capabilities" >&5 +echo "configure:6174: 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 @@ -6139,7 +6179,7 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross else cat > conftest.$ac_ext < #include @@ -6154,7 +6194,7 @@ main() { } EOF -if { (eval echo configure:6158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes else @@ -6182,13 +6222,13 @@ fi # echo $ac_n "checking for int16 typedef included by rpc/rpc.h""... $ac_c" 1>&6 -echo "configure:6186: checking for int16 typedef included by rpc/rpc.h" >&5 +echo "configure:6226: 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 < #if defined(HAVE_RPC_RPC_H) @@ -6198,7 +6238,7 @@ int main() { int16 testvar; ; return 0; } EOF -if { (eval echo configure:6202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes else @@ -6219,13 +6259,13 @@ EOF fi echo $ac_n "checking for uint16 typedef included by rpc/rpc.h""... $ac_c" 1>&6 -echo "configure:6223: checking for uint16 typedef included by rpc/rpc.h" >&5 +echo "configure:6263: 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 < #if defined(HAVE_RPC_RPC_H) @@ -6235,7 +6275,7 @@ int main() { uint16 testvar; ; return 0; } EOF -if { (eval echo configure:6239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes else @@ -6256,13 +6296,13 @@ EOF fi echo $ac_n "checking for int32 typedef included by rpc/rpc.h""... $ac_c" 1>&6 -echo "configure:6260: checking for int32 typedef included by rpc/rpc.h" >&5 +echo "configure:6300: 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 < #if defined(HAVE_RPC_RPC_H) @@ -6272,7 +6312,7 @@ int main() { int32 testvar; ; return 0; } EOF -if { (eval echo configure:6276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6316: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes else @@ -6293,13 +6333,13 @@ EOF fi echo $ac_n "checking for uint32 typedef included by rpc/rpc.h""... $ac_c" 1>&6 -echo "configure:6297: checking for uint32 typedef included by rpc/rpc.h" >&5 +echo "configure:6337: 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 < #if defined(HAVE_RPC_RPC_H) @@ -6309,7 +6349,7 @@ int main() { uint32 testvar; ; return 0; } EOF -if { (eval echo configure:6313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes else @@ -6330,16 +6370,16 @@ EOF fi echo $ac_n "checking for test routines""... $ac_c" 1>&6 -echo "configure:6334: checking for test routines" >&5 +echo "configure:6374: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6383: \"$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 @@ -6353,7 +6393,7 @@ fi echo $ac_n "checking for ftruncate extend""... $ac_c" 1>&6 -echo "configure:6357: checking for ftruncate extend" >&5 +echo "configure:6397: 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 @@ -6362,11 +6402,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_FTRUNCATE_EXTEND=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6410: \"$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 @@ -6389,7 +6429,7 @@ EOF fi echo $ac_n "checking for broken getgroups""... $ac_c" 1>&6 -echo "configure:6393: checking for broken getgroups" >&5 +echo "configure:6433: 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 @@ -6398,11 +6438,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_BROKEN_GETGROUPS=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6446: \"$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 @@ -6425,7 +6465,7 @@ EOF fi echo $ac_n "checking whether getpass should be replaced""... $ac_c" 1>&6 -echo "configure:6429: checking whether getpass should be replaced" >&5 +echo "configure:6469: 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 @@ -6433,7 +6473,7 @@ else SAVE_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I${srcdir-.}/include -I${srcdir-.}/ubiqx" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* samba_cv_REPLACE_GETPASS=yes else @@ -6469,7 +6509,7 @@ EOF fi echo $ac_n "checking for broken inet_ntoa""... $ac_c" 1>&6 -echo "configure:6473: checking for broken inet_ntoa" >&5 +echo "configure:6513: 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 @@ -6478,7 +6518,7 @@ if test "$cross_compiling" = yes; then samba_cv_REPLACE_INET_NTOA=cross else cat > conftest.$ac_ext < @@ -6490,7 +6530,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:6494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6534: \"$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 @@ -6513,7 +6553,7 @@ EOF fi echo $ac_n "checking for root""... $ac_c" 1>&6 -echo "configure:6517: checking for root" >&5 +echo "configure:6557: checking for root" >&5 if eval "test \"`echo '$''{'samba_cv_HAVE_ROOT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6522,11 +6562,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_ROOT=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then samba_cv_HAVE_ROOT=yes else @@ -6552,7 +6592,7 @@ fi netmask=no; echo $ac_n "checking for netmask ifconf""... $ac_c" 1>&6 -echo "configure:6556: checking for netmask ifconf" >&5 +echo "configure:6596: 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 @@ -6561,14 +6601,14 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_NETMASK_IFCONF=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6612: \"$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 @@ -6592,7 +6632,7 @@ fi if test $netmask = no; then echo $ac_n "checking for netmask ifreq""... $ac_c" 1>&6 -echo "configure:6596: checking for netmask ifreq" >&5 +echo "configure:6636: 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 @@ -6601,14 +6641,14 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_NETMASK_IFREQ=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6652: \"$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 @@ -6633,7 +6673,7 @@ fi if test $netmask = no; then echo $ac_n "checking for netmask AIX""... $ac_c" 1>&6 -echo "configure:6637: checking for netmask AIX" >&5 +echo "configure:6677: 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 @@ -6642,14 +6682,14 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_NETMASK_AIX=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6693: \"$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 @@ -6673,7 +6713,7 @@ fi fi echo $ac_n "checking for trapdoor seteuid""... $ac_c" 1>&6 -echo "configure:6677: checking for trapdoor seteuid" >&5 +echo "configure:6717: 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 @@ -6682,11 +6722,11 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6730: \"$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 @@ -6709,7 +6749,7 @@ EOF fi echo $ac_n "checking for shared mmap""... $ac_c" 1>&6 -echo "configure:6713: checking for shared mmap" >&5 +echo "configure:6753: 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 @@ -6718,11 +6758,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_SHARED_MMAP=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6766: \"$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 @@ -6745,7 +6785,7 @@ EOF fi echo $ac_n "checking for fcntl locking""... $ac_c" 1>&6 -echo "configure:6749: checking for fcntl locking" >&5 +echo "configure:6789: 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 @@ -6754,11 +6794,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_FCNTL_LOCK=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6802: \"$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 @@ -6781,7 +6821,7 @@ EOF fi echo $ac_n "checking for 64 bit fcntl locking""... $ac_c" 1>&6 -echo "configure:6785: checking for 64 bit fcntl locking" >&5 +echo "configure:6825: 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 @@ -6790,7 +6830,7 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_STRUCT_FLOCK64=cross else cat > conftest.$ac_ext < @@ -6811,7 +6851,7 @@ exit(1); #endif } EOF -if { (eval echo configure:6815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6855: \"$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 @@ -6834,7 +6874,7 @@ EOF fi echo $ac_n "checking for sysv ipc""... $ac_c" 1>&6 -echo "configure:6838: checking for sysv ipc" >&5 +echo "configure:6878: 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 @@ -6843,11 +6883,11 @@ if test "$cross_compiling" = yes; then samba_cv_HAVE_SYSV_IPC=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6891: \"$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 @@ -6872,7 +6912,7 @@ fi ################################################# # check for smbwrapper support echo $ac_n "checking whether to use smbwrapper""... $ac_c" 1>&6 -echo "configure:6876: checking whether to use smbwrapper" >&5 +echo "configure:6916: 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" @@ -6916,7 +6956,7 @@ fi ################################################# # check for the AFS filesystem echo $ac_n "checking whether to use AFS""... $ac_c" 1>&6 -echo "configure:6920: checking whether to use AFS" >&5 +echo "configure:6960: 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" @@ -6942,7 +6982,7 @@ fi ################################################# # check for the DFS auth system echo $ac_n "checking whether to use DFS auth""... $ac_c" 1>&6 -echo "configure:6946: checking whether to use DFS auth" >&5 +echo "configure:6986: 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" @@ -6967,7 +7007,7 @@ fi ################################################# # check for Kerberos IV auth system echo $ac_n "checking whether to use Kerberos IV""... $ac_c" 1>&6 -echo "configure:6971: checking whether to use Kerberos IV" >&5 +echo "configure:7011: 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" @@ -6977,7 +7017,7 @@ if test "${with_krb4+set}" = set; then EOF echo $ac_n "checking for dn_expand in -lresolv""... $ac_c" 1>&6 -echo "configure:6981: checking for dn_expand in -lresolv" >&5 +echo "configure:7021: 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 @@ -6985,7 +7025,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7035,7 +7075,7 @@ fi ################################################# # check for automount support echo $ac_n "checking whether to use AUTOMOUNT""... $ac_c" 1>&6 -echo "configure:7039: checking whether to use AUTOMOUNT" >&5 +echo "configure:7079: 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" @@ -7060,7 +7100,7 @@ fi ################################################# # check for smbmount support echo $ac_n "checking whether to use SMBMOUNT""... $ac_c" 1>&6 -echo "configure:7064: checking whether to use SMBMOUNT" >&5 +echo "configure:7104: 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" @@ -7088,7 +7128,7 @@ fi ################################################# # check for a LDAP password database echo $ac_n "checking whether to use LDAP password database""... $ac_c" 1>&6 -echo "configure:7092: checking whether to use LDAP password database" >&5 +echo "configure:7132: 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" @@ -7113,7 +7153,7 @@ fi ################################################# # check for a NISPLUS password database echo $ac_n "checking whether to use NISPLUS password database""... $ac_c" 1>&6 -echo "configure:7117: checking whether to use NISPLUS password database" >&5 +echo "configure:7157: 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" @@ -7138,7 +7178,7 @@ fi ################################################# # check for a NISPLUS_HOME support echo $ac_n "checking whether to use NISPLUS_HOME""... $ac_c" 1>&6 -echo "configure:7142: checking whether to use NISPLUS_HOME" >&5 +echo "configure:7182: 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" @@ -7163,7 +7203,7 @@ fi ################################################# # check for the secure socket layer echo $ac_n "checking whether to use SSL""... $ac_c" 1>&6 -echo "configure:7167: checking whether to use SSL" >&5 +echo "configure:7207: 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" @@ -7188,7 +7228,7 @@ fi ################################################# # check for experimental mmap support echo $ac_n "checking whether to use MMAP""... $ac_c" 1>&6 -echo "configure:7192: checking whether to use MMAP" >&5 +echo "configure:7232: 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" @@ -7213,7 +7253,7 @@ fi ################################################# # check for syslog logging echo $ac_n "checking whether to use syslog logging""... $ac_c" 1>&6 -echo "configure:7217: checking whether to use syslog logging" >&5 +echo "configure:7257: 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" @@ -7238,7 +7278,7 @@ fi ################################################# # check for experimental netatalk resource fork support echo $ac_n "checking whether to support netatalk""... $ac_c" 1>&6 -echo "configure:7242: checking whether to support netatalk" >&5 +echo "configure:7282: 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" @@ -7265,7 +7305,7 @@ fi QUOTAOBJS=noquotas.o echo $ac_n "checking whether to support disk-quotas""... $ac_c" 1>&6 -echo "configure:7269: checking whether to support disk-quotas" >&5 +echo "configure:7309: 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" @@ -7288,14 +7328,14 @@ fi ################################################# # these tests are taken from the GNU fileutils package echo "checking how to get filesystem space usage" 1>&6 -echo "configure:7292: checking how to get filesystem space usage" >&5 +echo "configure:7332: 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:7299: checking statvfs64 function (SVR4)" >&5 +echo "configure:7339: 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 @@ -7303,7 +7343,7 @@ else fu_cv_sys_stat_statvfs64=cross else cat > conftest.$ac_ext < @@ -7314,7 +7354,7 @@ else exit (statfs64 (".", &fsd)); } EOF -if { (eval echo configure:7318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7358: \"$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 @@ -7347,12 +7387,12 @@ fi if test $space = no; then # SVR4 echo $ac_n "checking statvfs function (SVR4)""... $ac_c" 1>&6 -echo "configure:7351: checking statvfs function (SVR4)" >&5 +echo "configure:7391: 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 < #include @@ -7360,7 +7400,7 @@ int main() { struct statvfs fsd; statvfs (0, &fsd); ; return 0; } EOF -if { (eval echo configure:7364: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* fu_cv_sys_stat_statvfs=yes else @@ -7385,7 +7425,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:7389: checking for 3-argument statfs function (DEC OSF/1)" >&5 +echo "configure:7429: 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 @@ -7393,7 +7433,7 @@ else fu_cv_sys_stat_statfs3_osf1=no else cat > conftest.$ac_ext < @@ -7406,7 +7446,7 @@ else exit (statfs (".", &fsd, sizeof (struct statfs))); } EOF -if { (eval echo configure:7410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7450: \"$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 @@ -7433,7 +7473,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:7437: checking for two-argument statfs with statfs.bsize member (AIX, 4.3BSD)" >&5 +echo "configure:7477: 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 @@ -7441,7 +7481,7 @@ else fu_cv_sys_stat_statfs2_bsize=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7504: \"$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 @@ -7487,7 +7527,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:7491: checking for four-argument statfs (AIX-3.2.5, SVR3)" >&5 +echo "configure:7531: 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 @@ -7495,7 +7535,7 @@ else fu_cv_sys_stat_statfs4=no else cat > conftest.$ac_ext < #include @@ -7505,7 +7545,7 @@ else exit (statfs (".", &fsd, sizeof fsd, 0)); } EOF -if { (eval echo configure:7509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7549: \"$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 @@ -7532,7 +7572,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:7536: checking for two-argument statfs with statfs.fsize member (4.4BSD and NetBSD)" >&5 +echo "configure:7576: 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 @@ -7540,7 +7580,7 @@ else fu_cv_sys_stat_statfs2_fsize=no else cat > conftest.$ac_ext < #ifdef HAVE_SYS_PARAM_H @@ -7556,7 +7596,7 @@ else exit (statfs (".", &fsd)); } EOF -if { (eval echo configure:7560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7600: \"$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 @@ -7583,7 +7623,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:7587: checking for two-argument statfs with struct fs_data (Ultrix)" >&5 +echo "configure:7627: 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 @@ -7591,7 +7631,7 @@ else fu_cv_sys_stat_fs_data=no else cat > conftest.$ac_ext < #ifdef HAVE_SYS_PARAM_H @@ -7611,7 +7651,7 @@ else exit (statfs (".", &fsd) != 1); } EOF -if { (eval echo configure:7615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7655: \"$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 @@ -7640,11 +7680,11 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7688: \"$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 9176afcbf3..04c527e28e 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -52,8 +52,9 @@ AC_HEADER_DIRENT AC_HEADER_TIME AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h) +AC_CHECK_HEADERS(sys/param.h ctype.h ) AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/route.h net/if.h) -AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h sys/param.h ctype.h ) +AC_CHECK_HEADERS(compat.h rpc/rpc.h sys/param.h ctype.h ) AC_CHECK_HEADERS(sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h) AC_CHECK_HEADERS(sys/filio.h string.h strings.h stdlib.h sys/socket.h) AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h) diff --git a/source3/include/includes.h b/source3/include/includes.h index 9c5fa95a58..1cc1ffde26 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -621,6 +621,7 @@ union semun { #if (!defined(WITH_NISPLUS) && !defined(WITH_LDAP)) #define USE_SMBPASS_DB 1 +#define USE_SMBUNIX_DB 1 #endif #if defined(HAVE_PUTPRPWNAM) && defined(AUTH_CLEARTEXT_SEG_CHARS) diff --git a/source3/include/proto.h b/source3/include/proto.h index c4baa8f7a5..33c734a210 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -36,11 +36,20 @@ LOCAL_GRP *getaliasrid(uint32 alias_rid, LOCAL_GRP_MEMBER **mem, int *num_mem); LOCAL_GRP *getaliasgid(gid_t gid, LOCAL_GRP_MEMBER **mem, int *num_mem); BOOL getuseraliasnam(char *user_name, LOCAL_GRP **als, int *num_alss); void aldb_init_als(LOCAL_GRP *als); +BOOL make_alias_line(char *p, int max_len, + LOCAL_GRP *als, + LOCAL_GRP_MEMBER **mem, int *num_mem); /*The following definitions come from groupdb/aliasfile.c */ struct aliasdb_ops *file_initialise_alias_db(void); +/*The following definitions come from groupdb/aliasunix.c */ + +BOOL get_unixalias_members(struct group *als, + int *num_mem, LOCAL_GRP_MEMBER **members); +struct aliasdb_ops *unix_initialise_alias_db(void); + /*The following definitions come from groupdb/groupdb.c */ BOOL initialise_group_db(void); @@ -60,11 +69,20 @@ DOMAIN_GRP *getgrouprid(uint32 group_rid, DOMAIN_GRP_MEMBER **mem, int *num_mem) DOMAIN_GRP *getgroupgid(gid_t gid, DOMAIN_GRP_MEMBER **mem, int *num_mem); BOOL getusergroupsnam(char *user_name, DOMAIN_GRP **grp, int *num_grps); void gpdb_init_grp(DOMAIN_GRP *grp); +BOOL make_group_line(char *p, int max_len, + DOMAIN_GRP *grp, + DOMAIN_GRP_MEMBER **mem, int *num_mem); /*The following definitions come from groupdb/groupfile.c */ struct groupdb_ops *file_initialise_group_db(void); +/*The following definitions come from groupdb/groupunix.c */ + +BOOL get_unixgroup_members(struct group *grp, + int *num_mem, DOMAIN_GRP_MEMBER **members); +struct groupdb_ops *unix_initialise_group_db(void); + /*The following definitions come from lib/access.c */ BOOL allow_access(char *deny_list,char *allow_list, @@ -263,6 +281,7 @@ char *tmpdir(void); BOOL in_group(gid_t group, gid_t current_gid, int ngroups, gid_t *groups); int get_number(char *tmp); char *Atoic(char *p, int *n, char *c); +int* add_num_to_list(uint32 **num, int *count, int val); char *get_numlist(char *p, uint32 **num, int *count); void putip(void *dest,void *src); char *dns_to_netbios_name(char *dns_name); @@ -1223,6 +1242,7 @@ int lp_minor_announce_version(void); void lp_set_name_resolve_order(char *new_order); void lp_set_kernel_oplocks(BOOL val); BOOL lp_kernel_oplocks(void); +int lp_server_role(void); /*The following definitions come from param/params.c */ @@ -1318,6 +1338,11 @@ struct smb_passwd *getsmbgrpuid(uid_t smb_userid, /*The following definitions come from passdb/smbpass.c */ +void *startsmbfilepwent(BOOL update); +void endsmbfilepwent(void *vp); +SMB_BIG_UINT getsmbfilepwpos(void *vp); +BOOL setsmbfilepwpos(void *vp, SMB_BIG_UINT tok); +struct smb_passwd *getsmbfilepwent(void *vp); struct passdb_ops *file_initialise_password_db(void); /*The following definitions come from passdb/smbpasschange.c */ @@ -1341,6 +1366,10 @@ BOOL trust_get_passwd( unsigned char trust_passwd[16], char *domain, char *mynam struct passgrp_ops *file_initialise_password_grp(void); +/*The following definitions come from passdb/smbpassgroupunix.c */ + +struct passgrp_ops *unix_initialise_password_grp(void); + /*The following definitions come from printing/pcap.c */ BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname); @@ -1951,7 +1980,7 @@ void make_samr_r_lookup_names(SAMR_R_LOOKUP_NAMES *r_u, void samr_io_r_lookup_names(char *desc, SAMR_R_LOOKUP_NAMES *r_u, prs_struct *ps, int depth); void samr_io_q_unknown_12(char *desc, SAMR_Q_UNKNOWN_12 *q_u, prs_struct *ps, int depth); void make_samr_r_unknown_12(SAMR_R_UNKNOWN_12 *r_u, - uint32 num_aliases, fstring *als_name, uint32 *num_als_usrs, + uint32 num_aliases, fstring *als_name, uint8 *num_als_usrs, uint32 status); void samr_io_r_unknown_12(char *desc, SAMR_R_UNKNOWN_12 *r_u, prs_struct *ps, int depth); void make_samr_q_open_user(SAMR_Q_OPEN_USER *q_u, @@ -2157,31 +2186,28 @@ void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int int make_dom_gids(DOMAIN_GRP *mem, int num_members, DOM_GID **ppgids); int get_domain_user_groups(DOMAIN_GRP_MEMBER **grp_members, uint32 group_rid); -uint32 lookup_builtin_names(DOM_SID *sid, char *name, uint8 *type); -uint32 lookup_added_name(DOM_SID *sid, char *name, uint8 *type); -uint32 lookup_name(DOM_SID *sid, char *name, uint8 *type); -uint32 lookup_wk_group_name(DOM_SID *sid, char *group_name, uint8 *type); -uint32 lookup_group_name(DOM_SID *sid, char *group_name, uint8 *type); -uint32 lookup_wk_alias_name(DOM_SID *sid, char *alias_name, uint8 *type); -uint32 lookup_alias_name(DOM_SID *sid, char *alias_name, uint8 *type); -uint32 lookup_wk_user_name(DOM_SID *sid, char *user_name, uint8 *type); -uint32 lookup_user_name(DOM_SID *sid, char *user_name, uint8 *type); -uint32 lookup_group_rid(char *group_name, uint32 *rid, uint8 *type); -uint32 lookup_wk_group_rid(char *group_name, uint32 *rid, uint8 *type); -uint32 lookup_alias_sid(char *alias_name, DOM_SID *sid, uint8 *type); -uint32 lookup_alias_rid(char *alias_name, uint32 *rid, uint8 *type); -uint32 lookup_wk_alias_sid(char *alias_name, DOM_SID *sid, uint8 *type); -uint32 lookup_wk_alias_rid(char *alias_name, uint32 *rid, uint8 *type); -uint32 lookup_sid(char *name, DOM_SID *sid, uint8 *type); +uint32 lookup_builtin_sid(DOM_SID *sid, char *name, uint8 *type); +uint32 lookup_added_sid(DOM_SID *sid, char *name, uint8 *type); +uint32 lookup_sid(DOM_SID *sid, char *name, uint8 *type); +uint32 lookup_wk_group_sid(DOM_SID *sid, char *group_name, uint8 *type); +uint32 lookup_group_sid(DOM_SID *sid, char *group_name, uint8 *type); +uint32 lookup_wk_alias_sid(DOM_SID *sid, char *alias_name, uint8 *type); +uint32 lookup_alias_sid(DOM_SID *sid, char *alias_name, uint8 *type); +uint32 lookup_wk_user_sid(DOM_SID *sid, char *user_name, uint8 *type); +uint32 lookup_user_sid(DOM_SID *sid, char *user_name, uint8 *type); +uint32 lookup_group_name(char *grp_name, DOM_SID *sid, uint8 *type); +uint32 lookup_wk_group_name(char *group_name, DOM_SID *sid, uint8 *type); +uint32 lookup_alias_name(char *als_name, DOM_SID *sid, uint8 *type); +uint32 lookup_wk_alias_name(char *alias_name, DOM_SID *sid, uint8 *type); uint32 lookup_added_user_rids(char *user_name, uint32 *usr_rid, uint32 *grp_rid); -uint32 lookup_added_user_rid(char *user_name, uint32 *rid, uint8 *type); -uint32 lookup_wk_user_rid(char *user_name, uint32 *rid, uint8 *type); -uint32 lookup_added_grp_rid(char *name, uint32 *rid, uint8 *type); -uint32 lookup_builtin_grp_rid(char *name, uint32 *rid, uint8 *type); -uint32 lookup_grp_rid(char *name, uint32 *rid, uint8 *type); -uint32 lookup_user_rid(char *name, uint32 *rid, uint8 *type); -uint32 lookup_rid(char *name, uint32 *rid, uint8 *type); +uint32 lookup_added_user_name(char *user_name, DOM_SID *sid, uint8 *type); +uint32 lookup_wk_user_name(char *user_name, DOM_SID *sid, uint8 *type); +uint32 lookup_added_grp_name(char *name, DOM_SID *sid, uint8 *type); +uint32 lookup_builtin_grp_name(char *name, DOM_SID *sid, uint8 *type); +uint32 lookup_grp_name(char *name, DOM_SID *sid, uint8 *type); +uint32 lookup_user_name(char *name, DOM_SID *sid, uint8 *type); +uint32 lookup_name(char *name, DOM_SID *sid, uint8 *type); uint32 lookup_user_rids(char *name, uint32 *usr_rid, uint32 *grp_rid); /*The following definitions come from rpc_server/srv_lsa.c */ @@ -2238,6 +2264,7 @@ BOOL api_samr_rpc(pipes_struct *p, prs_struct *data); /*The following definitions come from rpc_server/srv_sid.c */ +void get_sam_domain_name(void); BOOL get_member_domain_sid(void); void generate_wellknown_sids(void); BOOL generate_sam_sid(void); @@ -2488,14 +2515,14 @@ void file_chain_restore(void); /*The following definitions come from smbd/groupname.c */ -BOOL map_group_sid_to_name(DOM_SID *psid, char *group_name, char *nt_domain); -BOOL map_alias_sid_to_name(DOM_SID *psid, char *alias_name, char *nt_domain); -BOOL map_group_name_to_sid(char *group_name, DOM_SID *psid); -BOOL map_alias_name_to_sid(char *alias_name, DOM_SID *psid); -BOOL map_gid_to_alias_sid(gid_t gid, DOM_SID *psid); -BOOL map_gid_to_group_sid( gid_t gid, DOM_SID *psid); -BOOL map_group_sid_to_gid( DOM_SID *psid, gid_t *gid); -BOOL map_alias_sid_to_gid( DOM_SID *psid, gid_t *gid); +BOOL map_group_sid(DOM_SID *psid, gid_t *gid, char *group_name, char *nt_domain); +BOOL map_alias_sid(DOM_SID *psid, gid_t *gid, char *alias_name, char *nt_domain); +BOOL map_unix_group_name(char *group_name, DOM_SID *psid, char *ntgroup_name, char *nt_domain); +BOOL map_unix_alias_name(char *alias_name, DOM_SID *psid, char *ntalias_name, char *nt_domain); +BOOL map_nt_group_name(char *ntgroup_name, char *nt_domain, DOM_SID *psid, char *group_name, gid_t *gid); +BOOL map_nt_alias_name(char *ntalias_name, char *nt_domain, DOM_SID *psid, char *alias_name, gid_t *gid); +BOOL map_alias_gid(gid_t gid, DOM_SID *psid, char *nt_als_name, char *nt_domain); +BOOL map_group_gid( gid_t gid, DOM_SID *psid, char *nt_grp_name, char *nt_domain); /*The following definitions come from smbd/ipc.c */ diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index ef7fefc72e..3291436007 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -842,7 +842,7 @@ called to resolve domain RID groups. /* SAMR_Q_UNKNOWN_12 */ typedef struct q_samr_unknown_12_info { - POLICY_HND pol; /* policy handle */ + POLICY_HND pol; /* policy handle */ uint32 num_gids1; /* number of rids being looked up */ uint32 rid; /* 0x0000 03e8 - RID of the server doing the query? */ @@ -884,7 +884,7 @@ typedef struct r_samr_unknown_12_info /* SAMR_Q_OPEN_USER - probably an open */ typedef struct q_samr_open_user_info { - POLICY_HND domain_pol; /* policy handle */ + POLICY_HND domain_pol; /* policy handle */ uint32 unknown_0; /* 32 bit unknown - 0x02011b */ uint32 user_rid; /* user RID */ @@ -894,7 +894,7 @@ typedef struct q_samr_open_user_info /* SAMR_R_OPEN_USER - probably an open */ typedef struct r_samr_open_user_info { - POLICY_HND user_pol; /* policy handle associated with unknown id */ + POLICY_HND user_pol; /* policy handle associated with unknown id */ uint32 status; /* return status */ } SAMR_R_OPEN_USER; diff --git a/source3/include/smb.h b/source3/include/smb.h index d0880c9cd3..8ffd55d10a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1560,6 +1560,15 @@ enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANM /* security levels */ enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER,SEC_DOMAIN}; +/* server roles */ +enum server_types +{ + ROLE_DOMAIN_NONE, + ROLE_DOMAIN_MEMBER, + ROLE_DOMAIN_BDC, + ROLE_DOMAIN_PDC +}; + /* printing types */ enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, PRINT_QNX,PRINT_PLP,PRINT_LPRNG,PRINT_SOFTQ}; diff --git a/source3/lib/util.c b/source3/lib/util.c index 7247e95c64..ad5dbcf106 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -189,6 +189,18 @@ char *Atoic(char *p, int *n, char *c) return p; } +int* add_num_to_list(uint32 **num, int *count, int val) +{ + (*num) = Realloc((*num), ((*count)+1) * sizeof(uint32)); + if ((*num) == NULL) + { + return NULL; + } + (*num)[(*count)] = val; + (*count)++; + + return (*num); +} /************************************************************************* reads a list of numbers *************************************************************************/ @@ -206,13 +218,10 @@ char *get_numlist(char *p, uint32 **num, int *count) while ((p = Atoic(p, &val, ":,")) != NULL && (*p) != ':') { - (*num) = Realloc((*num), ((*count)+1) * sizeof(uint32)); - if ((*num) == NULL) + if (add_num_to_list(num, count, val) == NULL) { return NULL; } - (*num)[(*count)] = val; - (*count)++; p++; } diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index 9ca3a59ad4..cce360f4c1 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -43,7 +43,7 @@ char *sid_to_string(pstring sidstr_out, DOM_SID *sid) for (i = 0; i < sid->num_auths; i++) { - slprintf(subauth, sizeof(subauth)-1, "-%d", sid->sub_auths[i]); + slprintf(subauth, sizeof(subauth)-1, "-%u", sid->sub_auths[i]); pstrcat(sidstr_out, subauth); } @@ -103,7 +103,9 @@ BOOL string_to_sid(DOM_SID *sidout, char *sidstr) * NOTE - the subauths are in native machine-endian format. They * are converted to little-endian when linearized onto the wire. */ - sid_append_rid(sidout, atoi(tok)); + uint32 rid = (uint32)strtoul(tok, NULL, 10); + DEBUG(50,("string_to_sid: tok: %s rid 0x%x\n", tok, rid)); + sid_append_rid(sidout, rid); } DEBUG(7,("string_to_sid: converted SID %s ok\n", sidstr)); @@ -145,6 +147,11 @@ void sid_copy(DOM_SID *sid1, DOM_SID *sid2) { int i; + for (i = 0; i < 6; i++) + { + sid1->id_auth[i] = sid2->id_auth[i]; + } + for (i = 0; i < sid2->num_auths; i++) { sid1->sub_auths[i] = sid2->sub_auths[i]; diff --git a/source3/lsarpcd/srv_lsa.c b/source3/lsarpcd/srv_lsa.c index 51b6e8d25b..8c9db172d2 100644 --- a/source3/lsarpcd/srv_lsa.c +++ b/source3/lsarpcd/srv_lsa.c @@ -85,6 +85,7 @@ make_dom_query ***************************************************************************/ static void make_dom_query(DOM_QUERY *d_q, char *dom_name, DOM_SID *dom_sid) { + fstring sid_str; int domlen = strlen(dom_name); d_q->uni_dom_max_len = domlen * 2; @@ -96,6 +97,7 @@ static void make_dom_query(DOM_QUERY *d_q, char *dom_name, DOM_SID *dom_sid) /* this string is supposed to be character short */ make_unistr2(&(d_q->uni_domain_name), dom_name, domlen); + sid_to_string(sid_str, dom_sid); make_dom_sid2(&(d_q->dom_sid), dom_sid); } @@ -197,8 +199,8 @@ make_reply_lookup_rids ***************************************************************************/ static void make_reply_lookup_rids(LSA_R_LOOKUP_RIDS *r_l, int num_entries, - uint32 dom_rids[MAX_LOOKUP_SIDS], - uint8 dom_types[MAX_LOOKUP_SIDS]) + DOM_SID dom_sids [MAX_LOOKUP_SIDS], + uint8 dom_types[MAX_LOOKUP_SIDS]) { int i; @@ -215,8 +217,11 @@ static void make_reply_lookup_rids(LSA_R_LOOKUP_RIDS *r_l, for (i = 0; i < num_entries; i++) { + DOM_SID sid = dom_sids[i]; + uint32 rid; + sid_split_rid(&sid, &rid); make_dom_ref(&(r_l->dom_ref), dom_name, dom_sid); - make_dom_rid2(&(r_l->dom_rid[i]), dom_rids[i], dom_types[i]); + make_dom_rid2(&(r_l->dom_rid[i]), rid, dom_types[i]); } r_l->num_entries3 = num_entries; @@ -241,7 +246,7 @@ static void make_lsa_trans_names(DOM_R_REF *ref, { uint32 status = 0x0; DOM_SID find_sid = sid[i].sid; - DOM_SID tmp = sid[i].sid; + DOM_SID tmp_sid = sid[i].sid; uint32 rid = 0xffffffff; int dom_idx = -1; fstring name; @@ -261,7 +266,7 @@ static void make_lsa_trans_names(DOM_R_REF *ref, { if (sid_equal(&find_sid, &global_sam_sid)) { - status = lookup_name(&tmp, name, &sid_name_use); + status = lookup_sid(&tmp_sid, name, &sid_name_use); } else { @@ -337,15 +342,15 @@ lsa_reply_lookup_rids ***************************************************************************/ static void lsa_reply_lookup_rids(prs_struct *rdata, int num_entries, - uint32 dom_rids[MAX_LOOKUP_SIDS], - uint8 dom_types[MAX_LOOKUP_SIDS]) + DOM_SID dom_sids [MAX_LOOKUP_SIDS], + uint8 dom_types[MAX_LOOKUP_SIDS]) { LSA_R_LOOKUP_RIDS r_l; ZERO_STRUCT(r_l); /* set up the LSA Lookup RIDs response */ - make_reply_lookup_rids(&r_l, num_entries, dom_rids, dom_types); + make_reply_lookup_rids(&r_l, num_entries, dom_sids, dom_types); r_l.status = 0x0; @@ -474,11 +479,11 @@ static void api_lsa_lookup_names( uint16 vuid, prs_struct *data, { int i; LSA_Q_LOOKUP_RIDS q_l; - uint32 dom_rids[MAX_LOOKUP_SIDS]; - uint8 dom_types[MAX_LOOKUP_SIDS]; + DOM_SID dom_sids [MAX_LOOKUP_SIDS]; + uint8 dom_types[MAX_LOOKUP_SIDS]; ZERO_STRUCT(q_l); - ZERO_ARRAY(dom_rids); + ZERO_ARRAY(dom_sids); /* grab the info class and policy handle */ lsa_io_q_lookup_rids("", &q_l, data, 0); @@ -491,17 +496,16 @@ static void api_lsa_lookup_names( uint16 vuid, prs_struct *data, fstring name; fstrcpy(name, unistr2(q_l.lookup_name[i].str.buffer)); - if (lookup_rid(name, &dom_rids[i], &dom_types[i])) + if (!lookup_name(name, &dom_sids[i], &dom_types[i])) { - /* WHOOPS! we should really do something about this... */ - dom_rids[i] = 0; + dom_types[i] = SID_NAME_UNKNOWN; } } /* construct reply. return status is always 0x0 */ lsa_reply_lookup_rids(rdata, q_l.num_entries, - dom_rids, /* text-converted SIDs */ + dom_sids, /* text-converted SIDs */ dom_types); /* SID_NAME_USE types */ } diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7a28d3418f..49f1c44fcb 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2727,3 +2727,43 @@ BOOL lp_kernel_oplocks(void) { return kernel_oplocks_available; } + +/*********************************************************** + returns role of Samba server +************************************************************/ +int lp_server_role(void) +{ + switch (lp_security()) + { + case SEC_SHARE: + { + if (lp_domain_logons()) + { + DEBUG(0,("Server's Role (logon server) conflicts with share-level security\n")); + } + return ROLE_DOMAIN_NONE; + } + case SEC_SERVER: + case SEC_DOMAIN: + { + if (lp_domain_logons()) + { + return ROLE_DOMAIN_BDC; + } + return ROLE_DOMAIN_MEMBER; + } + case SEC_USER: + { + if (lp_domain_logons()) + { + return ROLE_DOMAIN_BDC; + } + return ROLE_DOMAIN_PDC; + } + default: + { + DEBUG(0,("Server's Role undefined due to unknown security mode\n")); + return ROLE_DOMAIN_NONE; + } + } +} diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index da45f15f5f..a7635308b7 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -69,7 +69,7 @@ BOOL initialise_password_db(void) pwdb_ops = nisplus_initialise_password_db(); #elif defined(WITH_LDAP) pwdb_ops = ldap_initialise_password_db(); -#else +#elif defined(USE_SMBPASS_DB) pwdb_ops = file_initialise_password_db(); #endif diff --git a/source3/passdb/passgrp.c b/source3/passdb/passgrp.c index ded9ef33d2..f626dd978a 100644 --- a/source3/passdb/passgrp.c +++ b/source3/passdb/passgrp.c @@ -34,7 +34,7 @@ extern int DEBUGLEVEL; * */ -static struct passgrp_ops *pwgrp_ops; +static struct passgrp_ops *pwgrp_ops = NULL; /*************************************************************** Initialise the passgrp operations. @@ -51,7 +51,9 @@ BOOL initialise_passgrp_db(void) pwgrp_ops = nisplus_initialise_password_grp(); #elif defined(WITH_LDAP) pwgrp_ops = ldap_initialise_password_grp(); -#else +#elif defined(USE_SMBUNIX_DB) + pwgrp_ops = unix_initialise_password_grp(); +#elif defined(USE_SMBPASS_DB) pwgrp_ops = file_initialise_password_grp(); #endif diff --git a/source3/passdb/smbpass.c b/source3/passdb/smbpass.c index 67f8ea6cfb..62fdabe7fe 100644 --- a/source3/passdb/smbpass.c +++ b/source3/passdb/smbpass.c @@ -33,7 +33,7 @@ static char s_readbuf[1024]; to ensure no modification outside this module. ****************************************************************/ -static void *startsmbfilepwent(BOOL update) +void *startsmbfilepwent(BOOL update) { return startfilepwent(lp_smb_passwd_file(), s_readbuf, sizeof(s_readbuf), &pw_file_lock_depth, update); @@ -43,7 +43,7 @@ static void *startsmbfilepwent(BOOL update) End enumeration of the smbpasswd list. ****************************************************************/ -static void endsmbfilepwent(void *vp) +void endsmbfilepwent(void *vp) { endfilepwent(vp, &pw_file_lock_depth); } @@ -53,7 +53,7 @@ static void endsmbfilepwent(void *vp) This must be treated as an opaque token. *************************************************************************/ -static SMB_BIG_UINT getsmbfilepwpos(void *vp) +SMB_BIG_UINT getsmbfilepwpos(void *vp) { return getfilepwpos(vp); } @@ -63,7 +63,7 @@ static SMB_BIG_UINT getsmbfilepwpos(void *vp) This must be treated as an opaque token. *************************************************************************/ -static BOOL setsmbfilepwpos(void *vp, SMB_BIG_UINT tok) +BOOL setsmbfilepwpos(void *vp, SMB_BIG_UINT tok) { return setfilepwpos(vp, tok); } @@ -71,7 +71,7 @@ static BOOL setsmbfilepwpos(void *vp, SMB_BIG_UINT tok) /************************************************************************* Routine to return the next entry in the smbpasswd list. *************************************************************************/ -static struct smb_passwd *getsmbfilepwent(void *vp) +struct smb_passwd *getsmbfilepwent(void *vp) { /* Static buffers we will return. */ static struct smb_passwd pw_buf; @@ -80,7 +80,7 @@ static struct smb_passwd *getsmbfilepwent(void *vp) static unsigned char smbntpwd[16]; struct passwd *pwfile; char linebuf[256]; - unsigned char *p; + char *p; int uidval; size_t linebuf_len; @@ -118,14 +118,14 @@ static struct smb_passwd *getsmbfilepwent(void *vp) * As 256 is shorter than a pstring we don't need to check * length here - if this ever changes.... */ - p = (unsigned char *)strncpyn(user_name, linebuf, sizeof(user_name), ':'); + p = strncpyn(user_name, linebuf, sizeof(user_name), ':'); /* Go past ':' */ p++; /* Get smb uid. */ - p = (unsigned char *)Atoic((char *) p, &uidval, ":"); + p = Atoic( p, &uidval, ":"); pw_buf.smb_name = user_name; pw_buf.smb_userid = uidval; @@ -161,14 +161,14 @@ static struct smb_passwd *getsmbfilepwent(void *vp) continue; } - if (!strncasecmp((char *) p, "NO PASSWORD", 11)) + if (!strncasecmp( p, "NO PASSWORD", 11)) { pw_buf.smb_passwd = NULL; pw_buf.acct_ctrl |= ACB_PWNOTREQ; } else { - if (!pwdb_gethexpwd((char *)p, (char *)smbpwd)) + if (!pwdb_gethexpwd(p, (char *)smbpwd)) { DEBUG(0, ("getsmbfilepwent: Malformed Lanman password entry (non hex chars)\n")); continue; @@ -188,7 +188,7 @@ static struct smb_passwd *getsmbfilepwent(void *vp) { if (*p != '*' && *p != 'X') { - if(pwdb_gethexpwd((char *)p,(char *)smbntpwd)) + if(pwdb_gethexpwd(p,(char *)smbntpwd)) { pw_buf.smb_nt_passwd = smbntpwd; } @@ -218,7 +218,7 @@ static struct smb_passwd *getsmbfilepwent(void *vp) if (*p == ':') { p++; - pw_buf.pass_last_set_time = pwdb_get_last_set_time((char *)p); + pw_buf.pass_last_set_time = pwdb_get_last_set_time(p); } } else diff --git a/source3/passdb/smbpassgroup.c b/source3/passdb/smbpassgroup.c index f3a0d4244b..8e92f0e831 100644 --- a/source3/passdb/smbpassgroup.c +++ b/source3/passdb/smbpassgroup.c @@ -19,7 +19,7 @@ #include "includes.h" -#ifdef USE_SMBPASS_DB +#ifdef USE_SMBGROUP_DB static int grp_file_lock_depth = 0; extern int DEBUGLEVEL; @@ -96,7 +96,7 @@ static struct smb_passwd *getsmbfilegrpent(void *vp, /* * The line we have should be of the form :- * - * username:uid:domainrid1,domainrid2..:aliassid1,aliassid2..: + * username:uid:aliassid1,aliassid2..:domainrid1,domainrid2..: */ /* @@ -116,9 +116,7 @@ static struct smb_passwd *getsmbfilegrpent(void *vp, pw_buf.smb_userid = uidval; /* - * Now get the password value - this should be 32 hex digits - * which are the ascii representations of a 16 byte string. - * Get two at a time and put them into the password. + * Now get a list of alias RIDs */ /* Skip the ':' */ @@ -139,6 +137,10 @@ static struct smb_passwd *getsmbfilegrpent(void *vp, } } + /* + * Now get a list of group RIDs + */ + /* Skip the ':' */ p++; diff --git a/source3/passdb/smbpassgroupunix.c b/source3/passdb/smbpassgroupunix.c new file mode 100644 index 0000000000..438b9e2daf --- /dev/null +++ b/source3/passdb/smbpassgroupunix.c @@ -0,0 +1,239 @@ +/* + * Unix SMB/Netbios implementation. Version 1.9. SMB parameters and setup + * Copyright (C) Andrew Tridgell 1992-1998 Modified by Jeremy Allison 1995. + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 675 + * Mass Ave, Cambridge, MA 02139, USA. + */ + +#include "includes.h" + +#ifdef USE_SMBUNIX_DB + +extern int DEBUGLEVEL; +extern DOM_SID global_member_sid; + +/*************************************************************** + Start to enumerate the smbpasswd list. Returns a void pointer + to ensure no modification outside this module. +****************************************************************/ + +static void *startsmbfilegrpent(BOOL update) +{ + return startsmbfilepwent(False); +} + +/*************************************************************** + End enumeration of the smbpasswd list. +****************************************************************/ + +static void endsmbfilegrpent(void *vp) +{ + endsmbfilepwent(vp); +} + +/************************************************************************* + Return the current position in the smbpasswd list as an SMB_BIG_UINT. + This must be treated as an opaque token. +*************************************************************************/ + +static SMB_BIG_UINT getsmbfilegrppos(void *vp) +{ + return getsmbfilepwpos(vp); +} + +/************************************************************************* + Set the current position in the smbpasswd list from an SMB_BIG_UINT. + This must be treated as an opaque token. +*************************************************************************/ + +static BOOL setsmbfilegrppos(void *vp, SMB_BIG_UINT tok) +{ + return setsmbfilepwpos(vp, tok); +} + +/************************************************************************* + Routine to return the next smbpassgroup entry + *************************************************************************/ +static struct smb_passwd *getsmbfilegrpent(void *vp, + uint32 **grp_rids, int *num_grps, + uint32 **als_rids, int *num_alss) +{ + /* Static buffers we will return. */ + struct smb_passwd *pw_buf; + struct passwd *pw; + int i; + int unixgrps; + gid_t *grps; + + if (vp == NULL) + { + DEBUG(0,("getsmbfilegrpent: Bad password file pointer.\n")); + return NULL; + } + + pw_buf = getsmbfilepwent(vp); + + if (grp_rids != NULL) + { + (*grp_rids) = NULL; + (*num_grps) = 0; + } + + if (als_rids != NULL) + { + (*als_rids) = NULL; + (*num_alss) = 0; + } + + if (als_rids == NULL && grp_rids == NULL) + { + return pw_buf; + } + + /* + * find all unix groups + */ + + pw = Get_Pwnam(pw_buf->smb_name, False); + + if (pw == NULL) + { + return NULL; + } + + if (get_unixgroups(pw_buf->smb_name, pw->pw_uid, pw->pw_gid, &unixgrps, &grps)) + { + return NULL; + } + + /* + * check each unix group for a mapping as an nt alias or an nt group + */ + + for (i = 0; i < unixgrps; i++) + { + DOM_SID sid; + uint8 type; + char *unix_grpname; + uint32 status; + uint32 rid; + + /* + * find the unix name for each user's group. + * assume the unix group is an nt name (alias? group? user?) + * (user or not our own domain will be an error). + */ + + unix_grpname = gidtoname(grps[i]); + if (map_unix_alias_name(unix_grpname, &sid, NULL, NULL)) + { + /* + * ok, the unix groupname is mapped to an alias. + * check that it is in our domain. + */ + + sid_split_rid(&sid, &rid); + if (!sid_equal(&sid, &global_member_sid)) + { + pstring sid_str; + sid_to_string(sid_str, &sid); + DEBUG(0,("user %s is in a UNIX group %s that maps to an NT RID (0x%x) in another domain (%s)\n", + pw_buf->smb_name, unix_grpname, rid, sid_str)); + continue; + } + + if (add_num_to_list(als_rids, num_alss, rid) == NULL) + { + return NULL; + } + } + else if (map_unix_group_name(unix_grpname, &sid, NULL, NULL)) + { + /* + * ok, the unix groupname is mapped to a domain group. + * check that it is in our domain. + */ + + sid_split_rid(&sid, &rid); + if (!sid_equal(&sid, &global_member_sid)) + { + pstring sid_str; + sid_to_string(sid_str, &sid); + DEBUG(0,("user %s is in a UNIX group %s that maps to an NT RID (0x%x) in another domain (%s)\n", + pw_buf->smb_name, unix_grpname, rid, sid_str)); + continue; + } + + if (add_num_to_list(grp_rids, num_grps, rid) == NULL) + { + return NULL; + } + } + else if (lp_server_role() == ROLE_DOMAIN_MEMBER) + { + /* + * server is a member of a domain or stand-alone. + * name is not explicitly mapped + * so we are responsible for it. + * as a LOCAL group. + */ + + rid = pwdb_gid_to_alias_rid(grps[i]); + if (add_num_to_list(als_rids, num_alss, rid) == NULL) + { + return NULL; + } + } + else if (lp_server_role() != ROLE_DOMAIN_NONE) + { + /* + * server is a PDC or BDC. + * name is explicitly mapped + * so we are responsible for it. + * as a DOMAIN group. + */ + + rid = pwdb_gid_to_group_rid(grps[i]); + if (add_num_to_list(grp_rids, num_grps, rid) == NULL) + { + return NULL; + } + } + } + + return pw_buf; +} + +static struct passgrp_ops file_ops = +{ + startsmbfilegrpent, + endsmbfilegrpent, + getsmbfilegrppos, + setsmbfilegrppos, + iterate_getsmbgrpnam, /* In passgrp.c */ + iterate_getsmbgrpuid, /* In passgrp.c */ + iterate_getsmbgrprid, /* In passgrp.c */ + getsmbfilegrpent, +}; + +struct passgrp_ops *unix_initialise_password_grp(void) +{ + return &file_ops; +} + +#else + /* Do *NOT* make this function static. It breaks the compile on gcc. JRA */ + void smbpass_dummy_function(void) { } /* stop some compilers complaining */ +#endif /* USE_SMBPASS_DB */ diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index 4c387e0628..97d4f3d563 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/rpc_parse/parse_misc.c @@ -204,7 +204,7 @@ creates a DOM_SID2 structure. ********************************************************************/ void make_dom_sid2(DOM_SID2 *sid2, DOM_SID *sid) { - sid2->sid = *sid; + sid_copy(&sid2->sid, sid); sid2->num_auths = sid2->sid.num_auths; } diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index 6e0eaaaa6a..f4c6d75707 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -1905,7 +1905,7 @@ void samr_io_q_unknown_12(char *desc, SAMR_Q_UNKNOWN_12 *q_u, prs_struct *ps, i makes a SAMR_R_UNKNOWN_12 structure. ********************************************************************/ void make_samr_r_unknown_12(SAMR_R_UNKNOWN_12 *r_u, - uint32 num_aliases, fstring *als_name, uint32 *num_als_usrs, + uint32 num_aliases, fstring *als_name, uint8 *num_als_usrs, uint32 status) { int i; diff --git a/source3/rpc_server/srv_lookup.c b/source3/rpc_server/srv_lookup.c index 6ed7a5b0e9..9981ce0371 100644 --- a/source3/rpc_server/srv_lookup.c +++ b/source3/rpc_server/srv_lookup.c @@ -110,16 +110,19 @@ int make_dom_gids(DOMAIN_GRP *mem, int num_members, DOM_GID **ppgids) uint32 status; uint32 rid; + DOM_SID sid; uint8 type; uint8 attr = mem[count].attr; char *name = mem[count].name; become_root(True); - status = lookup_grp_rid(name, &rid, &type); + status = lookup_group_name(name, &sid, &type); unbecome_root(True); - if (status == 0x0) + sid_split_rid(&sid, &rid); + + if (status == 0x0 && sid_equal(&sid, &global_sam_sid)) { gids = (DOM_GID *)Realloc( gids, sizeof(DOM_GID) * (count+1) ); @@ -168,53 +171,53 @@ int get_domain_user_groups(DOMAIN_GRP_MEMBER **grp_members, uint32 group_rid) /******************************************************************* - lookup_builtin_names + lookup_builtin_sid ********************************************************************/ -uint32 lookup_builtin_names(DOM_SID *sid, char *name, uint8 *type) +uint32 lookup_builtin_sid(DOM_SID *sid, char *name, uint8 *type) { uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; - status = (status != 0x0) ? lookup_wk_user_name (sid, name, type) : status; - status = (status != 0x0) ? lookup_wk_group_name(sid, name, type) : status; - status = (status != 0x0) ? lookup_wk_alias_name(sid, name, type) : status; + status = (status != 0x0) ? lookup_wk_user_sid (sid, name, type) : status; + status = (status != 0x0) ? lookup_wk_group_sid(sid, name, type) : status; + status = (status != 0x0) ? lookup_wk_alias_sid(sid, name, type) : status; return status; } /******************************************************************* - lookup_added_name - names that have been added to the SAM database by admins. + lookup_added_sid - names that have been added to the SAM database by admins. ********************************************************************/ -uint32 lookup_added_name(DOM_SID *sid, char *name, uint8 *type) +uint32 lookup_added_sid(DOM_SID *sid, char *name, uint8 *type) { uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; - status = (status != 0x0) ? lookup_user_name (sid, name, type) : status; - status = (status != 0x0) ? lookup_group_name(sid, name, type) : status; - status = (status != 0x0) ? lookup_alias_name(sid, name, type) : status; + status = (status != 0x0) ? lookup_user_sid (sid, name, type) : status; + status = (status != 0x0) ? lookup_group_sid(sid, name, type) : status; + status = (status != 0x0) ? lookup_alias_sid(sid, name, type) : status; return status; } /******************************************************************* - lookup_name + lookup_sid ********************************************************************/ -uint32 lookup_name(DOM_SID *sid, char *name, uint8 *type) +uint32 lookup_sid(DOM_SID *sid, char *name, uint8 *type) { uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; - status = (status != 0x0) ? lookup_builtin_names(sid, name, type) : status; - status = (status != 0x0) ? lookup_added_name (sid, name, type) : status; + status = (status != 0x0) ? lookup_builtin_sid(sid, name, type) : status; + status = (status != 0x0) ? lookup_added_sid (sid, name, type) : status; return status; } /******************************************************************* - lookup_wk_group_name + lookup_wk_group_sid ********************************************************************/ -uint32 lookup_wk_group_name(DOM_SID *sid, char *group_name, uint8 *type) +uint32 lookup_wk_group_sid(DOM_SID *sid, char *group_name, uint8 *type) { int i = 0; uint32 rid; @@ -230,7 +233,7 @@ uint32 lookup_wk_group_name(DOM_SID *sid, char *group_name, uint8 *type) return 0xC0000000 | NT_STATUS_NONE_MAPPED; } - DEBUG(5,("lookup_wk_group_name: rid: %d", rid)); + DEBUG(5,("lookup_wk_group_sid: rid: %d", rid)); while (domain_group_rids[i].rid != rid && domain_group_rids[i].rid != 0) { @@ -249,47 +252,47 @@ uint32 lookup_wk_group_name(DOM_SID *sid, char *group_name, uint8 *type) } /******************************************************************* - lookup_group_name + lookup_group_sid ********************************************************************/ -uint32 lookup_group_name(DOM_SID *sid, char *group_name, uint8 *type) +uint32 lookup_group_sid(DOM_SID *sid, char *group_name, uint8 *type) { - uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; + pstring sid_str; uint32 rid; DOM_SID tmp; + DOMAIN_GRP *grp = NULL; + uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; (*type) = SID_NAME_DOM_GRP; + sid_to_string(sid_str, sid); + DEBUG(5,("lookup_group_sid: sid: %s", sid_str)); + sid_copy(&tmp, sid); sid_split_rid(&tmp, &rid); - if (!sid_equal(&global_sid_S_1_5_20, &tmp)) + if (!sid_equal(&global_sam_sid, &tmp)) { - return status; + DEBUG(5,("not our SID\n")); + return 0xC0000000 | NT_STATUS_NONE_MAPPED; } - DEBUG(5,("lookup_group_name: rid: 0x%x", rid)); - - if (map_group_sid_to_name(sid, group_name, NULL)) - { - status = 0x0; - } + grp = getgrouprid(rid, NULL, NULL); - if (status == 0x0) + if (grp != NULL) { + fstrcpy(group_name, grp->name); DEBUG(5,(" = %s\n", group_name)); - } - else - { - DEBUG(5,(" none mapped\n")); + return 0x0; } + DEBUG(5,(" none mapped\n")); return status; } /******************************************************************* - lookup_wk_alias_name + lookup_wk_alias_sid ********************************************************************/ -uint32 lookup_wk_alias_name(DOM_SID *sid, char *alias_name, uint8 *type) +uint32 lookup_wk_alias_sid(DOM_SID *sid, char *alias_name, uint8 *type) { int i = 0; uint32 rid; @@ -305,7 +308,7 @@ uint32 lookup_wk_alias_name(DOM_SID *sid, char *alias_name, uint8 *type) return 0xC0000000 | NT_STATUS_NONE_MAPPED; } - DEBUG(5,("lookup_wk_alias_name: rid: %d", rid)); + DEBUG(5,("lookup_wk_alias_sid: rid: %d", rid)); while (builtin_alias_rids[i].rid != rid && builtin_alias_rids[i].rid != 0) { @@ -324,25 +327,47 @@ uint32 lookup_wk_alias_name(DOM_SID *sid, char *alias_name, uint8 *type) } /******************************************************************* - lookup_alias_name + lookup_alias_sid ********************************************************************/ -uint32 lookup_alias_name(DOM_SID *sid, char *alias_name, uint8 *type) +uint32 lookup_alias_sid(DOM_SID *sid, char *alias_name, uint8 *type) { - fstring sid_str; + pstring sid_str; + uint32 rid; + DOM_SID tmp; + LOCAL_GRP *als = NULL; + uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; + (*type) = SID_NAME_ALIAS; sid_to_string(sid_str, sid); + DEBUG(5,("lookup_alias_sid: sid: %s", sid_str)); - DEBUG(2,("lookup_alias_name: sid: %s\n", sid_str)); - DEBUG(2,(" NOT IMPLEMENTED\n")); + sid_copy(&tmp, sid); + sid_split_rid(&tmp, &rid); - return 0xC0000000 | NT_STATUS_NONE_MAPPED; + if (!sid_equal(&global_sam_sid, &tmp)) + { + DEBUG(5,("not our SID\n")); + return 0xC0000000 | NT_STATUS_NONE_MAPPED; + } + + als = getaliasrid(rid, NULL, NULL); + + if (als != NULL) + { + fstrcpy(alias_name, als->name); + DEBUG(5,(" = %s\n", alias_name)); + return 0x0; + } + + DEBUG(5,(" none mapped\n")); + return status; } /******************************************************************* lookup well-known user name ********************************************************************/ -uint32 lookup_wk_user_name(DOM_SID *sid, char *user_name, uint8 *type) +uint32 lookup_wk_user_sid(DOM_SID *sid, char *user_name, uint8 *type) { int i = 0; uint32 rid; @@ -358,7 +383,7 @@ uint32 lookup_wk_user_name(DOM_SID *sid, char *user_name, uint8 *type) return 0xC0000000 | NT_STATUS_NONE_MAPPED; } - DEBUG(5,("lookup_wk_user_name: rid: %d", rid)); + DEBUG(5,("lookup_wk_user_sid: rid: %d", rid)); /* look up the well-known domain user rids first */ while (domain_user_rids[i].rid != rid && domain_user_rids[i].rid != 0) @@ -380,7 +405,7 @@ uint32 lookup_wk_user_name(DOM_SID *sid, char *user_name, uint8 *type) /******************************************************************* lookup user name ********************************************************************/ -uint32 lookup_user_name(DOM_SID *sid, char *user_name, uint8 *type) +uint32 lookup_user_sid(DOM_SID *sid, char *user_name, uint8 *type) { struct sam_disp_info *disp_info; uint32 rid; @@ -393,7 +418,7 @@ uint32 lookup_user_name(DOM_SID *sid, char *user_name, uint8 *type) if (sid_equal(&global_sam_sid, &tmp)) { - DEBUG(5,("lookup_user_name in SAM %s: rid: %d", + DEBUG(5,("lookup_user_sid in SAM %s: rid: %d", global_sam_name, rid)); /* find the user account */ @@ -417,20 +442,21 @@ uint32 lookup_user_name(DOM_SID *sid, char *user_name, uint8 *type) /******************************************************************* lookup_group_rid ********************************************************************/ -uint32 lookup_group_rid(char *group_name, uint32 *rid, uint8 *type) +uint32 lookup_group_name(char *grp_name, DOM_SID *sid, uint8 *type) { - DOM_SID sid; - - (*rid) = 0; + DOMAIN_GRP *grp = NULL; (*type) = SID_NAME_DOM_GRP; - DEBUG(5,("lookup_group_rid: name: %s", group_name)); + DEBUG(5,("lookup_group_name: name: %s", grp_name)); - if (map_group_name_to_sid(group_name, &sid) && - sid_split_rid(&sid, rid) && - sid_equal(&sid, &global_sam_sid)) + grp = getgroupnam(grp_name, NULL, NULL); + + if (grp != NULL) { - DEBUG(5,(" = 0x%x\n", (*rid))); + sid_copy(sid, &global_sam_sid); + sid_append_rid(sid, grp->rid); + + DEBUG(5,(" = 0x%x\n", grp->rid)); return 0x0; } @@ -439,64 +465,52 @@ uint32 lookup_group_rid(char *group_name, uint32 *rid, uint8 *type) } /******************************************************************* - lookup_wk_group_rid + lookup_wk_group_name ********************************************************************/ -uint32 lookup_wk_group_rid(char *group_name, uint32 *rid, uint8 *type) +uint32 lookup_wk_group_name(char *group_name, DOM_SID *sid, uint8 *type) { char *grp_name; int i = -1; /* start do loop at -1 */ - (*rid) = 0; + uint32 rid; (*type) = SID_NAME_WKN_GRP; do /* find, if it exists, a group rid for the group name */ { i++; - (*rid) = domain_group_rids[i].rid; + rid = domain_group_rids[i].rid; grp_name = domain_group_rids[i].name; - } while (grp_name != NULL && !strequal(grp_name, group_name)); - - return (grp_name != NULL) ? 0 : 0xC0000000 | NT_STATUS_NONE_MAPPED; -} - -/******************************************************************* - lookup_alias_sid - ********************************************************************/ -uint32 lookup_alias_sid(char *alias_name, DOM_SID *sid, uint8 *type) -{ - (*type) = SID_NAME_ALIAS; - - DEBUG(5,("lookup_alias_rid: name: %s", alias_name)); + if (strequal(grp_name, group_name)) + { + sid_copy(sid, &global_sam_sid); + sid_append_rid(sid, rid); - if (map_alias_name_to_sid(alias_name, sid)) - { - fstring sid_str; - sid_to_string(sid_str, sid); - DEBUG(5,(" = %s\n", sid_str)); - return 0x0; - } + return 0x0; + } + + } while (grp_name != NULL); - DEBUG(5,(" none mapped\n")); return 0xC0000000 | NT_STATUS_NONE_MAPPED; } /******************************************************************* - lookup_alias_rid + lookup_alias_name ********************************************************************/ -uint32 lookup_alias_rid(char *alias_name, uint32 *rid, uint8 *type) +uint32 lookup_alias_name(char *als_name, DOM_SID *sid, uint8 *type) { - DOM_SID sid; - - (*rid) = 0; + LOCAL_GRP *als = NULL; (*type) = SID_NAME_ALIAS; - DEBUG(5,("lookup_alias_rid: name: %s", alias_name)); + DEBUG(5,("lookup_alias_name: name: %s", als_name)); - if (map_alias_name_to_sid(alias_name, &sid) && - sid_split_rid(&sid, rid) && - sid_equal(&sid, &global_sam_sid)) + als = getaliasnam(als_name, NULL, NULL); + + if (als != NULL) { - DEBUG(5,(" = 0x%x\n", (*rid))); + sid_copy(sid, &global_sam_sid); + sid_append_rid(sid, als->rid); + + DEBUG(5,(" = 0x%x\n", als->rid)); return 0x0; } @@ -505,9 +519,9 @@ uint32 lookup_alias_rid(char *alias_name, uint32 *rid, uint8 *type) } /******************************************************************* - lookup_wk_alias_sid + lookup_wk_alias_name ********************************************************************/ -uint32 lookup_wk_alias_sid(char *alias_name, DOM_SID *sid, uint8 *type) +uint32 lookup_wk_alias_name(char *alias_name, DOM_SID *sid, uint8 *type) { char *als_name; int i = 0; @@ -534,53 +548,6 @@ uint32 lookup_wk_alias_sid(char *alias_name, DOM_SID *sid, uint8 *type) return 0xC0000000 | NT_STATUS_NONE_MAPPED; } -/******************************************************************* - lookup_wk_alias_rid - ********************************************************************/ -uint32 lookup_wk_alias_rid(char *alias_name, uint32 *rid, uint8 *type) -{ - char *als_name; - int i = -1; /* start do loop at -1 */ - (*rid) = 0; - (*type) = SID_NAME_ALIAS; - - do /* find, if it exists, a alias rid for the alias name*/ - { - i++; - (*rid) = builtin_alias_rids[i].rid; - als_name = builtin_alias_rids[i].name; - - } while (als_name != NULL && !strequal(als_name, alias_name)); - - return (als_name != NULL) ? 0 : 0xC0000000 | NT_STATUS_NONE_MAPPED; -} - -/******************************************************************* - lookup_sid - ********************************************************************/ -uint32 lookup_sid(char *name, DOM_SID *sid, uint8 *type) -{ - uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; - fstring domain; - fstring user; - - split_domain_name(name, domain, user); - - if (!strequal(domain, global_sam_name)) - { - DEBUG(0,("lookup_sid: remote domain %s not supported\n", domain)); - return status; - } - - status = (status != 0x0) ? lookup_wk_alias_sid(user, sid, type) : status; - status = (status != 0x0) ? lookup_alias_sid (user, sid, type) : status; -#if 0 - status = (status != 0x0) ? lookup_domain_sid (user, sid, type) : status; -#endif - - return status; -} - /******************************************************************* lookup_added_user_rid ********************************************************************/ @@ -607,12 +574,11 @@ uint32 lookup_added_user_rids(char *user_name, } /******************************************************************* - lookup_added_user_rid + lookup_added_user_name ********************************************************************/ -uint32 lookup_added_user_rid(char *user_name, uint32 *rid, uint8 *type) +uint32 lookup_added_user_name(char *user_name, DOM_SID *sid, uint8 *type) { struct sam_passwd *sam_pass; - (*rid) = 0; (*type) = SID_NAME_USER; /* find the user account */ @@ -622,7 +588,9 @@ uint32 lookup_added_user_rid(char *user_name, uint32 *rid, uint8 *type) if (sam_pass != NULL) { - (*rid) = sam_pass->user_rid; + sid_copy(sid, &global_sam_sid); + sid_append_rid(sid, sam_pass->user_rid); + return 0x0; } @@ -630,87 +598,107 @@ uint32 lookup_added_user_rid(char *user_name, uint32 *rid, uint8 *type) } /******************************************************************* - lookup_wk_user_rid + lookup_wk_user_name ********************************************************************/ -uint32 lookup_wk_user_rid(char *user_name, uint32 *rid, uint8 *type) +uint32 lookup_wk_user_name(char *user_name, DOM_SID *sid, uint8 *type) { char *usr_name; int i = -1; /* start do loop at -1 */ - (*rid) = 0; (*type) = SID_NAME_USER; do /* find, if it exists, a alias rid for the alias name*/ { i++; - (*rid) = domain_user_rids[i].rid; usr_name = domain_user_rids[i].name; } while (usr_name != NULL && !strequal(usr_name, user_name)); - return (usr_name != NULL) ? 0 : 0xC0000000 | NT_STATUS_NONE_MAPPED; + if (usr_name != NULL) + { + sid_copy(sid, &global_sid_S_1_5_20); + sid_append_rid(sid, domain_user_rids[i].rid); + return 0; + } + + return 0xC0000000 | NT_STATUS_NONE_MAPPED; } /******************************************************************* - lookup_added_grp_rid + lookup_added_grp_name ********************************************************************/ -uint32 lookup_added_grp_rid(char *name, uint32 *rid, uint8 *type) +uint32 lookup_added_grp_name(char *name, DOM_SID *sid, uint8 *type) { uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; - status = (status != 0x0) ? lookup_group_rid(name, rid, type) : status; - status = (status != 0x0) ? lookup_alias_rid(name, rid, type) : status; + status = (status != 0x0) ? lookup_group_name(name, sid, type) : status; + status = (status != 0x0) ? lookup_alias_name(name, sid, type) : status; return status; } /******************************************************************* - lookup_builtin_grp_rid + lookup_builtin_grp_name ********************************************************************/ -uint32 lookup_builtin_grp_rid(char *name, uint32 *rid, uint8 *type) +uint32 lookup_builtin_grp_name(char *name, DOM_SID *sid, uint8 *type) { uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; - status = (status != 0x0) ? lookup_wk_group_rid(name, rid, type) : status; - status = (status != 0x0) ? lookup_wk_alias_rid(name, rid, type) : status; + status = (status != 0x0) ? lookup_wk_group_name(name, sid, type) : status; + status = (status != 0x0) ? lookup_wk_alias_name(name, sid, type) : status; return status; } /******************************************************************* - lookup_grp_rid + lookup_grp_name ********************************************************************/ -uint32 lookup_grp_rid(char *name, uint32 *rid, uint8 *type) +uint32 lookup_grp_name(char *name, DOM_SID *sid, uint8 *type) { uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; - status = (status != 0x0) ? lookup_builtin_grp_rid(name, rid, type) : status; - status = (status != 0x0) ? lookup_added_grp_rid (name, rid, type) : status; + status = (status != 0x0) ? lookup_builtin_grp_name(name, sid, type) : status; + status = (status != 0x0) ? lookup_added_grp_name (name, sid, type) : status; return status; } /******************************************************************* - lookup_user_rid + lookup_user_name ********************************************************************/ -uint32 lookup_user_rid(char *name, uint32 *rid, uint8 *type) +uint32 lookup_user_name(char *name, DOM_SID *sid, uint8 *type) { uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; - status = (status != 0x0) ? lookup_wk_user_rid (name, rid, type) : status; - status = (status != 0x0) ? lookup_added_user_rid(name, rid, type) : status; + status = (status != 0x0) ? lookup_wk_user_name (name, sid, type) : status; + status = (status != 0x0) ? lookup_added_user_name(name, sid, type) : status; return status; } /******************************************************************* - lookup_rid + lookup_name ********************************************************************/ -uint32 lookup_rid(char *name, uint32 *rid, uint8 *type) +uint32 lookup_name(char *name, DOM_SID *sid, uint8 *type) { uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; + fstring domain; + fstring user; + + split_domain_name(name, domain, user); + + if (!strequal(domain, global_sam_name)) + { + DEBUG(0,("lookup_name: remote domain %s not supported\n", domain)); + return status; + } - status = (status != 0x0) ? lookup_user_rid(name, rid, type) : status; - status = (status != 0x0) ? lookup_grp_rid (name, rid, type) : status; + status = (status != 0x0) ? lookup_wk_alias_name(user, sid, type) : status; + status = (status != 0x0) ? lookup_alias_name (user, sid, type) : status; + status = (status != 0x0) ? lookup_user_name (name, sid, type) : status; + status = (status != 0x0) ? lookup_grp_name (name, sid, type) : status; +#if 0 + status = (status != 0x0) ? lookup_domain_name (user, sid, type) : status; +#endif return status; } @@ -722,6 +710,7 @@ uint32 lookup_user_rids(char *name, uint32 *usr_rid, uint32 *grp_rid) { uint32 status = 0xC0000000 | NT_STATUS_NONE_MAPPED; uint8 type; + DOM_SID sid; /* * try an ordinary user lookup @@ -737,11 +726,14 @@ uint32 lookup_user_rids(char *name, uint32 *usr_rid, uint32 *grp_rid) * hm. must be a well-known user, in a well-known group. */ - status = lookup_wk_user_rid(name, usr_rid, &type); + status = lookup_wk_user_name(name, &sid, &type); + sid_split_rid(&sid, usr_rid); + if (status != 0 || type != SID_NAME_USER) { return status; /* ok, maybe not! */ } + if (type != SID_NAME_USER) { return 0xC0000000 | NT_STATUS_NONE_MAPPED; /* users only... */ @@ -751,7 +743,9 @@ uint32 lookup_user_rids(char *name, uint32 *usr_rid, uint32 *grp_rid) * ok, got the user rid: now try the group rid */ - status = lookup_builtin_grp_rid(name, grp_rid, &type); + status = lookup_builtin_grp_name(name, &sid, &type); + sid_split_rid(&sid, usr_rid); + if (type == SID_NAME_DOM_GRP || type == SID_NAME_ALIAS || type == SID_NAME_WKN_GRP) diff --git a/source3/rpc_server/srv_lsa.c b/source3/rpc_server/srv_lsa.c index 51b6e8d25b..8c9db172d2 100644 --- a/source3/rpc_server/srv_lsa.c +++ b/source3/rpc_server/srv_lsa.c @@ -85,6 +85,7 @@ make_dom_query ***************************************************************************/ static void make_dom_query(DOM_QUERY *d_q, char *dom_name, DOM_SID *dom_sid) { + fstring sid_str; int domlen = strlen(dom_name); d_q->uni_dom_max_len = domlen * 2; @@ -96,6 +97,7 @@ static void make_dom_query(DOM_QUERY *d_q, char *dom_name, DOM_SID *dom_sid) /* this string is supposed to be character short */ make_unistr2(&(d_q->uni_domain_name), dom_name, domlen); + sid_to_string(sid_str, dom_sid); make_dom_sid2(&(d_q->dom_sid), dom_sid); } @@ -197,8 +199,8 @@ make_reply_lookup_rids ***************************************************************************/ static void make_reply_lookup_rids(LSA_R_LOOKUP_RIDS *r_l, int num_entries, - uint32 dom_rids[MAX_LOOKUP_SIDS], - uint8 dom_types[MAX_LOOKUP_SIDS]) + DOM_SID dom_sids [MAX_LOOKUP_SIDS], + uint8 dom_types[MAX_LOOKUP_SIDS]) { int i; @@ -215,8 +217,11 @@ static void make_reply_lookup_rids(LSA_R_LOOKUP_RIDS *r_l, for (i = 0; i < num_entries; i++) { + DOM_SID sid = dom_sids[i]; + uint32 rid; + sid_split_rid(&sid, &rid); make_dom_ref(&(r_l->dom_ref), dom_name, dom_sid); - make_dom_rid2(&(r_l->dom_rid[i]), dom_rids[i], dom_types[i]); + make_dom_rid2(&(r_l->dom_rid[i]), rid, dom_types[i]); } r_l->num_entries3 = num_entries; @@ -241,7 +246,7 @@ static void make_lsa_trans_names(DOM_R_REF *ref, { uint32 status = 0x0; DOM_SID find_sid = sid[i].sid; - DOM_SID tmp = sid[i].sid; + DOM_SID tmp_sid = sid[i].sid; uint32 rid = 0xffffffff; int dom_idx = -1; fstring name; @@ -261,7 +266,7 @@ static void make_lsa_trans_names(DOM_R_REF *ref, { if (sid_equal(&find_sid, &global_sam_sid)) { - status = lookup_name(&tmp, name, &sid_name_use); + status = lookup_sid(&tmp_sid, name, &sid_name_use); } else { @@ -337,15 +342,15 @@ lsa_reply_lookup_rids ***************************************************************************/ static void lsa_reply_lookup_rids(prs_struct *rdata, int num_entries, - uint32 dom_rids[MAX_LOOKUP_SIDS], - uint8 dom_types[MAX_LOOKUP_SIDS]) + DOM_SID dom_sids [MAX_LOOKUP_SIDS], + uint8 dom_types[MAX_LOOKUP_SIDS]) { LSA_R_LOOKUP_RIDS r_l; ZERO_STRUCT(r_l); /* set up the LSA Lookup RIDs response */ - make_reply_lookup_rids(&r_l, num_entries, dom_rids, dom_types); + make_reply_lookup_rids(&r_l, num_entries, dom_sids, dom_types); r_l.status = 0x0; @@ -474,11 +479,11 @@ static void api_lsa_lookup_names( uint16 vuid, prs_struct *data, { int i; LSA_Q_LOOKUP_RIDS q_l; - uint32 dom_rids[MAX_LOOKUP_SIDS]; - uint8 dom_types[MAX_LOOKUP_SIDS]; + DOM_SID dom_sids [MAX_LOOKUP_SIDS]; + uint8 dom_types[MAX_LOOKUP_SIDS]; ZERO_STRUCT(q_l); - ZERO_ARRAY(dom_rids); + ZERO_ARRAY(dom_sids); /* grab the info class and policy handle */ lsa_io_q_lookup_rids("", &q_l, data, 0); @@ -491,17 +496,16 @@ static void api_lsa_lookup_names( uint16 vuid, prs_struct *data, fstring name; fstrcpy(name, unistr2(q_l.lookup_name[i].str.buffer)); - if (lookup_rid(name, &dom_rids[i], &dom_types[i])) + if (!lookup_name(name, &dom_sids[i], &dom_types[i])) { - /* WHOOPS! we should really do something about this... */ - dom_rids[i] = 0; + dom_types[i] = SID_NAME_UNKNOWN; } } /* construct reply. return status is always 0x0 */ lsa_reply_lookup_rids(rdata, q_l.num_entries, - dom_rids, /* text-converted SIDs */ + dom_sids, /* text-converted SIDs */ dom_types); /* SID_NAME_USE types */ } diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c index 7b970d27d2..7e725f3599 100644 --- a/source3/rpc_server/srv_samr.c +++ b/source3/rpc_server/srv_samr.c @@ -444,15 +444,20 @@ static void samr_reply_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_u, { BOOL ret; char *name; + int i; got_grps = True; - while (num_entries < MAX_SAM_ENTRIES && ((name = domain_group_rids[num_entries].name) != NULL)) + become_root(True); + ret = enumdomgroups(&grps, &num_entries); + unbecome_root(True); + + while (num_entries < MAX_SAM_ENTRIES && ((name = domain_group_rids[i].name) != NULL)) { DOMAIN_GRP tmp_grp; fstrcpy(tmp_grp.name , name); fstrcpy(tmp_grp.comment, ""); - tmp_grp.rid = domain_group_rids[num_entries].rid; + tmp_grp.rid = domain_group_rids[i].rid; tmp_grp.attr = 0x7; if (!add_domain_group(&grps, &num_entries, &tmp_grp)) @@ -460,11 +465,10 @@ static void samr_reply_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS *q_u, r_e.status = 0xC0000000 | NT_STATUS_NO_MEMORY; break; } + + i++; } - become_root(True); - ret = enumdomgroups(&grps, &num_entries); - unbecome_root(True); if (!ret) { r_e.status = 0xC0000000 | NT_STATUS_NO_MEMORY; @@ -807,11 +811,12 @@ static void samr_reply_lookup_ids(SAMR_Q_LOOKUP_IDS *q_u, else if (sid_equal(&dom_sid, &usr_sid)) { DOMAIN_GRP *mem_grp = NULL; + BOOL ret; DEBUG(5,("lookup on Domain SID\n")); become_root(True); - getusergroupsnam(sam_pass->smb_name, &mem_grp, &num_rids); + ret = getusergroupsnam(sam_pass->smb_name, &mem_grp, &num_rids); unbecome_root(True); num_rids = MIN(num_rids, MAX_SAM_ENTRIES); @@ -880,10 +885,19 @@ static void samr_reply_lookup_names(SAMR_Q_LOOKUP_NAMES *q_u, for (i = 0; i < num_rids && status == 0; i++) { + DOM_SID sid; fstring name; fstrcpy(name, unistrn2(q_u->uni_user_name[i].buffer, q_u->uni_user_name[i].uni_str_len)); - status = lookup_rid(name, &(rid[i]), &(type[i])); + status = lookup_name(name, &sid, &(type[i])); + if (status == 0x0) + { + sid_split_rid(&sid, &rid[i]); + } + else + { + type[i] = SID_NAME_UNKNOWN; + } } make_samr_r_lookup_names(&r_u, num_rids, rid, type, status); @@ -995,9 +1009,10 @@ static void samr_reply_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, prs_struct *rdata) { fstring group_names[MAX_SAM_ENTRIES]; - uint32 group_attrs[MAX_SAM_ENTRIES]; + uint8 group_attrs[MAX_SAM_ENTRIES]; uint32 status = 0; int num_gids = q_u->num_gids1; + DOM_SID pol_sid; SAMR_R_UNKNOWN_12 r_u; @@ -1009,6 +1024,11 @@ static void samr_reply_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, status = 0xC0000000 | NT_STATUS_INVALID_HANDLE; } + if (status == 0x0 && !get_lsa_policy_samr_sid(&q_u->pol, &pol_sid)) + { + status = NT_STATUS_OBJECT_TYPE_MISMATCH; + } + if (status == 0x0) { int i; @@ -1020,7 +1040,10 @@ static void samr_reply_unknown_12(SAMR_Q_UNKNOWN_12 *q_u, for (i = 0; i < num_gids && status == 0; i++) { - fstrcpy(group_names[i], "dummy group"); + DOM_SID sid; + sid_copy(&sid, &pol_sid); + sid_append_rid(&sid, q_u->gid[i]); + lookup_sid(&sid, group_names[i], &group_attrs[i]); group_attrs[i] = 0x2; } } @@ -1369,9 +1392,10 @@ static void samr_reply_query_usergroups(SAMR_Q_QUERY_USERGROUPS *q_u, if (status == 0x0) { DOMAIN_GRP *mem_grp = NULL; + BOOL ret; become_root(True); - getusergroupsnam(sam_pass->smb_name, &mem_grp, &num_groups); + ret = getusergroupsnam(sam_pass->smb_name, &mem_grp, &num_groups); unbecome_root(True); gids = NULL; diff --git a/source3/rpc_server/srv_sid.c b/source3/rpc_server/srv_sid.c index 6428e965f7..a8a94204c1 100644 --- a/source3/rpc_server/srv_sid.c +++ b/source3/rpc_server/srv_sid.c @@ -63,13 +63,10 @@ DOM_SID global_member_sid; DOM_SID global_sid_S_1_5_20; /* local well-known domain */ DOM_SID global_sid_S_1_1; /* everyone */ +DOM_SID global_sid_S_1_3; /* */ DOM_SID global_sid_S_1_5; /* NT Authority */ -DOM_SID global_sid_S_1_3_0; /* Creator owner */ -DOM_SID global_sid_S_1_3_1; /* Creator group */ -DOM_SID global_sid_S_1_3_2; /* Creator owner server */ -DOM_SID global_sid_S_1_3_3; /* Creator group server */ -extern fstring global_myworkgroup; +extern pstring global_myworkgroup; /* extern fstring global_member_dom_name; */ static struct sid_name_map_info @@ -82,10 +79,7 @@ sid_name_map[] = { { &global_sid_S_1_5_20, "BUILTIN" }, { &global_sid_S_1_1 , "Everyone" }, - { &global_sid_S_1_3_0 , "Creator Owner" }, - { &global_sid_S_1_3_1 , "Creator Group" }, - { &global_sid_S_1_3_2 , "Creator Owner Server" }, - { &global_sid_S_1_3_3 , "Creator Group Server" }, + { &global_sid_S_1_3 , "don't know" }, { &global_sid_S_1_5 , "NT Authority" }, { &global_sam_sid , global_sam_name }, { &global_member_sid , global_myworkgroup }, @@ -99,6 +93,7 @@ sid_name_map[] = static BOOL read_sid_from_file(int fd, char *sid_file) { fstring fline; + fstring sid_str; memset(fline, '\0', sizeof(fline)); @@ -118,12 +113,43 @@ static BOOL read_sid_from_file(int fd, char *sid_file) return False; } + sid_to_string(sid_str, &global_sam_sid); + DEBUG(5,("read_sid_from_file: sid %s\n", sid_str)); + return True; } /**************************************************************************** - Generate the global machine sid. Look for the MACHINE.SID file first, if - not found then look in smb.conf and use it to create the MACHINE.SID file. + sets up the name associated with the SAM database for which we are responsible +****************************************************************************/ +void get_sam_domain_name(void) +{ + switch (lp_server_role()) + { + case ROLE_DOMAIN_PDC: + case ROLE_DOMAIN_BDC: + { + /* we are PDC (or BDC) for a Domain */ + fstrcpy(global_sam_name, lp_workgroup()); + break; + } + case ROLE_DOMAIN_MEMBER: + { + /* we are a "PDC", but FOR LOCAL SAM DATABASE ONLY */ + fstrcpy(global_sam_name, global_myname); + break; + } + default: + { + /* no domain role, probably due to "security = share" */ + memset(global_sam_name, 0, sizeof(global_sam_name)); + break; + } + } +} + +/**************************************************************************** + obtain the sid from the PDC. do some verification along the way... ****************************************************************************/ BOOL get_member_domain_sid(void) { @@ -138,7 +164,7 @@ BOOL get_member_domain_sid(void) if (!cli_connect_serverlist(&cli, lp_passwordserver())) { - DEBUG(0,("get_member_domain_sid: unable to initialize client connection.\n")); + DEBUG(0,("get_member_domain_sid: unable to initialise client connection.\n")); return False; } @@ -179,11 +205,11 @@ BOOL get_member_domain_sid(void) if (res) { pstring sid; - DEBUG(5,("LSA Query Info Policy\n")); + DEBUG(2,("LSA Query Info Policy\n")); sid_to_string(sid, &sid3); - DEBUG(5,("Domain Member - Domain: %s SID: %s\n", dom3, sid)); + DEBUG(2,("Domain Member - Domain: %s SID: %s\n", dom3, sid)); sid_to_string(sid, &sid5); - DEBUG(5,("Domain Controller - Domain: %s SID: %s\n", dom5, sid)); + DEBUG(2,("Domain Controller - Domain: %s SID: %s\n", dom5, sid)); if (!strequal(dom3, global_myworkgroup) || !strequal(dom5, global_myworkgroup)) @@ -195,7 +221,7 @@ BOOL get_member_domain_sid(void) } else { - DEBUG(5,("lsa query info failed\n")); + DEBUG(1,("lsa query info failed\n")); } if (!res) { @@ -217,10 +243,7 @@ void generate_wellknown_sids(void) { string_to_sid(&global_sid_S_1_5_20, "S-1-5-32"); string_to_sid(&global_sid_S_1_1 , "S-1-1" ); - string_to_sid(&global_sid_S_1_3_0 , "S-1-3-0" ); - string_to_sid(&global_sid_S_1_3_1 , "S-1-3-1" ); - string_to_sid(&global_sid_S_1_3_2 , "S-1-3-2" ); - string_to_sid(&global_sid_S_1_3_3 , "S-1-3-3" ); + string_to_sid(&global_sid_S_1_3 , "S-1-3" ); string_to_sid(&global_sid_S_1_5 , "S-1-5" ); } @@ -476,7 +499,7 @@ BOOL split_domain_name(char *fullname, char *domain, char *name) fstrcpy(full_name, fullname); p = strchr(full_name+1, '\\'); - if (p == NULL) + if (p != NULL) { *p = 0; fstrcpy(domain, full_name); diff --git a/source3/script/mkproto.awk b/source3/script/mkproto.awk index d1cbf5b667..e54984e4e5 100644 --- a/source3/script/mkproto.awk +++ b/source3/script/mkproto.awk @@ -90,7 +90,7 @@ END { { gotstart = 0; - if( $0 ~ /^connection_struct|^pipes_struct|^file_fd_struct|^files_struct|^connection_struct|^uid_t|^gid_t|^unsigned|^mode_t|^DIR|^user|^int|^pid_t|^ino_t|^off_t/ ) { + if( $0 ~ /^connection_struct|^LOCAL_GRP|^DOMAIN_GRP|^pipes_struct|^file_fd_struct|^files_struct|^connection_struct|^uid_t|^gid_t|^unsigned|^mode_t|^DIR|^user|^int|^pid_t|^ino_t|^off_t/ ) { gotstart = 1; } diff --git a/source3/smbd/groupname.c b/source3/smbd/groupname.c deleted file mode 100644 index 44625cf54a..0000000000 --- a/source3/smbd/groupname.c +++ /dev/null @@ -1,606 +0,0 @@ -/* - Unix SMB/Netbios implementation. - Version 1.9. - Groupname handling - Copyright (C) Jeremy Allison 1998. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* - * UNIX gid and Local or Domain SID resolution. This module resolves - * only those entries in the map files, it is *NOT* responsible for - * resolving UNIX groups not listed: that is an entirely different - * matter, altogether... - */ - -/* - * - * - - format of the file is: - - unixname NT Group name - unixname Domain Admins (well-known Domain Group) - unixname DOMAIN_NAME\NT Group name - unixname OTHER_DOMAIN_NAME\NT Group name - unixname DOMAIN_NAME\Domain Admins (well-known Domain Group) - .... - - if the DOMAIN_NAME\ component is left off, then your own domain is assumed. - - * - * - */ - - -#include "includes.h" -extern int DEBUGLEVEL; - -/* we can map either local aliases or domain groups */ -typedef enum -{ - GROUP_LOCAL, - GROUP_DOMAIN - -} GROUP_TYPE; - -/************************************************************************** - Groupname map functionality. The code loads a groupname map file and - (currently) loads it into a linked list. This is slow and memory - hungry, but can be changed into a more efficient storage format - if the demands on it become excessive. -***************************************************************************/ - -typedef struct group_name_info -{ - char *nt_name; - char *nt_domain; - char *unix_name; - - DOM_SID sid; - gid_t unix_gid; - -} GROUP_NAME_INFO; - -typedef struct name_map -{ - ubi_slNode next; - GROUP_NAME_INFO grp; - -} name_map_entry; - -static ubi_slList groupname_map_list; -static ubi_slList aliasname_map_list; - -static void delete_name_entry(name_map_entry *gmep) -{ - if (gmep->grp.nt_name) - { - free(gmep->grp.nt_name); - } - if (gmep->grp.nt_domain) - { - free(gmep->grp.nt_domain); - } - if (gmep->grp.unix_name) - { - free(gmep->grp.unix_name); - } - free((char*)gmep); -} - -/************************************************************************** - Delete all the entries in the name map list. -***************************************************************************/ - -static void delete_map_list(ubi_slList *map_list) -{ - name_map_entry *gmep; - - while ((gmep = (name_map_entry *)ubi_slRemHead(map_list )) != NULL) - { - delete_name_entry(gmep); - } -} - - -/************************************************************************** - makes a group sid out of a domain sid and a _unix_ gid. -***************************************************************************/ -static BOOL make_mydomain_sid(GROUP_NAME_INFO *grp, GROUP_TYPE type) -{ - uint32 tmp_rid; - uint8 tmp_type; - - DEBUG(10,("make_mydomain_sid\n")); - - if (!map_domain_name_to_sid(&grp->sid, &(grp->nt_domain))) - { - DEBUG(0,("make_mydomain_sid: unknown domain %s\n", - grp->nt_domain)); - return False; - } - else if (lookup_wk_group_rid(grp->nt_name, &tmp_rid, &tmp_type)) - { - return sid_append_rid(&grp->sid, tmp_rid); - } - else - { - if (type == GROUP_DOMAIN) - { - tmp_rid = pwdb_gid_to_group_rid(grp->unix_gid); - } - else - { - tmp_rid = pwdb_gid_to_alias_rid(grp->unix_gid); - } - return sid_append_rid(&(grp->sid), tmp_rid); - } -} - -/************************************************************************** - makes a group sid out of an nt domain, nt group name or a unix group name. -***************************************************************************/ -static BOOL unix_name_to_group_info(GROUP_NAME_INFO *grp, GROUP_TYPE type) -{ - extern fstring global_sam_name; - struct group *gptr = NULL; - - /* - * Attempt to get the unix gid_t for this name. - */ - - DEBUG(5,("unix_name_to_group_info: unix_name:%s\n", grp->unix_name)); - - gptr = (struct group *)getgrnam(grp->unix_name); - if (gptr == NULL) - { - DEBUG(0,("unix_name_to_group_info: getgrnam for group %s\ -failed. Error was %s.\n", grp->unix_name, strerror(errno) )); - return False; - } - - grp->unix_gid = (gid_t)gptr->gr_gid; - - DEBUG(5,("unix_name_to_group_info: unix gid:%d\n", grp->unix_gid)); - - /* - * Now map the name to an NT SID+RID. - */ - - if (grp->nt_domain != NULL && !strequal(grp->nt_domain, global_sam_name)) - { - /* Must add client-call lookup code here, to - * resolve remote domain's sid and the group's rid, - * in that domain. - * - * NOTE: it is _incorrect_ to put code here that assumes - * that we can call pwdb_gid_to_group_rid() or _alias_rid(): - * it is a totally different domain for which we are *NOT* - * responsible. - * for foriegn domains for which we are *NOT* the PDC, all - * we can be responsible for is the unix * gid_t to which - * the foriegn SID+rid maps to, on this _local_ machine. - */ - - if (!map_domain_name_to_sid(&grp->sid, &(grp->nt_domain))) - { - DEBUG(0,("unix_name_to_group_info: no known sid for %s\n", - grp->nt_domain)); - return False; - } - - DEBUG(0,("unix_name_to_group_info: cannot resolve domain %s\n", - grp->nt_domain)); - - return False; - } - else - { - return make_mydomain_sid(grp, type); - } -} - -static BOOL make_name_entry(name_map_entry **new_ep, - char *nt_domain, char *nt_group, char *unix_group, - GROUP_TYPE type) -{ - /* - * Create the list entry and add it onto the list. - */ - - DEBUG(5,("make_name_entry:%s,%s,%s\n", nt_domain, nt_group, unix_group)); - - (*new_ep) = (name_map_entry *)malloc(sizeof(name_map_entry)); - if ((*new_ep) == NULL) - { - DEBUG(0,("make_name_entry: malloc fail for name_map_entry.\n")); - return False; - } - - ZERO_STRUCTP(*new_ep); - - (*new_ep)->grp.nt_name = strdup(nt_group ); - (*new_ep)->grp.nt_domain = strdup(nt_domain ); - (*new_ep)->grp.unix_name = strdup(unix_group); - - if ((*new_ep)->grp.nt_name == NULL || - (*new_ep)->grp.unix_name == NULL) - { - DEBUG(0,("make_name_entry: malloc fail for names in name_map_entry.\n")); - delete_name_entry((*new_ep)); - return False; - } - - /* - * look up the group names, make the Group-SID and unix gid - */ - - if (!unix_name_to_group_info(&(*new_ep)->grp, type)) - { - delete_name_entry((*new_ep)); - return False; - } - - return True; -} - -/************************************************************************** - Load a name map file. Sets last accessed timestamp. -***************************************************************************/ -static void load_name_map(GROUP_TYPE type) -{ - static time_t groupmap_file_last_modified = (time_t)0; - static time_t aliasmap_file_last_modified = (time_t)0; - static BOOL initialised_group = False; - static BOOL initialised_alias = False; - char *groupname_map_file = lp_groupname_map(); - char *aliasname_map_file = lp_aliasname_map(); - - SMB_STRUCT_STAT st; - FILE *fp; - char *s; - pstring buf; - name_map_entry *new_ep; - - time_t *file_last_modified; - int *initialised; - char *map_file; - ubi_slList *map_list; - - if (type == GROUP_DOMAIN) - { - file_last_modified = &groupmap_file_last_modified; - initialised = &initialised_group; - map_file = groupname_map_file; - map_list = &groupname_map_list; - } - else - { - file_last_modified = &aliasmap_file_last_modified; - initialised = &initialised_alias; - map_file = aliasname_map_file; - map_list = &aliasname_map_list; - } - - DEBUG(10,("load_name_map : %s\n", map_file)); - - if (!(*initialised)) - { - ubi_slInitList(map_list); - (*initialised) = True; - } - - if (!*map_file) - { - return; - } - - if (sys_stat(map_file, &st) != 0) - { - DEBUG(0, ("load_name_map: Unable to stat file %s. Error was %s\n", - map_file, strerror(errno) )); - return; - } - - /* - * Check if file has changed. - */ - if (st.st_mtime <= (*file_last_modified)) - { - return; - } - - (*file_last_modified) = st.st_mtime; - - /* - * Load the file. - */ - - fp = sys_fopen(map_file,"r"); - if (!fp) - { - DEBUG(0,("load_name_map: can't open name map %s. Error was %s\n", - map_file, strerror(errno))); - return; - } - - /* - * Throw away any previous list. - */ - delete_map_list(map_list); - - DEBUG(4,("load_name_map: Scanning name map %s\n",map_file)); - - while ((s = fgets_slash(buf, sizeof(buf), fp)) != NULL) - { - pstring unixname; - pstring nt_name; - fstring nt_domain; - fstring nt_group; - char *p; - - DEBUG(10,("Read line |%s|\n", s)); - - memset(nt_name, 0, sizeof(nt_name)); - - if (!*s || strchr("#;",*s)) - continue; - - if (!next_token(&s,unixname, "\t\n\r=", sizeof(unixname))) - continue; - - if (!next_token(&s,nt_name, "\t\n\r=", sizeof(nt_name))) - continue; - - trim_string(unixname, " ", " "); - trim_string(nt_name, " ", " "); - - if (!*nt_name) - continue; - - if (!*unixname) - continue; - - DEBUG(5,("unixname = %s, ntname = %s.\n", - unixname, nt_name)); - - p = strchr(nt_name, '\\'); - - if (p == NULL) - { - memset(nt_domain, 0, sizeof(nt_domain)); - fstrcpy(nt_group, nt_name); - } - else - { - *p = 0; - p++; - fstrcpy(nt_domain, nt_name); - fstrcpy(nt_group , p); - } - - if (make_name_entry(&new_ep, nt_domain, nt_name, unixname, type)) - { - ubi_slAddHead(map_list, (ubi_slNode *)new_ep); - } - } - - DEBUG(10,("load_name_map: Added %ld entries to name map.\n", - ubi_slCount(map_list))); - - fclose(fp); -} - -/*********************************************************** - Lookup a gid_t by SID -************************************************************/ -static BOOL map_sid_to_gid(GROUP_TYPE type, ubi_slList *map_list, - DOM_SID *psid, gid_t *gid) -{ - name_map_entry *gmep; - - /* - * Initialize and load if not already loaded. - */ - load_name_map(type); - - for (gmep = (name_map_entry *)ubi_slFirst(map_list); - gmep != NULL; - gmep = (name_map_entry *)ubi_slNext(gmep )) - { - if (sid_equal(&gmep->grp.sid, psid)) - { - *gid = gmep->grp.unix_gid; - DEBUG(7,("map_sid_to_gid: Mapping unix group %s to nt group %s.\n", - gmep->grp.unix_name, gmep->grp.nt_name )); - return True; - } - } - - return False; -} - -/*********************************************************** - Lookup a SID entry by nt name. -************************************************************/ -static BOOL map_sid_to_ntname(GROUP_TYPE type, ubi_slList *map_list, - DOM_SID *psid, char *ntname, char *ntdomain) -{ - name_map_entry *gmep; - - /* - * Initialize and load if not already loaded. - */ - load_name_map(type); - - for (gmep = (name_map_entry *)ubi_slFirst(&map_list); - gmep != NULL; - gmep = (name_map_entry *)ubi_slNext(gmep )) - { - if (sid_equal(&gmep->grp.sid, psid)) - { - if (ntname != NULL) - { - fstrcpy(ntname, gmep->grp.nt_name); - } - if (ntdomain != NULL) - { - fstrcpy(ntname, gmep->grp.nt_domain); - } - DEBUG(7,("map_sid_to_ntname: Mapping unix group %s to nt group \\%s\\%s\n", - gmep->grp.unix_name, - gmep->grp.nt_domain, gmep->grp.nt_name )); - return True; - } - } - - return False; -} - -/*********************************************************** - Lookup a SID entry by nt name. -************************************************************/ -static BOOL map_ntname_to_sid(GROUP_TYPE type, ubi_slList *map_list, - char * ntname, DOM_SID *psid) -{ - name_map_entry *gmep; - - /* - * Initialize and load if not already loaded. - */ - load_name_map(type); - - for (gmep = (name_map_entry *)ubi_slFirst(&map_list); - gmep != NULL; - gmep = (name_map_entry *)ubi_slNext(gmep )) - { - if (strequal(gmep->grp.nt_name, ntname)) - { - *psid = gmep->grp.sid; - DEBUG(7,("map_ntname_to_sid: Mapping unix group %s to nt group %s.\n", - gmep->grp.unix_name, gmep->grp.nt_name )); - return True; - } - } - - return False; -} - -/*********************************************************** - Lookup a SID entry by gid_t. -************************************************************/ -static BOOL map_gid_to_sid(GROUP_TYPE type, ubi_slList *map_list, - gid_t gid, DOM_SID *psid) -{ - name_map_entry *gmep; - - /* - * Initialize and load if not already loaded. - */ - load_name_map(type); - - for (gmep = (name_map_entry *)ubi_slFirst(&map_list); - gmep != NULL; - gmep = (name_map_entry *)ubi_slNext(gmep )) - { - if (gmep->grp.unix_gid == gid) - { - *psid = gmep->grp.sid; - DEBUG(7,("map_gid_to_sid: Mapping unix group %s to nt group %s.\n", - gmep->grp.unix_name, gmep->grp.nt_name )); - return True; - } - } - - return False; -} - -/* - * Call these four functions to resolve unix group ids and either - * local group SIDs or domain group SIDs listed in the local group - * or domain group map files. - * - * Note that it is *NOT* the responsibility of these functions to - * resolve entries that are not in the map files. - * - * Any SID can be in the map files (i.e from any Domain). - */ - -/*********************************************************** - Lookup a Group entry by sid. -************************************************************/ -BOOL map_group_sid_to_name(DOM_SID *psid, char *group_name, char *nt_domain) -{ - return map_sid_to_ntname(GROUP_DOMAIN, &groupname_map_list, psid, group_name, nt_domain); -} - -/*********************************************************** - Lookup an Alias SID entry by name. -************************************************************/ -BOOL map_alias_sid_to_name(DOM_SID *psid, char *alias_name, char *nt_domain) -{ - return map_sid_to_ntname(GROUP_LOCAL, &aliasname_map_list, psid, alias_name, nt_domain); -} - -/*********************************************************** - Lookup a Group SID entry by name. -************************************************************/ -BOOL map_group_name_to_sid(char *group_name, DOM_SID *psid) -{ - return map_ntname_to_sid(GROUP_DOMAIN, &groupname_map_list, group_name, psid); -} - -/*********************************************************** - Lookup an Alias SID entry by name. -************************************************************/ -BOOL map_alias_name_to_sid(char *alias_name, DOM_SID *psid) -{ - return map_ntname_to_sid(GROUP_LOCAL, &aliasname_map_list, alias_name, psid); -} - -/*********************************************************** - Lookup an Alias SID entry by gid_t. -************************************************************/ -BOOL map_gid_to_alias_sid(gid_t gid, DOM_SID *psid) -{ - return map_gid_to_sid(GROUP_LOCAL, &aliasname_map_list, gid, psid); -} - -/*********************************************************** - Lookup a Group SID entry by gid_t. -************************************************************/ -BOOL map_gid_to_group_sid( gid_t gid, DOM_SID *psid) -{ - return map_gid_to_sid(GROUP_DOMAIN, &groupname_map_list, gid, psid); -} - -/*********************************************************** - Lookup a Group gid_t by SID -************************************************************/ -BOOL map_group_sid_to_gid( DOM_SID *psid, gid_t *gid) -{ - return map_sid_to_gid(GROUP_DOMAIN, &groupname_map_list, psid, gid); -} - -/*********************************************************** - Lookup an Alias gid_t by SID -************************************************************/ -BOOL map_alias_sid_to_gid( DOM_SID *psid, gid_t *gid) -{ - return map_sid_to_gid(GROUP_LOCAL, &aliasname_map_list, psid, gid); -} - diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 8aacfa3867..60620c9854 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -615,8 +615,8 @@ int reply_ntcreate_and_X(connection_struct *conn, /* If it's an IPC, use the pipe handler. */ - if (IS_IPC(conn) && lp_nt_pipe_support()) { - + if (IS_IPC(conn) && lp_nt_pipe_support() && lp_security() != SEC_SHARE) + { int ret = nt_open_pipe(fname, conn, inbuf, outbuf, &pnum); if(ret != 0) return ret; diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 49816e5d47..e064b52dfa 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -652,26 +652,8 @@ static void usage(char *pname) codepage_initialise(lp_client_code_page()); fstrcpy(global_myworkgroup, lp_workgroup()); - memset(global_sam_name, 0, sizeof(global_sam_name)); - if (lp_domain_logons()) - { - if (lp_security() == SEC_USER) - { - /* we are PDC (or BDC) for a Domain */ - fstrcpy(global_sam_name, lp_workgroup()); - } - else if (lp_security() == SEC_DOMAIN) - { - /* we are a "PDC", but FOR LOCAL SAM DATABASE ONLY */ - fstrcpy(global_sam_name, global_myname); - } - else if (lp_security() == SEC_SHARE) - { - DEBUG(0,("ERROR: no Domain functionality in security = share\n")); - exit(1); - } - } + get_sam_domain_name(); generate_wellknown_sids(); -- cgit