From 0013983d486d388f16594ce1d861c5cf8a3b95a8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 21 Oct 2002 19:21:41 +0000 Subject: Remove obsolete acconfig.h - we now use comments in AC_DEFINE() (This used to be commit dc4fcb71edc22f36cd1f6d78a211d09c418f3309) --- source3/acconfig.h | 237 -------------- source3/aclocal.m4 | 4 +- source3/configure | 647 +++++++++++++++++++++++++------------- source3/configure.in | 415 ++++++++++++------------ source3/include/config.h.in | 746 ++++++++++++++++++++++++++++++-------------- 5 files changed, 1144 insertions(+), 905 deletions(-) delete mode 100644 source3/acconfig.h diff --git a/source3/acconfig.h b/source3/acconfig.h deleted file mode 100644 index 7b05525571..0000000000 --- a/source3/acconfig.h +++ /dev/null @@ -1,237 +0,0 @@ -#undef HAVE_VOLATILE -#undef HAVE_BROKEN_READDIR -#undef HAVE_C99_VSNPRINTF -#undef HAVE_ERRNO_DECL -#undef HAVE_LONGLONG -#undef HAVE_OFF64_T -#undef HAVE_REMSH -#undef HAVE_UNSIGNED_CHAR -#undef HAVE_UTIMBUF -#undef HAVE_SIG_ATOMIC_T_TYPE -#undef HAVE_SOCKLEN_T_TYPE -#undef ssize_t -#undef ino_t -#undef ssize_t -#undef loff_t -#undef offset_t -#undef aclent_t -#undef wchar_t -#undef HAVE_CONNECT -#undef HAVE_SHORT_INO_T -#undef WITH_SMBWRAPPER -#undef WITH_AFS -#undef WITH_DFS -#undef SUNOS5 -#undef SUNOS4 -#undef LINUX -#undef AIX -#undef BSD -#undef IRIX -#undef UNIXWARE -#undef SYSV -#undef IRIX6 -#undef HPUX -#undef QNX -#undef SCO -#undef OSF1 -#undef NEXT2 -#undef RELIANTUNIX -#undef HAVE_MMAP -#undef HAVE_FCNTL_LOCK -#undef HAVE_FTRUNCATE_EXTEND -#undef FTRUNCATE_NEEDS_ROOT -#undef HAVE_TRAPDOOR_UID -#undef HAVE_ROOT -#undef HAVE_GETTIMEOFDAY_TZ -#undef HAVE_SOCK_SIN_LEN -#undef STAT_READ_FILSYS -#undef STAT_STATFS2_BSIZE -#undef STAT_STATFS2_FSIZE -#undef STAT_STATFS2_FS_DATA -#undef STAT_STATFS3_OSF1 -#undef STAT_STATFS4 -#undef STAT_STATVFS -#undef STAT_STATVFS64 -#undef HAVE_IFACE_AIX -#undef HAVE_IFACE_IFCONF -#undef HAVE_IFACE_IFREQ -#undef HAVE_CRYPT -#undef HAVE_PUTPRPWNAM -#undef HAVE_SET_AUTH_PARAMETERS -#undef WITH_SYSLOG -#undef WITH_PROFILE -#undef WITH_PAM -#undef WITH_NISPLUS_HOME -#undef WITH_AUTOMOUNT -#undef WITH_SMBMOUNT -#undef WITH_QUOTAS -#undef WITH_WINBIND -#undef HAVE_BROKEN_GETGROUPS -#undef REPLACE_GETPASS -#undef REPLACE_INET_NTOA -#undef HAVE_FILE_MACRO -#undef HAVE_FUNCTION_MACRO -#undef HAVE_VA_COPY -#undef HAVE_SETRESUID_DECL -#undef HAVE_SETRESUID -#undef WITH_NETATALK -#undef WITH_UTMP -#undef WITH_MSDFS -#undef WITH_LIBICONV -#undef HAVE_INO64_T -#undef HAVE_DEV64_T -#undef HAVE_STRUCT_FLOCK64 -#undef SIZEOF_INO_T -#undef SIZEOF_OFF_T -#undef STAT_STATVFS64 -#undef HAVE_LIBREADLINE -#undef HAVE_KERNEL_SHARE_MODES -#undef HAVE_KERNEL_OPLOCKS_IRIX -#undef HAVE_KERNEL_OPLOCKS_LINUX -#undef HAVE_KERNEL_CHANGE_NOTIFY -#undef HAVE_IRIX_SPECIFIC_CAPABILITIES -#undef HAVE_INT16_FROM_RPC_RPC_H -#undef HAVE_UINT16_FROM_RPC_RPC_H -#undef HAVE_INT32_FROM_RPC_RPC_H -#undef HAVE_UINT32_FROM_RPC_RPC_H -#undef KRB4_AUTH -#undef KRB5_AUTH -#undef KRB4_DIR -#undef KRB5_DIR -#undef SEEKDIR_RETURNS_VOID -#undef HAVE_DIRENT_D_OFF -#undef HAVE_GETSPNAM -#undef HAVE_BIGCRYPT -#undef HAVE_GETPRPWNAM -#undef HAVE_FSTAT64 -#undef HAVE_LSTAT64 -#undef HAVE_STAT64 -#undef HAVE_SETRESGID -#undef HAVE_SETRESGID_DECL -#undef HAVE_SHADOW_H -#undef HAVE_CUPS -#undef HAVE_MEMSET -#undef HAVE_STRCASECMP -#undef HAVE_STRUCT_DIRENT64 -#undef HAVE_TRUNCATED_SALT -#undef BROKEN_NISPLUS_INCLUDE_FILES -#undef HAVE_RPC_AUTH_ERROR_CONFLICT -#undef HAVE_EXPLICIT_LARGEFILE_SUPPORT -#undef USE_BOTH_CRYPT_CALLS -#undef HAVE_BROKEN_FCNTL64_LOCKS -#undef HAVE_SECURE_MKSTEMP -#undef HAVE_FNMATCH -#undef USE_SETEUID -#undef USE_SETRESUID -#undef USE_SETREUID -#undef USE_SETUIDX -#undef HAVE_DLOPEN -#undef HAVE_DLCLOSE -#undef HAVE_DLSYM -#undef HAVE_DLERROR -#undef SYSCONF_SC_NGROUPS_MAX -#undef HAVE_UT_UT_NAME -#undef HAVE_UT_UT_USER -#undef HAVE_UT_UT_ID -#undef HAVE_UT_UT_HOST -#undef HAVE_UT_UT_TIME -#undef HAVE_UT_UT_TV -#undef HAVE_UT_UT_TYPE -#undef HAVE_UT_UT_PID -#undef HAVE_UT_UT_EXIT -#undef HAVE_UT_UT_ADDR -#undef HAVE_UX_UT_SYSLEN -#undef PUTUTLINE_RETURNS_UTMP -#undef COMPILER_SUPPORTS_LL -#undef HAVE_YP_GET_DEFAULT_DOMAIN -#undef USE_SPINLOCKS -#undef SPARC_SPINLOCKS -#undef INTEL_SPINLOCKS -#undef MIPS_SPINLOCKS -#undef POWERPC_SPINLOCKS -#undef HAVE_POSIX_ACLS -#undef HAVE_ACL_GET_PERM_NP -#undef HAVE_UNIXWARE_ACLS -#undef HAVE_SOLARIS_ACLS -#undef HAVE_HPUX_ACLS -#undef HAVE_IRIX_ACLS -#undef HAVE_AIX_ACLS -#undef HAVE_TRU64_ACLS -#undef HAVE_NO_ACLS -#undef HAVE_LIBPAM -#undef HAVE_ASPRINTF_DECL -#undef HAVE_VASPRINTF_DECL -#undef HAVE_SNPRINTF_DECL -#undef HAVE_VSNPRINTF_DECL -#undef HAVE_NATIVE_ICONV -#undef HAVE_UNIXSOCKET -#undef MMAP_BLACKLIST -#undef HAVE_IMMEDIATE_STRUCTURES -#undef HAVE_CUPS -#undef WITH_SAM -#undef WITH_LDAP_SAMCONFIG -#undef WITH_NISPLUS_SAM -#undef WITH_TDB_SAM -#undef LINUX_QUOTAS_1 -#undef LINUX_QUOTAS_2 -#undef PACKAGE -#undef VERSION -#undef HAVE_LC_MESSAGES -#undef ENABLE_NLS -#undef HAVE_CATGETS -#undef HAVE_GETTEXT -#undef HAVE_STPCPY -#undef I18N_SWAT -#undef I18N_DEFAULT_PREF_LANG -#undef HAVE_KRB5 -#undef HAVE_GSSAPI -#undef BROKEN_REDHAT_7_SYSTEM_HEADERS -#undef HAVE_LDAP -#undef HAVE_STAT_ST_BLOCKS -#undef STAT_ST_BLOCKSIZE -#undef HAVE_STAT_ST_BLKSIZE -#undef HAVE_DEVICE_MAJOR_FN -#undef HAVE_DEVICE_MINOR_FN -#undef HAVE_PASSWD_PW_COMMENT -#undef HAVE_PASSWD_PW_AGE -/* - * Add these definitions to allow VFS modules to - * see the CPPFLAGS defines. - */ -#ifndef _HPUX_SOURCE -#undef _HPUX_SOURCE -#endif -#ifndef _POSIX_SOURCE -#undef _POSIX_SOURCE -#endif -#ifndef _LARGEFILE64_SOURCE -#undef _LARGEFILE64_SOURCE -#endif -#ifndef _ALIGNMENT_REQUIRED -#undef _ALIGNMENT_REQUIRED -#endif -#ifndef _MAX_ALIGNMENT -#undef _MAX_ALIGNMENT -#endif -#ifndef _LARGE_FILES -#undef _LARGE_FILES -#endif -#ifndef _FILE_OFFSET_BITS -#undef _FILE_OFFSET_BITS -#endif -#ifndef _GNU_SOURCE -#undef _GNU_SOURCE -#endif - -#undef LDAP_SET_REBIND_PROC_ARGS -#undef HAVE_SENDFILE -#undef HAVE_SENDFILE64 -#undef LINUX_SENDFILE_API -#undef LINUX_BROKEN_SENDFILE_API -#undef WITH_SENDFILE -#undef FREEBSD_SENDFILE_API -#undef HPUX_SENDFILE_API -#undef WITH_ADS -#undef HAVE_SENDFILEV -#undef HAVE_SENDFILEV64 -#undef SOLARIS_SENDFILE_API diff --git a/source3/aclocal.m4 b/source3/aclocal.m4 index 4ae5336a4b..f04ec9d50d 100644 --- a/source3/aclocal.m4 +++ b/source3/aclocal.m4 @@ -32,7 +32,7 @@ AC_DEFUN(AC_DIRENT_D_OFF, #include ], [struct dirent d; d.d_off;], ac_cv_dirent_d_off=yes, ac_cv_dirent_d_off=no)]) if test $ac_cv_dirent_d_off = yes; then - AC_DEFINE(HAVE_DIRENT_D_OFF) + AC_DEFINE(HAVE_DIRENT_D_OFF,1,[Whether dirent has a d_off member]) fi ]) @@ -58,7 +58,7 @@ AC_DEFUN(AC_HAVE_DECL, AC_TRY_COMPILE([$2],[int i = (int)$1], ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)]) if test x"$ac_cv_have_$1_decl" = x"yes"; then - AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL]) + AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available]) fi ]) diff --git a/source3/configure b/source3/configure index 58a8bfa68e..e3237c9f26 100755 --- a/source3/configure +++ b/source3/configure @@ -2704,7 +2704,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_volatile" >&5 echo "${ECHO_T}$samba_cv_volatile" >&6 if test x"$samba_cv_volatile" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_VOLATILE 1 _ACEOF @@ -2853,7 +2854,8 @@ fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_Ae" >&5 echo "${ECHO_T}$ac_cv_prog_cc_Ae" >&6 # mmap on HPUX is completely broken... - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define MMAP_BLACKLIST 1 _ACEOF @@ -2868,50 +2870,61 @@ _ACEOF case `uname -r` in *9*|*10*) CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define USE_BOTH_CRYPT_CALLS 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _HPUX_SOURCE 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _ALIGNMENT_REQUIRED 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _MAX_ALIGNMENT 4 _ACEOF ;; *11*) CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define USE_BOTH_CRYPT_CALLS 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _HPUX_SOURCE 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _POSIX_SOURCE 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _ALIGNMENT_REQUIRED 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _MAX_ALIGNMENT 4 _ACEOF @@ -2936,7 +2949,8 @@ echo "${ECHO_T}disabling const" >&6 echo "$as_me:$LINENO: result: enabling large file support" >&5 echo "${ECHO_T}enabling large file support" >&6 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _LARGE_FILES 1 _ACEOF @@ -2965,18 +2979,21 @@ echo "${ECHO_T}enabling large file support" >&6 case "$ac_cv_gcc_compiler_version_number" in *"gcc version 2.6"*|*"gcc version 2.7"*) CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF ;; *) CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _FILE_OFFSET_BITS 64 _ACEOF @@ -2984,11 +3001,13 @@ _ACEOF esac else CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _FILE_OFFSET_BITS 64 _ACEOF @@ -3045,7 +3064,8 @@ fi CPPFLAGS="$old_CPPFLAGS" if test x$SINIX_LFS_SUPPORT = xyes ; then CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF @@ -3131,15 +3151,18 @@ fi CPPFLAGS="$old_CPPFLAGS" if test x$LINUX_LFS_SUPPORT = xyes ; then CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _FILE_OFFSET_BITS 64 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF @@ -3193,11 +3216,13 @@ fi CPPFLAGS="$old_CPPFLAGS" if test x$GLIBC_LFS_SUPPORT = xyes ; then CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF @@ -5146,7 +5171,8 @@ ac_cv_header_shadow_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test x"$ac_cv_header_shadow_h" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SHADOW_H 1 _ACEOF @@ -7858,7 +7884,8 @@ fi echo "$as_me:$LINENO: result: $ac_cv_dirent_d_off" >&5 echo "${ECHO_T}$ac_cv_dirent_d_off" >&6 if test $ac_cv_dirent_d_off = yes; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_DIRENT_D_OFF 1 _ACEOF @@ -8176,7 +8203,8 @@ fi if test "x$CUPS_CONFIG" != x; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_CUPS 1 _ACEOF @@ -8187,7 +8215,7 @@ _ACEOF fi ############################################ -# we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the new VFS code +# we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code for ac_func in dlopen do @@ -8310,7 +8338,8 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then LIBS="$LIBS -ldl"; - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_DLOPEN 1 _ACEOF @@ -8373,7 +8402,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_immediate_structures" >&5 echo "${ECHO_T}$samba_cv_immediate_structures" >&6 if test x"$samba_cv_immediate_structures" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_IMMEDIATE_STRUCTURES 1 _ACEOF @@ -8430,7 +8460,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_unixsocket" >&5 echo "${ECHO_T}$samba_cv_unixsocket" >&6 if test x"$samba_cv_unixsocket" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UNIXSOCKET 1 _ACEOF @@ -8484,7 +8515,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_socklen_t" >&5 echo "${ECHO_T}$samba_cv_socklen_t" >&6 if test x"$samba_cv_socklen_t" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKLEN_T_TYPE 1 _ACEOF @@ -8537,7 +8569,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_sig_atomic_t" >&5 echo "${ECHO_T}$samba_cv_sig_atomic_t" >&6 if test x"$samba_cv_sig_atomic_t" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SIG_ATOMIC_T_TYPE 1 _ACEOF @@ -8586,7 +8619,8 @@ fi echo "$as_me:$LINENO: result: $ac_cv_have_errno_decl" >&5 echo "${ECHO_T}$ac_cv_have_errno_decl" >&6 if test x"$ac_cv_have_errno_decl" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_ERRNO_DECL 1 _ACEOF @@ -8634,7 +8668,8 @@ fi echo "$as_me:$LINENO: result: $ac_cv_have_setresuid_decl" >&5 echo "${ECHO_T}$ac_cv_have_setresuid_decl" >&6 if test x"$ac_cv_have_setresuid_decl" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SETRESUID_DECL 1 _ACEOF @@ -8682,7 +8717,8 @@ fi echo "$as_me:$LINENO: result: $ac_cv_have_setresgid_decl" >&5 echo "${ECHO_T}$ac_cv_have_setresgid_decl" >&6 if test x"$ac_cv_have_setresgid_decl" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SETRESGID_DECL 1 _ACEOF @@ -8730,7 +8766,8 @@ fi echo "$as_me:$LINENO: result: $ac_cv_have_asprintf_decl" >&5 echo "${ECHO_T}$ac_cv_have_asprintf_decl" >&6 if test x"$ac_cv_have_asprintf_decl" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_ASPRINTF_DECL 1 _ACEOF @@ -8778,7 +8815,8 @@ fi echo "$as_me:$LINENO: result: $ac_cv_have_vasprintf_decl" >&5 echo "${ECHO_T}$ac_cv_have_vasprintf_decl" >&6 if test x"$ac_cv_have_vasprintf_decl" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_VASPRINTF_DECL 1 _ACEOF @@ -8826,7 +8864,8 @@ fi echo "$as_me:$LINENO: result: $ac_cv_have_vsnprintf_decl" >&5 echo "${ECHO_T}$ac_cv_have_vsnprintf_decl" >&6 if test x"$ac_cv_have_vsnprintf_decl" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_VSNPRINTF_DECL 1 _ACEOF @@ -8874,7 +8913,8 @@ fi echo "$as_me:$LINENO: result: $ac_cv_have_snprintf_decl" >&5 echo "${ECHO_T}$ac_cv_have_snprintf_decl" >&6 if test x"$ac_cv_have_snprintf_decl" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SNPRINTF_DECL 1 _ACEOF @@ -8923,7 +8963,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_have_setresuid" >&5 echo "${ECHO_T}$samba_cv_have_setresuid" >&6 if test x"$samba_cv_have_setresuid" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SETRESUID 1 _ACEOF @@ -8972,7 +9013,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_have_setresgid" >&5 echo "${ECHO_T}$samba_cv_have_setresgid" >&6 if test x"$samba_cv_have_setresgid" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SETRESGID 1 _ACEOF @@ -9173,7 +9215,8 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6 if test $ac_cv_lib_crypt_crypt = yes; then AUTHLIBS="$AUTHLIBS -lcrypt"; - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_CRYPT 1 _ACEOF @@ -9647,7 +9690,8 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" > echo "${ECHO_T}$ac_cv_lib_readline_rl_callback_handler_install" >&6 if test $ac_cv_lib_readline_rl_callback_handler_install = yes; then TERMLIBS="-lreadline $TERMLIBS" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF @@ -10130,7 +10174,8 @@ if test $ac_cv_lib_readline_rl_callback_handler_install = yes; then TERMCPPFLAGS="-I$with_readline/include" CPPFLAGS="-I$with_readline/include $CPPFLAGS" TERMLIBS="-lreadline $TERMLIBS" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF @@ -10545,7 +10590,8 @@ fi test x"$ac_cv_lib_inet_connect" = x"yes"; then # ac_cv_func_connect=yes # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_CONNECT 1 _ACEOF @@ -10676,7 +10722,8 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_yp_get_default_domain" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_yp_get_default_domain" >&6 if test $ac_cv_lib_nsl_yp_get_default_domain = yes; then LIBS="$LIBS -lnsl"; - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_YP_GET_DEFAULT_DOMAIN 1 _ACEOF @@ -12783,7 +12830,8 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_cv_func_stat64" >&5 echo "${ECHO_T}$ac_cv_func_stat64" >&6 if test x$ac_cv_func_stat64 = xyes ; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_STAT64 1 _ACEOF @@ -12832,7 +12880,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "${ECHO_T}$ac_cv_func_lstat64" >&6 if test x$ac_cv_func_lstat64 = xyes ; then cat >>confdefs.h <<\_ACEOF -#define HAVE_LSTAT64 1 +#define HAVE_LSTAT64 Whether lstat64() is available _ACEOF fi @@ -12879,7 +12927,8 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_cv_func_fstat64" >&5 echo "${ECHO_T}$ac_cv_func_fstat64" >&6 if test x$ac_cv_func_fstat64 = xyes ; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_FSTAT64 1 _ACEOF @@ -15214,7 +15263,8 @@ echo $ECHO_N "checking ability to build shared libraries... $ECHO_C" >&6 # and these are for particular systems case "$host_os" in - *linux*) cat >>confdefs.h <<\_ACEOF + *linux*) +cat >>confdefs.h <<\_ACEOF #define LINUX 1 _ACEOF @@ -15228,7 +15278,8 @@ _ACEOF _ACEOF ;; - *solaris*) cat >>confdefs.h <<\_ACEOF + *solaris*) +cat >>confdefs.h <<\_ACEOF #define SUNOS5 1 _ACEOF @@ -15248,12 +15299,14 @@ _ACEOF POBAD_CC="" PICSUFFIX="po.o" fi - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_ST_BLOCKSIZE 512 _ACEOF ;; - *sunos*) cat >>confdefs.h <<\_ACEOF + *sunos*) +cat >>confdefs.h <<\_ACEOF #define SUNOS4 1 _ACEOF @@ -15267,7 +15320,8 @@ _ACEOF DYNEXP="-Wl,--export-dynamic" SONAMEFLAG="-Wl,-soname," PICFLAG="-fPIC -DPIC" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_ST_BLOCKSIZE 512 _ACEOF @@ -15277,17 +15331,20 @@ _ACEOF DYNEXP="-Wl,-Bdynamic" SONAMEFLAG="-Wl,-soname," PICFLAG="-fPIC" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_ST_BLOCKSIZE 512 _ACEOF ;; - *irix*) cat >>confdefs.h <<\_ACEOF + *irix*) +cat >>confdefs.h <<\_ACEOF #define IRIX 1 _ACEOF case "$host_os" in - *irix6*) cat >>confdefs.h <<\_ACEOF + *irix6*) +cat >>confdefs.h <<\_ACEOF #define IRIX6 1 _ACEOF @@ -15303,12 +15360,14 @@ _ACEOF else PICFLAG="-KPIC" fi - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_ST_BLOCKSIZE 512 _ACEOF ;; - *aix*) cat >>confdefs.h <<\_ACEOF + *aix*) +cat >>confdefs.h <<\_ACEOF #define AIX 1 _ACEOF @@ -15321,12 +15380,14 @@ _ACEOF CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000" fi - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_ST_BLOCKSIZE DEV_BSIZE _ACEOF ;; - *hpux*) cat >>confdefs.h <<\_ACEOF + *hpux*) +cat >>confdefs.h <<\_ACEOF #define HPUX 1 _ACEOF @@ -15340,16 +15401,19 @@ _ACEOF PICFLAG="+z" fi DYNEXP="-Wl,-E" - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_ST_BLOCKSIZE 8192 _ACEOF ;; - *qnx*) cat >>confdefs.h <<\_ACEOF + *qnx*) +cat >>confdefs.h <<\_ACEOF #define QNX 1 _ACEOF ;; - *osf*) cat >>confdefs.h <<\_ACEOF + *osf*) +cat >>confdefs.h <<\_ACEOF #define OSF1 1 _ACEOF @@ -15358,11 +15422,13 @@ _ACEOF SONAMEFLAG="-Wl,-soname," PICFLAG="-fPIC" ;; - *sco*) cat >>confdefs.h <<\_ACEOF + *sco*) +cat >>confdefs.h <<\_ACEOF #define SCO 1 _ACEOF ;; - *unixware*) cat >>confdefs.h <<\_ACEOF + *unixware*) +cat >>confdefs.h <<\_ACEOF #define UNIXWARE 1 _ACEOF @@ -15371,7 +15437,8 @@ _ACEOF SONAMEFLAG="-Wl,-soname," PICFLAG="-KPIC" ;; - *next2*) cat >>confdefs.h <<\_ACEOF + *next2*) +cat >>confdefs.h <<\_ACEOF #define NEXT2 1 _ACEOF ;; @@ -15410,13 +15477,15 @@ else echo "${ECHO_T}no" >&6 fi ;; - *sysv4*) cat >>confdefs.h <<\_ACEOF + *sysv4*) +cat >>confdefs.h <<\_ACEOF #define SYSV 1 _ACEOF case "$host" in *-univel-*) if test "$GCC" != yes ; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_MEMSET 1 _ACEOF @@ -15424,29 +15493,28 @@ _ACEOF LDSHFLAGS="-G" DYNEXP="-Bexport" ;; - *mips-sni-sysv4*) cat >>confdefs.h <<\_ACEOF + *mips-sni-sysv4*) +cat >>confdefs.h <<\_ACEOF #define RELIANTUNIX 1 _ACEOF ;; esac ;; - *sysv5*) cat >>confdefs.h <<\_ACEOF + *sysv5*) +cat >>confdefs.h <<\_ACEOF #define SYSV 1 _ACEOF if test "$GCC" != yes ; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_MEMSET 1 _ACEOF fi LDSHFLAGS="-G" ;; - *sysv*) cat >>confdefs.h <<\_ACEOF -#define SYSV 1 -_ACEOF -;; esac echo "$as_me:$LINENO: result: $BLDSHARED" >&5 @@ -15534,7 +15602,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_have_longlong" >&5 echo "${ECHO_T}$samba_cv_have_longlong" >&6 if test x"$samba_cv_have_longlong" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LONGLONG 1 _ACEOF @@ -15585,7 +15654,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_compiler_supports_ll" >&5 echo "${ECHO_T}$samba_cv_compiler_supports_ll" >&6 if test x"$samba_cv_compiler_supports_ll" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define COMPILER_SUPPORTS_LL 1 _ACEOF @@ -15633,7 +15703,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_SIZEOF_OFF_T" >&5 echo "${ECHO_T}$samba_cv_SIZEOF_OFF_T" >&6 if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define SIZEOF_OFF_T 8 _ACEOF @@ -15684,7 +15755,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_OFF64_T" >&5 echo "${ECHO_T}$samba_cv_HAVE_OFF64_T" >&6 if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_OFF64_T 1 _ACEOF @@ -15731,7 +15803,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_SIZEOF_INO_T" >&5 echo "${ECHO_T}$samba_cv_SIZEOF_INO_T" >&6 if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define SIZEOF_INO_T 8 _ACEOF @@ -15782,7 +15855,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_INO64_T" >&5 echo "${ECHO_T}$samba_cv_HAVE_INO64_T" >&6 if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_INO64_T 1 _ACEOF @@ -15833,7 +15907,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_DEV64_T" >&5 echo "${ECHO_T}$samba_cv_HAVE_DEV64_T" >&6 if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_DEV64_T 1 _ACEOF @@ -15885,7 +15960,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_STRUCT_DIRENT64" >&5 echo "${ECHO_T}$samba_cv_HAVE_STRUCT_DIRENT64" >&6 if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_DIRENT64 1 _ACEOF @@ -15935,7 +16011,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_DEVICE_MAJOR_FN" >&5 echo "${ECHO_T}$samba_cv_HAVE_DEVICE_MAJOR_FN" >&6 if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_DEVICE_MAJOR_FN 1 _ACEOF @@ -15985,7 +16062,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_DEVICE_MINOR_FN" >&5 echo "${ECHO_T}$samba_cv_HAVE_DEVICE_MINOR_FN" >&6 if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_DEVICE_MINOR_FN 1 _ACEOF @@ -16031,7 +16109,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UNSIGNED_CHAR" >&5 echo "${ECHO_T}$samba_cv_HAVE_UNSIGNED_CHAR" >&6 if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UNSIGNED_CHAR 1 _ACEOF @@ -16080,7 +16159,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_SOCK_SIN_LEN" >&5 echo "${ECHO_T}$samba_cv_HAVE_SOCK_SIN_LEN" >&6 if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SOCK_SIN_LEN 1 _ACEOF @@ -16129,7 +16209,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_SEEKDIR_RETURNS_VOID" >&5 echo "${ECHO_T}$samba_cv_SEEKDIR_RETURNS_VOID" >&6 if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define SEEKDIR_RETURNS_VOID 1 _ACEOF @@ -16176,7 +16257,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_FILE_MACRO" >&5 echo "${ECHO_T}$samba_cv_HAVE_FILE_MACRO" >&6 if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_FILE_MACRO 1 _ACEOF @@ -16223,7 +16305,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_FUNCTION_MACRO" >&5 echo "${ECHO_T}$samba_cv_HAVE_FUNCTION_MACRO" >&6 if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_FUNCTION_MACRO 1 _ACEOF @@ -16271,7 +16354,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_GETTIMEOFDAY_TZ" >&5 echo "${ECHO_T}$samba_cv_HAVE_GETTIMEOFDAY_TZ" >&6 if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_GETTIMEOFDAY_TZ 1 _ACEOF @@ -16319,7 +16403,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_VA_COPY" >&5 echo "${ECHO_T}$samba_cv_HAVE_VA_COPY" >&6 if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_VA_COPY 1 _ACEOF @@ -16387,7 +16472,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_C99_VSNPRINTF" >&5 echo "${ECHO_T}$samba_cv_HAVE_C99_VSNPRINTF" >&6 if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_C99_VSNPRINTF 1 _ACEOF @@ -16436,7 +16522,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_BROKEN_READDIR" >&5 echo "${ECHO_T}$samba_cv_HAVE_BROKEN_READDIR" >&6 if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_BROKEN_READDIR 1 _ACEOF @@ -16484,7 +16571,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UTIMBUF" >&5 echo "${ECHO_T}$samba_cv_HAVE_UTIMBUF" >&6 if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UTIMBUF 1 _ACEOF @@ -16608,7 +16696,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UT_UT_NAME" >&5 echo "${ECHO_T}$samba_cv_HAVE_UT_UT_NAME" >&6 if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UT_UT_NAME 1 _ACEOF @@ -16656,7 +16745,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UT_UT_USER" >&5 echo "${ECHO_T}$samba_cv_HAVE_UT_UT_USER" >&6 if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UT_UT_USER 1 _ACEOF @@ -16704,7 +16794,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UT_UT_ID" >&5 echo "${ECHO_T}$samba_cv_HAVE_UT_UT_ID" >&6 if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UT_UT_ID 1 _ACEOF @@ -16752,7 +16843,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UT_UT_HOST" >&5 echo "${ECHO_T}$samba_cv_HAVE_UT_UT_HOST" >&6 if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UT_UT_HOST 1 _ACEOF @@ -16800,7 +16892,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UT_UT_TIME" >&5 echo "${ECHO_T}$samba_cv_HAVE_UT_UT_TIME" >&6 if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UT_UT_TIME 1 _ACEOF @@ -16848,7 +16941,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UT_UT_TV" >&5 echo "${ECHO_T}$samba_cv_HAVE_UT_UT_TV" >&6 if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UT_UT_TV 1 _ACEOF @@ -16896,7 +16990,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UT_UT_TYPE" >&5 echo "${ECHO_T}$samba_cv_HAVE_UT_UT_TYPE" >&6 if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UT_UT_TYPE 1 _ACEOF @@ -16944,7 +17039,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UT_UT_PID" >&5 echo "${ECHO_T}$samba_cv_HAVE_UT_UT_PID" >&6 if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UT_UT_PID 1 _ACEOF @@ -16992,7 +17088,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UT_UT_EXIT" >&5 echo "${ECHO_T}$samba_cv_HAVE_UT_UT_EXIT" >&6 if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UT_UT_EXIT 1 _ACEOF @@ -17040,7 +17137,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UT_UT_ADDR" >&5 echo "${ECHO_T}$samba_cv_HAVE_UT_UT_ADDR" >&6 if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UT_UT_ADDR 1 _ACEOF @@ -17089,7 +17187,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_PUTUTLINE_RETURNS_UTMP" >&5 echo "${ECHO_T}$samba_cv_PUTUTLINE_RETURNS_UTMP" >&6 if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define PUTUTLINE_RETURNS_UTMP 1 _ACEOF @@ -17138,7 +17237,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UX_UT_SYSLEN" >&5 echo "${ECHO_T}$samba_cv_HAVE_UX_UT_SYSLEN" >&6 if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UX_UT_SYSLEN 1 _ACEOF @@ -17222,7 +17322,8 @@ _ACEOF fi - cat >>confdefs.h <<_ACEOF + +cat >>confdefs.h <<_ACEOF #define WITH_LIBICONV "${withval}" _ACEOF @@ -17283,7 +17384,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_NATIVE_ICONV" >&5 echo "${ECHO_T}$samba_cv_HAVE_NATIVE_ICONV" >&6 if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_NATIVE_ICONV 1 _ACEOF @@ -17339,7 +17441,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" >&5 echo "${ECHO_T}$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" >&6 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_KERNEL_OPLOCKS_LINUX 1 _ACEOF @@ -17394,7 +17497,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" >&5 echo "${ECHO_T}$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" >&6 if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_KERNEL_CHANGE_NOTIFY 1 _ACEOF @@ -17451,7 +17555,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_KERNEL_SHARE_MODES" >&5 echo "${ECHO_T}$samba_cv_HAVE_KERNEL_SHARE_MODES" >&6 if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_KERNEL_SHARE_MODES 1 _ACEOF @@ -17502,7 +17607,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" >&5 echo "${ECHO_T}$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" >&6 if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_KERNEL_OPLOCKS_IRIX 1 _ACEOF @@ -17558,7 +17664,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" >&5 echo "${ECHO_T}$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" >&6 if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_IRIX_SPECIFIC_CAPABILITIES 1 _ACEOF @@ -17613,7 +17720,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_INT16_FROM_RPC_RPC_H" >&5 echo "${ECHO_T}$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" >&6 if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_INT16_FROM_RPC_RPC_H 1 _ACEOF @@ -17663,7 +17771,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" >&5 echo "${ECHO_T}$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" >&6 if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UINT16_FROM_RPC_RPC_H 1 _ACEOF @@ -17713,7 +17822,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_INT32_FROM_RPC_RPC_H" >&5 echo "${ECHO_T}$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" >&6 if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_INT32_FROM_RPC_RPC_H 1 _ACEOF @@ -17763,7 +17873,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" >&5 echo "${ECHO_T}$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" >&6 if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UINT32_FROM_RPC_RPC_H 1 _ACEOF @@ -17818,7 +17929,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" >&5 echo "${ECHO_T}$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" >&6 if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_RPC_AUTH_ERROR_CONFLICT 1 _ACEOF @@ -17899,7 +18011,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_FTRUNCATE_EXTEND" >&5 echo "${ECHO_T}$samba_cv_HAVE_FTRUNCATE_EXTEND" >&6 if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_FTRUNCATE_EXTEND 1 _ACEOF @@ -17991,7 +18104,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_BROKEN_GETGROUPS" >&5 echo "${ECHO_T}$samba_cv_HAVE_BROKEN_GETGROUPS" >&6 if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_BROKEN_GETGROUPS 1 _ACEOF @@ -18048,7 +18162,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_REPLACE_GETPASS" >&5 echo "${ECHO_T}$samba_cv_REPLACE_GETPASS" >&6 if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define REPLACE_GETPASS 1 _ACEOF @@ -18103,7 +18218,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_REPLACE_INET_NTOA" >&5 echo "${ECHO_T}$samba_cv_REPLACE_INET_NTOA" >&6 if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define REPLACE_INET_NTOA 1 _ACEOF @@ -18161,7 +18277,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_SECURE_MKSTEMP" >&5 echo "${ECHO_T}$samba_cv_HAVE_SECURE_MKSTEMP" >&6 if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SECURE_MKSTEMP 1 _ACEOF @@ -18207,7 +18324,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_SYSCONF_SC_NGROUPS_MAX" >&5 echo "${ECHO_T}$samba_cv_SYSCONF_SC_NGROUPS_MAX" >&6 if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define SYSCONF_SC_NGROUPS_MAX 1 _ACEOF @@ -18252,7 +18370,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_ROOT" >&5 echo "${ECHO_T}$samba_cv_HAVE_ROOT" >&6 if test x"$samba_cv_HAVE_ROOT" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_ROOT 1 _ACEOF @@ -18307,7 +18426,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_IFACE_AIX" >&5 echo "${ECHO_T}$samba_cv_HAVE_IFACE_AIX" >&6 if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then - iface=yes;cat >>confdefs.h <<\_ACEOF + iface=yes; +cat >>confdefs.h <<\_ACEOF #define HAVE_IFACE_AIX 1 _ACEOF @@ -18357,7 +18477,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_IFACE_IFCONF" >&5 echo "${ECHO_T}$samba_cv_HAVE_IFACE_IFCONF" >&6 if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then - iface=yes;cat >>confdefs.h <<\_ACEOF + iface=yes; +cat >>confdefs.h <<\_ACEOF #define HAVE_IFACE_IFCONF 1 _ACEOF @@ -18408,7 +18529,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_IFACE_IFREQ" >&5 echo "${ECHO_T}$samba_cv_HAVE_IFACE_IFREQ" >&6 if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then - iface=yes;cat >>confdefs.h <<\_ACEOF + iface=yes; +cat >>confdefs.h <<\_ACEOF #define HAVE_IFACE_IFREQ 1 _ACEOF @@ -18463,7 +18585,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_USE_SETRESUID" >&5 echo "${ECHO_T}$samba_cv_USE_SETRESUID" >&6 if test x"$samba_cv_USE_SETRESUID" = x"yes"; then - seteuid=yes;cat >>confdefs.h <<\_ACEOF + seteuid=yes; +cat >>confdefs.h <<\_ACEOF #define USE_SETRESUID 1 _ACEOF @@ -18515,7 +18638,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_USE_SETREUID" >&5 echo "${ECHO_T}$samba_cv_USE_SETREUID" >&6 if test x"$samba_cv_USE_SETREUID" = x"yes"; then - seteuid=yes;cat >>confdefs.h <<\_ACEOF + seteuid=yes; +cat >>confdefs.h <<\_ACEOF #define USE_SETREUID 1 _ACEOF @@ -18566,7 +18690,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_USE_SETEUID" >&5 echo "${ECHO_T}$samba_cv_USE_SETEUID" >&6 if test x"$samba_cv_USE_SETEUID" = x"yes"; then - seteuid=yes;cat >>confdefs.h <<\_ACEOF + seteuid=yes; +cat >>confdefs.h <<\_ACEOF #define USE_SETEUID 1 _ACEOF @@ -18617,7 +18742,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_USE_SETUIDX" >&5 echo "${ECHO_T}$samba_cv_USE_SETUIDX" >&6 if test x"$samba_cv_USE_SETUIDX" = x"yes"; then - seteuid=yes;cat >>confdefs.h <<\_ACEOF + seteuid=yes; +cat >>confdefs.h <<\_ACEOF #define USE_SETUIDX 1 _ACEOF @@ -18664,7 +18790,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_MMAP" >&5 echo "${ECHO_T}$samba_cv_HAVE_MMAP" >&6 if test x"$samba_cv_HAVE_MMAP" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF @@ -18709,7 +18836,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_FTRUNCATE_NEEDS_ROOT" >&5 echo "${ECHO_T}$samba_cv_FTRUNCATE_NEEDS_ROOT" >&6 if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define FTRUNCATE_NEEDS_ROOT 1 _ACEOF @@ -18754,7 +18882,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_FCNTL_LOCK" >&5 echo "${ECHO_T}$samba_cv_HAVE_FCNTL_LOCK" >&6 if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_FCNTL_LOCK 1 _ACEOF @@ -18799,7 +18928,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" >&5 echo "${ECHO_T}$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" >&6 if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_BROKEN_FCNTL64_LOCKS 1 _ACEOF @@ -18867,7 +18997,8 @@ echo "$as_me:$LINENO: result: $samba_cv_HAVE_STRUCT_FLOCK64" >&5 echo "${ECHO_T}$samba_cv_HAVE_STRUCT_FLOCK64" >&6 if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_FLOCK64 1 _ACEOF @@ -18917,7 +19048,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_STAT_ST_BLOCKS" >&5 echo "${ECHO_T}$samba_cv_HAVE_STAT_ST_BLOCKS" >&6 if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_STAT_ST_BLOCKS 1 _ACEOF @@ -18966,7 +19098,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_STAT_ST_BLKSIZE" >&5 echo "${ECHO_T}$samba_cv_HAVE_STAT_ST_BLKSIZE" >&6 if test x"$samba_cv_HAVE_STAT_ST_BLKSIZE" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_STAT_ST_BLKSIZE 1 _ACEOF @@ -19022,7 +19155,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" >&5 echo "${ECHO_T}$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" >&6 if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define BROKEN_REDHAT_7_SYSTEM_HEADERS 1 _ACEOF @@ -19074,7 +19208,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" >&5 echo "${ECHO_T}$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" >&6 if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define BROKEN_NISPLUS_INCLUDE_FILES 1 _ACEOF @@ -19093,7 +19228,8 @@ if test "${with_smbwrapper+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_SMBWRAPPER 1 _ACEOF @@ -19144,7 +19280,8 @@ if test "${with_afs+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_AFS 1 _ACEOF @@ -19173,7 +19310,8 @@ if test "${with_dfs+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_DFS 1 _ACEOF @@ -19208,7 +19346,8 @@ if test "${with_ads+set}" = set; then fi; if test x"$with_ads_support" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_ADS 1 _ACEOF @@ -19667,7 +19806,8 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_krb5_krb5_mk_req_extended" >&5 echo "${ECHO_T}$ac_cv_lib_krb5_krb5_mk_req_extended" >&6 if test $ac_cv_lib_krb5_krb5_mk_req_extended = yes; then LIBS="$LIBS -lkrb5"; - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_KRB5 1 _ACEOF @@ -19727,7 +19867,8 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_gssapi_krb5_gss_display_status" >&5 echo "${ECHO_T}$ac_cv_lib_gssapi_krb5_gss_display_status" >&6 if test $ac_cv_lib_gssapi_krb5_gss_display_status = yes; then LIBS="$LIBS -lgssapi_krb5"; - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_GSSAPI 1 _ACEOF @@ -19869,7 +20010,8 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_domain2hostlist" >&5 echo "${ECHO_T}$ac_cv_lib_ldap_ldap_domain2hostlist" >&6 if test $ac_cv_lib_ldap_ldap_domain2hostlist = yes; then LIBS="$LIBS -lldap"; - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LDAP 1 _ACEOF @@ -19991,7 +20133,8 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $pam_ldap_cv_ldap_set_rebind_proc" >&5 echo "${ECHO_T}$pam_ldap_cv_ldap_set_rebind_proc" >&6 - cat >>confdefs.h <<_ACEOF + +cat >>confdefs.h <<_ACEOF #define LDAP_SET_REBIND_PROC_ARGS $pam_ldap_cv_ldap_set_rebind_proc _ACEOF @@ -20010,7 +20153,8 @@ if test "${with_automount+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_AUTOMOUNT 1 _ACEOF @@ -20040,7 +20184,8 @@ if test "${with_smbmount+set}" = set; then *linux*) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_SMBMOUNT 1 _ACEOF @@ -20080,7 +20225,8 @@ if test "${with_pam+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_PAM 1 _ACEOF @@ -20149,7 +20295,8 @@ fi echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_get_data" >&5 echo "${ECHO_T}$ac_cv_lib_pam_pam_get_data" >&6 if test $ac_cv_lib_pam_pam_get_data = yes; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LIBPAM 1 _ACEOF @@ -20321,7 +20468,8 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6 if test $ac_cv_lib_crypt_crypt = yes; then AUTHLIBS="$AUTHLIBS -lcrypt"; - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_CRYPT 1 _ACEOF @@ -20379,7 +20527,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_TRUNCATED_SALT" >&5 echo "${ECHO_T}$samba_cv_HAVE_TRUNCATED_SALT" >&6 if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_TRUNCATED_SALT 1 _ACEOF @@ -20398,7 +20547,8 @@ if test "${with_sam+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_SAM 1 _ACEOF @@ -20433,7 +20583,8 @@ if test "${with_ldapsam+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_LDAP_SAMCONFIG 1 _ACEOF @@ -20461,7 +20612,8 @@ if test "${with_tdbsam+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_TDB_SAM 1 _ACEOF @@ -20489,7 +20641,8 @@ if test "${with_nisplussam+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_NISPLUS_SAM 1 _ACEOF @@ -20523,7 +20676,8 @@ if test "${with_nisplus_home+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_NISPLUS_HOME 1 _ACEOF @@ -20551,7 +20705,8 @@ if test "${with_syslog+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_SYSLOG 1 _ACEOF @@ -20579,7 +20734,8 @@ if test "${with_profiling_data+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_PROFILE 1 _ACEOF @@ -20659,12 +20815,14 @@ fi echo "$as_me:$LINENO: result: $samba_cv_linux_2_4_quota_braindamage" >&5 echo "${ECHO_T}$samba_cv_linux_2_4_quota_braindamage" >&6 if test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define LINUX_QUOTAS_2 1 _ACEOF else - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define LINUX_QUOTAS_1 1 _ACEOF @@ -20674,7 +20832,8 @@ fi ;; esac QUOTAOBJS=smbd/quotas.o - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_QUOTAS 1 _ACEOF @@ -20704,7 +20863,8 @@ if test "${with_utmp+set}" = set; then yes) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_UTMP 1 _ACEOF @@ -20844,7 +21004,8 @@ echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statvfs64" >&5 echo "${ECHO_T}$fu_cv_sys_stat_statvfs64" >&6 if test $fu_cv_sys_stat_statvfs64 = yes; then space=yes - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_STATVFS64 1 _ACEOF @@ -20901,7 +21062,8 @@ echo "$as_me:$LINENO: result: $fu_cv_sys_stat_statvfs" >&5 echo "${ECHO_T}$fu_cv_sys_stat_statvfs" >&6 if test $fu_cv_sys_stat_statvfs = yes; then space=yes - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_STATVFS 1 _ACEOF @@ -20959,7 +21121,8 @@ fi echo "${ECHO_T}$fu_cv_sys_stat_statfs3_osf1" >&6 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then space=yes - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_STATFS3_OSF1 1 _ACEOF @@ -21023,7 +21186,8 @@ fi echo "${ECHO_T}$fu_cv_sys_stat_statfs2_bsize" >&6 if test $fu_cv_sys_stat_statfs2_bsize = yes; then space=yes - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_STATFS2_BSIZE 1 _ACEOF @@ -21078,7 +21242,8 @@ fi echo "${ECHO_T}$fu_cv_sys_stat_statfs4" >&6 if test $fu_cv_sys_stat_statfs4 = yes; then space=yes - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_STATFS4 1 _ACEOF @@ -21139,7 +21304,8 @@ fi echo "${ECHO_T}$fu_cv_sys_stat_statfs2_fsize" >&6 if test $fu_cv_sys_stat_statfs2_fsize = yes; then space=yes - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_STATFS2_FSIZE 1 _ACEOF @@ -21204,7 +21370,8 @@ fi echo "${ECHO_T}$fu_cv_sys_stat_fs_data" >&6 if test $fu_cv_sys_stat_fs_data = yes; then space=yes - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define STAT_STATFS2_FS_DATA 1 _ACEOF @@ -21259,7 +21426,8 @@ samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_EXPLICIT_LARGEFILE_SUPPORT 1 _ACEOF @@ -21274,35 +21442,40 @@ if test "${with_spinlocks+set}" = set; then fi; if test "x$with_spinlocks" = "xyes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define USE_SPINLOCKS 1 _ACEOF case "$host_cpu" in sparc) - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define SPARC_SPINLOCKS 1 _ACEOF ;; i386|i486|i586|i686) - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define INTEL_SPINLOCKS 1 _ACEOF ;; mips) - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define MIPS_SPINLOCKS 1 _ACEOF ;; powerpc) - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define POWERPC_SPINLOCKS 1 _ACEOF @@ -21326,7 +21499,8 @@ if test "${with_acl_support+set}" = set; then *sysv5*) echo "$as_me:$LINENO: result: Using UnixWare ACLs" >&5 echo "${ECHO_T}Using UnixWare ACLs" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_UNIXWARE_ACLS 1 _ACEOF @@ -21334,7 +21508,8 @@ _ACEOF *solaris*) echo "$as_me:$LINENO: result: Using solaris ACLs" >&5 echo "${ECHO_T}Using solaris ACLs" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SOLARIS_ACLS 1 _ACEOF @@ -21342,7 +21517,8 @@ _ACEOF *hpux*) echo "$as_me:$LINENO: result: Using HPUX ACLs" >&5 echo "${ECHO_T}Using HPUX ACLs" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_HPUX_ACLS 1 _ACEOF @@ -21350,7 +21526,8 @@ _ACEOF *irix*) echo "$as_me:$LINENO: result: Using IRIX ACLs" >&5 echo "${ECHO_T}Using IRIX ACLs" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_IRIX_ACLS 1 _ACEOF @@ -21358,7 +21535,8 @@ _ACEOF *aix*) echo "$as_me:$LINENO: result: Using AIX ACLs" >&5 echo "${ECHO_T}Using AIX ACLs" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_AIX_ACLS 1 _ACEOF @@ -21366,7 +21544,8 @@ _ACEOF *osf*) echo "$as_me:$LINENO: result: Using Tru64 ACLs" >&5 echo "${ECHO_T}Using Tru64 ACLs" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_TRU64_ACLS 1 _ACEOF @@ -21476,7 +21655,8 @@ echo "${ECHO_T}$samba_cv_HAVE_POSIX_ACLS" >&6 if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then echo "$as_me:$LINENO: result: Using posix ACLs" >&5 echo "${ECHO_T}Using posix ACLs" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_POSIX_ACLS 1 _ACEOF @@ -21522,7 +21702,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_ACL_GET_PERM_NP" >&5 echo "${ECHO_T}$samba_cv_HAVE_ACL_GET_PERM_NP" >&6 if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_ACL_GET_PERM_NP 1 _ACEOF @@ -21534,14 +21715,16 @@ _ACEOF *) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_NO_ACLS 1 _ACEOF ;; esac else - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_NO_ACLS 1 _ACEOF @@ -21712,37 +21895,45 @@ echo "$as_me:$LINENO: result: $samba_cv_HAVE_BROKEN_LINUX_SENDFILE" >&5 echo "${ECHO_T}$samba_cv_HAVE_BROKEN_LINUX_SENDFILE" >&6 if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SENDFILE64 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define LINUX_SENDFILE_API 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_SENDFILE 1 _ACEOF elif test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SENDFILE 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define LINUX_SENDFILE_API 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_SENDFILE 1 _ACEOF elif test x"$samba_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define LINUX_BROKEN_SENDFILE_API 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_SENDFILE 1 _ACEOF @@ -21810,15 +22001,18 @@ echo "$as_me:$LINENO: result: $samba_cv_HAVE_SENDFILE" >&5 echo "${ECHO_T}$samba_cv_HAVE_SENDFILE" >&6 if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SENDFILE 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define FREEBSD_SENDFILE_API 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_SENDFILE 1 _ACEOF @@ -21883,15 +22077,18 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_SENDFILE64" >&5 echo "${ECHO_T}$samba_cv_HAVE_SENDFILE64" >&6 if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SENDFILE64 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HPUX_SENDFILE_API 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_SENDFILE 1 _ACEOF @@ -21954,15 +22151,18 @@ fi echo "$as_me:$LINENO: result: $samba_cv_HAVE_SENDFILE" >&5 echo "${ECHO_T}$samba_cv_HAVE_SENDFILE" >&6 if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SENDFILE 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HPUX_SENDFILE_API 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_SENDFILE 1 _ACEOF @@ -22036,15 +22236,18 @@ echo "$as_me:$LINENO: result: $samba_cv_HAVE_SENDFILEV64" >&5 echo "${ECHO_T}$samba_cv_HAVE_SENDFILEV64" >&6 if test x"$samba_cv_HAVE_SENDFILEV64" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SENDFILEV64 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define SOLARIS_SENDFILE_API 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_SENDFILE 1 _ACEOF @@ -22115,15 +22318,18 @@ echo "$as_me:$LINENO: result: $samba_cv_HAVE_SENDFILEV" >&5 echo "${ECHO_T}$samba_cv_HAVE_SENDFILEV" >&6 if test x"$samba_cv_HAVE_SENDFILEV" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_SENDFILEV 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define SOLARIS_SENDFILE_API 1 _ACEOF - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_SENDFILE 1 _ACEOF @@ -22215,7 +22421,8 @@ WINBIND_PAM_PROGS="" if test x"$HAVE_WINBIND" = x"yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define WITH_WINBIND 1 _ACEOF @@ -22293,7 +22500,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_passwd_pw_comment" >&5 echo "${ECHO_T}$samba_cv_passwd_pw_comment" >&6 if test x"$samba_cv_passwd_pw_comment" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_PASSWD_PW_COMMENT 1 _ACEOF @@ -22344,7 +22552,8 @@ fi echo "$as_me:$LINENO: result: $samba_cv_passwd_pw_age" >&5 echo "${ECHO_T}$samba_cv_passwd_pw_age" >&6 if test x"$samba_cv_passwd_pw_age" = x"yes"; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_PASSWD_PW_AGE 1 _ACEOF diff --git a/source3/configure.in b/source3/configure.in index 6f50314cf1..206a9edb50 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -205,7 +205,7 @@ AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [ AC_TRY_COMPILE([#include ],[volatile int i = 0], samba_cv_volatile=yes,samba_cv_volatile=no)]) if test x"$samba_cv_volatile" = x"yes"; then - AC_DEFINE(HAVE_VOLATILE) + AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile]) fi @@ -231,7 +231,7 @@ case "$host_os" in AC_PROG_CC_FLAG(Ae) # mmap on HPUX is completely broken... - AC_DEFINE(MMAP_BLACKLIST) + AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken]) if test $ac_cv_prog_cc_Ae = yes; then CPPFLAGS="$CPPFLAGS -Ae" fi @@ -243,20 +243,20 @@ case "$host_os" in case `uname -r` in *9*|*10*) CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4" - AC_DEFINE(USE_BOTH_CRYPT_CALLS) - AC_DEFINE(_HPUX_SOURCE) - AC_DEFINE(_POSIX_SOURCE) - AC_DEFINE(_ALIGNMENT_REQUIRED,1) - AC_DEFINE(_MAX_ALIGNMENT,4) + AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls]) + AC_DEFINE(_HPUX_SOURCE, 1, [Whether to use HPUX extensions]) + AC_DEFINE(_POSIX_SOURCE, 1, [Whether to use POSIX compatible functions]) + AC_DEFINE(_ALIGNMENT_REQUIRED,1,[Required alignment]) + AC_DEFINE(_MAX_ALIGNMENT,4,[Maximum alignment]) ;; *11*) CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4" - AC_DEFINE(USE_BOTH_CRYPT_CALLS) - AC_DEFINE(_HPUX_SOURCE) - AC_DEFINE(_POSIX_SOURCE) - AC_DEFINE(_LARGEFILE64_SOURCE) - AC_DEFINE(_ALIGNMENT_REQUIRED,1) - AC_DEFINE(_MAX_ALIGNMENT,4) + AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls]) + AC_DEFINE(_HPUX_SOURCE, 1, [Whether to use HPUX extensions]) + AC_DEFINE(_POSIX_SOURCE, 1, [Whether to use POSIX compatible functions]) + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to use large file support]) + AC_DEFINE(_ALIGNMENT_REQUIRED, 1, [Required alignment]) + AC_DEFINE(_MAX_ALIGNMENT, 4, [Maximum alignment]) ;; esac DYNEXP="-Wl,-E" @@ -276,7 +276,7 @@ case "$host_os" in *aix4*) AC_MSG_RESULT([enabling large file support]) CPPFLAGS="$CPPFLAGS -D_LARGE_FILES" - AC_DEFINE(_LARGE_FILES) + AC_DEFINE(_LARGE_FILES, 1, [Whether to enable large file support]) ;; # # Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit @@ -300,18 +300,18 @@ case "$host_os" in case "$ac_cv_gcc_compiler_version_number" in *"gcc version 2.6"*|*"gcc version 2.7"*) CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" - AC_DEFINE(_LARGEFILE64_SOURCE) + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) ;; *) CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" - AC_DEFINE(_LARGEFILE64_SOURCE) - AC_DEFINE(_FILE_OFFSET_BITS,64) + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) + AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits]) ;; esac else CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" - AC_DEFINE(_LARGEFILE64_SOURCE) - AC_DEFINE(_FILE_OFFSET_BITS,64) + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) + AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits]) fi ;; esac @@ -336,7 +336,7 @@ exit(1); CPPFLAGS="$old_CPPFLAGS" if test x$SINIX_LFS_SUPPORT = xyes ; then CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS" - AC_DEFINE(_LARGEFILE64_SOURCE) + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS" LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS" LIBS="`getconf LFS64_LIBS` $LIBS" @@ -389,9 +389,9 @@ main() { CPPFLAGS="$old_CPPFLAGS" if test x$LINUX_LFS_SUPPORT = xyes ; then CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS" - AC_DEFINE(_LARGEFILE64_SOURCE) - AC_DEFINE(_FILE_OFFSET_BITS,64) - AC_DEFINE(_GNU_SOURCE) + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) + AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits]) + AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions]) fi AC_MSG_RESULT([$LINUX_LFS_SUPPORT]) ;; @@ -412,8 +412,8 @@ exit(1); CPPFLAGS="$old_CPPFLAGS" if test x$GLIBC_LFS_SUPPORT = xyes ; then CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS" - AC_DEFINE(_LARGEFILE64_SOURCE) - AC_DEFINE(_GNU_SOURCE) + AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support]) + AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions]) fi AC_MSG_RESULT([$GLIBC_LFS_SUPPORT]) ;; @@ -444,7 +444,7 @@ case "$host_os" in AC_TRY_COMPILE([#include ],[struct spwd testme], ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no) if test x"$ac_cv_header_shadow_h" = x"yes"; then - AC_DEFINE(HAVE_SHADOW_H) + AC_DEFINE(HAVE_SHADOW_H,1,[Whether we have shadow.h]) fi ;; esac @@ -496,7 +496,7 @@ if test x$enable_cups != xno; then AC_PATH_PROG(CUPS_CONFIG, cups-config) if test "x$CUPS_CONFIG" != x; then - AC_DEFINE(HAVE_CUPS) + AC_DEFINE(HAVE_CUPS,1,[Whether we have CUPS]) CFLAGS="$CFLAGS `$CUPS_CONFIG --cflags`" LDFLAGS="$LDFLAGS `$CUPS_CONFIG --ldflags`" PRINTLIBS="$PRINTLIBS `$CUPS_CONFIG --libs`" @@ -504,11 +504,11 @@ if test x$enable_cups != xno; then fi ############################################ -# we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the new VFS code +# we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code AC_CHECK_FUNCS(dlopen) if test x"$ac_cv_func_dlopen" = x"no"; then AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"; - AC_DEFINE(HAVE_DLOPEN)]) + AC_DEFINE(HAVE_DLOPEN,1,[Whether we have dlopen()])]) fi # dlopen/dlclose/dlsym/dlerror will be checked again later and defines will be set then @@ -530,7 +530,7 @@ AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [ ], samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)]) if test x"$samba_cv_immediate_structures" = x"yes"; then - AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES) + AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures]) fi ############################################ @@ -548,7 +548,7 @@ AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [ ], samba_cv_unixsocket=yes,samba_cv_unixsocket=no)]) if test x"$samba_cv_unixsocket" = x"yes"; then - AC_DEFINE(HAVE_UNIXSOCKET) + AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support]) fi @@ -562,7 +562,7 @@ AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [ #include ],[socklen_t i = 0], samba_cv_socklen_t=yes,samba_cv_socklen_t=no)]) if test x"$samba_cv_socklen_t" = x"yes"; then - AC_DEFINE(HAVE_SOCKLEN_T_TYPE) + AC_DEFINE(HAVE_SOCKLEN_T_TYPE,1,[Whether we have the variable type socklen_t]) fi AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [ @@ -575,7 +575,7 @@ AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [ #include ],[sig_atomic_t i = 0], samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)]) if test x"$samba_cv_sig_atomic_t" = x"yes"; then - AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE) + AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type]) fi # stupid headers have the functions but no declaration. grrrr. @@ -594,7 +594,7 @@ AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[ main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}], samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)]) if test x"$samba_cv_have_setresuid" = x"yes"; then - AC_DEFINE(HAVE_SETRESUID) + AC_DEFINE(HAVE_SETRESUID,1,[Whether the system has setresuid]) fi # Do the same check for setresguid... @@ -605,7 +605,7 @@ AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[ main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}], samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)]) if test x"$samba_cv_have_setresgid" = x"yes"; then - AC_DEFINE(HAVE_SETRESGID) + AC_DEFINE(HAVE_SETRESGID,1,[Whether the system has setresgid]) fi AC_FUNC_MEMCMP @@ -615,7 +615,7 @@ AC_FUNC_MEMCMP AC_CHECK_FUNCS(crypt) if test x"$ac_cv_func_crypt" = x"no"; then AC_CHECK_LIB(crypt, crypt, [AUTHLIBS="$AUTHLIBS -lcrypt"; - AC_DEFINE(HAVE_CRYPT)]) + AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function])]) fi @@ -640,7 +640,7 @@ AC_ARG_WITH(readline, done AC_CHECK_LIB(readline, rl_callback_handler_install, [TERMLIBS="-lreadline $TERMLIBS" - AC_DEFINE(HAVE_LIBREADLINE) + AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline]) break], [TERMLIBS=], $TERMLIBS)]) ;; no) @@ -670,7 +670,7 @@ AC_ARG_WITH(readline, TERMCPPFLAGS="-I$with_readline/include" CPPFLAGS="-I$with_readline/include $CPPFLAGS" TERMLIBS="-lreadline $TERMLIBS" - AC_DEFINE(HAVE_LIBREADLINE) + AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline]) break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)]) LDFLAGS=$_ldflags @@ -720,7 +720,7 @@ if test x"$ac_cv_func_connect" = x"no"; then test x"$ac_cv_lib_inet_connect" = x"yes"; then # ac_cv_func_connect=yes # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run - AC_DEFINE(HAVE_CONNECT) + AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()]) fi fi @@ -729,7 +729,7 @@ fi AC_CHECK_FUNCS(yp_get_default_domain) if test x"$ac_cv_func_yp_get_default_domain" = x"no"; then AC_CHECK_LIB(nsl, yp_get_default_domain, [LIBS="$LIBS -lnsl"; - AC_DEFINE(HAVE_YP_GET_DEFAULT_DOMAIN)]) + AC_DEFINE(HAVE_YP_GET_DEFAULT_DOMAIN,1,[Whether the system has yp_get_default_domain()])]) fi # Check if we have execl, if not we need to compile smbrun. @@ -785,7 +785,7 @@ if test x$ac_cv_func_stat64 = xno ; then ], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes]) AC_MSG_RESULT([$ac_cv_func_stat64]) if test x$ac_cv_func_stat64 = xyes ; then - AC_DEFINE(HAVE_STAT64) + AC_DEFINE(HAVE_STAT64,1,[Whether stat64() is available]) fi fi @@ -799,7 +799,7 @@ if test x$ac_cv_func_lstat64 = xno ; then ], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes]) AC_MSG_RESULT([$ac_cv_func_lstat64]) if test x$ac_cv_func_lstat64 = xyes ; then - AC_DEFINE(HAVE_LSTAT64) + AC_DEFINE(HAVE_LSTAT64,[Whether lstat64() is available]) fi fi @@ -813,7 +813,7 @@ if test x$ac_cv_func_fstat64 = xno ; then ], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes]) AC_MSG_RESULT([$ac_cv_func_fstat64]) if test x$ac_cv_func_fstat64 = xyes ; then - AC_DEFINE(HAVE_FSTAT64) + AC_DEFINE(HAVE_FSTAT64,1,[Whether fstat64() is available]) fi fi @@ -864,7 +864,7 @@ AC_MSG_CHECKING([ability to build shared libraries]) # and these are for particular systems case "$host_os" in - *linux*) AC_DEFINE(LINUX) + *linux*) AC_DEFINE(LINUX,1,[Whether the host os is linux]) BLDSHARED="true" LDSHFLAGS="-shared" DYNEXP="-Wl,--export-dynamic" @@ -872,7 +872,7 @@ case "$host_os" in SONAMEFLAG="-Wl,-soname=" AC_DEFINE(STAT_ST_BLOCKSIZE,512) ;; - *solaris*) AC_DEFINE(SUNOS5) + *solaris*) AC_DEFINE(SUNOS5,1,[Whether the host os is solaris]) BLDSHARED="true" LDSHFLAGS="-G" SONAMEFLAG="-h " @@ -889,9 +889,9 @@ case "$host_os" in POBAD_CC="" PICSUFFIX="po.o" fi - AC_DEFINE(STAT_ST_BLOCKSIZE,512) + AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) ;; - *sunos*) AC_DEFINE(SUNOS4) + *sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4]) BLDSHARED="true" LDSHFLAGS="-G" SONAMEFLAG="-Wl,-h," @@ -902,18 +902,18 @@ case "$host_os" in DYNEXP="-Wl,--export-dynamic" SONAMEFLAG="-Wl,-soname," PICFLAG="-fPIC -DPIC" - AC_DEFINE(STAT_ST_BLOCKSIZE,512) + AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) ;; *openbsd*) BLDSHARED="true" LDSHFLAGS="-shared" DYNEXP="-Wl,-Bdynamic" SONAMEFLAG="-Wl,-soname," PICFLAG="-fPIC" - AC_DEFINE(STAT_ST_BLOCKSIZE,512) + AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) ;; - *irix*) AC_DEFINE(IRIX) + *irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix]) case "$host_os" in - *irix6*) AC_DEFINE(IRIX6) + *irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6]) ;; esac ATTEMPT_WRAP32_BUILD=yes @@ -926,9 +926,9 @@ case "$host_os" in else PICFLAG="-KPIC" fi - AC_DEFINE(STAT_ST_BLOCKSIZE,512) + AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block]) ;; - *aix*) AC_DEFINE(AIX) + *aix*) AC_DEFINE(AIX,1,[Whether the host os is aix]) BLDSHARED="true" LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry" DYNEXP="-Wl,-brtl,-bexpall" @@ -938,9 +938,9 @@ case "$host_os" in CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000" fi - AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE) + AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE,[The size of a block]) ;; - *hpux*) AC_DEFINE(HPUX) + *hpux*) AC_DEFINE(HPUX,1,[Whether the host os is HPUX]) SHLIBEXT="sl" # Use special PIC flags for the native HP-UX compiler. if test $ac_cv_prog_cc_Ae = yes; then @@ -951,43 +951,42 @@ case "$host_os" in PICFLAG="+z" fi DYNEXP="-Wl,-E" - AC_DEFINE(STAT_ST_BLOCKSIZE,8192) + AC_DEFINE(STAT_ST_BLOCKSIZE,8192,[The size of a block]) ;; - *qnx*) AC_DEFINE(QNX);; - *osf*) AC_DEFINE(OSF1) + *qnx*) AC_DEFINE(QNX,1,[Whether the host os is qnx]);; + *osf*) AC_DEFINE(OSF1,1,[Whether the host os is osf1]) BLDSHARED="true" LDSHFLAGS="-shared" SONAMEFLAG="-Wl,-soname," PICFLAG="-fPIC" ;; - *sco*) AC_DEFINE(SCO);; - *unixware*) AC_DEFINE(UNIXWARE) + *sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix]);; + *unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware]) BLDSHARED="true" LDSHFLAGS="-shared" SONAMEFLAG="-Wl,-soname," PICFLAG="-KPIC" ;; - *next2*) AC_DEFINE(NEXT2);; + *next2*) AC_DEFINE(NEXT2,1,[Whether the host os is NeXT v2]);; *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man]);; - *sysv4*) AC_DEFINE(SYSV) + *sysv4*) AC_DEFINE(SYSV,1,[Whether this is a system V system]) case "$host" in *-univel-*) if [ test "$GCC" != yes ]; then - AC_DEFINE(HAVE_MEMSET) + AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available]) fi LDSHFLAGS="-G" DYNEXP="-Bexport" ;; - *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX);; + *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX,1,[Whether the host os is reliantunix]);; esac ;; - *sysv5*) AC_DEFINE(SYSV) + *sysv5*) AC_DEFINE(SYSV,1,[Whether this is a system V system]) if [ test "$GCC" != yes ]; then - AC_DEFINE(HAVE_MEMSET) + AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available]) fi LDSHFLAGS="-G" ;; - *sysv*) AC_DEFINE(SYSV);; esac AC_SUBST(DYNEXP) AC_MSG_RESULT($BLDSHARED) @@ -1028,7 +1027,7 @@ AC_TRY_RUN([#include main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }], samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)]) if test x"$samba_cv_have_longlong" = x"yes"; then - AC_DEFINE(HAVE_LONGLONG) + AC_DEFINE(HAVE_LONGLONG,1,[Whether the host supports long long's]) fi # @@ -1039,7 +1038,7 @@ AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ AC_TRY_COMPILE([#include ],[long long i = 0x8000000000LL], samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)]) if test x"$samba_cv_compiler_supports_ll" = x"yes"; then - AC_DEFINE(COMPILER_SUPPORTS_LL) + AC_DEFINE(COMPILER_SUPPORTS_LL,1,[Whether the compiler supports the LL prefix on long long integers]) fi @@ -1049,7 +1048,7 @@ AC_TRY_RUN([#include main() { exit((sizeof(off_t) == 8) ? 0 : 1); }], samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)]) if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then - AC_DEFINE(SIZEOF_OFF_T,8) + AC_DEFINE(SIZEOF_OFF_T,8,[The size of the 'off_t' type]) fi AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[ @@ -1062,7 +1061,7 @@ AC_TRY_RUN([ main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }], samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)]) if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then - AC_DEFINE(HAVE_OFF64_T) + AC_DEFINE(HAVE_OFF64_T,1,[Whether off64_t is available]) fi AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[ @@ -1071,7 +1070,7 @@ AC_TRY_RUN([#include main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }], samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)]) if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then - AC_DEFINE(SIZEOF_INO_T,8) + AC_DEFINE(SIZEOF_INO_T,8,[The size of the 'ino_t' type]) fi AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[ @@ -1084,7 +1083,7 @@ AC_TRY_RUN([ main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }], samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)]) if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then - AC_DEFINE(HAVE_INO64_T) + AC_DEFINE(HAVE_INO64_T,1,[Whether the 'ino64_t' type is available]) fi AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[ @@ -1097,7 +1096,7 @@ AC_TRY_RUN([ main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }], samba_cv_HAVE_DEV64_T=yes,samba_cv_HAVE_DEV64_T=no,samba_cv_HAVE_DEV64_T=cross)]) if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then - AC_DEFINE(HAVE_DEV64_T) + AC_DEFINE(HAVE_DEV64_T,1,[Whether the 'dev64_t' type is available]) fi AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[ @@ -1110,7 +1109,7 @@ AC_TRY_COMPILE([ [struct dirent64 de;], samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)]) if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then - AC_DEFINE(HAVE_STRUCT_DIRENT64) + AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Whether the 'dirent64' struct is available]) fi AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[ @@ -1122,7 +1121,7 @@ AC_TRY_RUN([ main() { dev_t dev; int i = major(dev); return 0; }], samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)]) if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then - AC_DEFINE(HAVE_DEVICE_MAJOR_FN) + AC_DEFINE(HAVE_DEVICE_MAJOR_FN,1,[Whether the major macro for dev_t is available]) fi AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[ @@ -1134,7 +1133,7 @@ AC_TRY_RUN([ main() { dev_t dev; int i = minor(dev); return 0; }], samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)]) if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then - AC_DEFINE(HAVE_DEVICE_MINOR_FN) + AC_DEFINE(HAVE_DEVICE_MINOR_FN,1,[Whether the minor macro for dev_t is available]) fi AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[ @@ -1142,7 +1141,7 @@ AC_TRY_RUN([#include main() { char c; c=250; exit((c > 0)?0:1); }], samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)]) if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then - AC_DEFINE(HAVE_UNSIGNED_CHAR) + AC_DEFINE(HAVE_UNSIGNED_CHAR,1,[Whether the 'unsigned char' type is available]) fi AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[ @@ -1152,7 +1151,7 @@ AC_TRY_COMPILE([#include [struct sockaddr_in sock; sock.sin_len = sizeof(sock);], samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)]) if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then - AC_DEFINE(HAVE_SOCK_SIN_LEN) + AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property]) fi AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[ @@ -1161,21 +1160,21 @@ AC_TRY_COMPILE([#include void seekdir(DIR *d, long loc) { return; }],[return 0;], samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)]) if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then - AC_DEFINE(SEEKDIR_RETURNS_VOID) + AC_DEFINE(SEEKDIR_RETURNS_VOID,1,[Whether seekdir returns void]) fi AC_CACHE_CHECK([for __FILE__ macro],samba_cv_HAVE_FILE_MACRO,[ AC_TRY_COMPILE([#include ], [printf("%s\n", __FILE__);], samba_cv_HAVE_FILE_MACRO=yes,samba_cv_HAVE_FILE_MACRO=no)]) if test x"$samba_cv_HAVE_FILE_MACRO" = x"yes"; then - AC_DEFINE(HAVE_FILE_MACRO) + AC_DEFINE(HAVE_FILE_MACRO,1,[Whether there is a __FILE__ macro]) fi AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[ AC_TRY_COMPILE([#include ], [printf("%s\n", __FUNCTION__);], samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)]) if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then - AC_DEFINE(HAVE_FUNCTION_MACRO) + AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro]) fi AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[ @@ -1185,7 +1184,7 @@ AC_TRY_RUN([ main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}], samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)]) if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then - AC_DEFINE(HAVE_GETTIMEOFDAY_TZ) + AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available]) fi AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE_VA_COPY,[ @@ -1193,7 +1192,7 @@ AC_TRY_LINK([#include va_list ap1,ap2;], [__va_copy(ap1,ap2);], samba_cv_HAVE_VA_COPY=yes,samba_cv_HAVE_VA_COPY=no)]) if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then - AC_DEFINE(HAVE_VA_COPY) + AC_DEFINE(HAVE_VA_COPY,1,[Whether __va_copy() is available]) fi AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[ @@ -1223,7 +1222,7 @@ main() { foo("hello"); } ], samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)]) if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then - AC_DEFINE(HAVE_C99_VSNPRINTF) + AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Whether there is a C99 compliant vsnprintf]) fi AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[ @@ -1234,7 +1233,7 @@ if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 && di->d_name[0] == 0) exit(0); exit(1);} ], samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)]) if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then - AC_DEFINE(HAVE_BROKEN_READDIR) + AC_DEFINE(HAVE_BROKEN_READDIR,1,[Whether readdir() is broken]) fi AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[ @@ -1243,7 +1242,7 @@ AC_TRY_COMPILE([#include [struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));], samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)]) if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then - AC_DEFINE(HAVE_UTIMBUF) + AC_DEFINE(HAVE_UTIMBUF,1,[Whether struct utimbuf is available]) fi dnl utmp and utmpx come in many flavours @@ -1259,7 +1258,7 @@ AC_TRY_COMPILE([#include [struct utmp ut; ut.ut_name[0] = 'a';], samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)]) if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then - AC_DEFINE(HAVE_UT_UT_NAME) + AC_DEFINE(HAVE_UT_UT_NAME,1,[Whether the utmp struct has a property ut_name]) fi AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[ @@ -1268,7 +1267,7 @@ AC_TRY_COMPILE([#include [struct utmp ut; ut.ut_user[0] = 'a';], samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)]) if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then - AC_DEFINE(HAVE_UT_UT_USER) + AC_DEFINE(HAVE_UT_UT_USER,1,[Whether the utmp struct has a property ut_user]) fi AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[ @@ -1277,7 +1276,7 @@ AC_TRY_COMPILE([#include [struct utmp ut; ut.ut_id[0] = 'a';], samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)]) if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then - AC_DEFINE(HAVE_UT_UT_ID) + AC_DEFINE(HAVE_UT_UT_ID,1,[Whether the utmp struct has a property ut_id]) fi AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[ @@ -1286,7 +1285,7 @@ AC_TRY_COMPILE([#include [struct utmp ut; ut.ut_host[0] = 'a';], samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)]) if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then - AC_DEFINE(HAVE_UT_UT_HOST) + AC_DEFINE(HAVE_UT_UT_HOST,1,[Whether the utmp struct has a property ut_host]) fi AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[ @@ -1295,7 +1294,7 @@ AC_TRY_COMPILE([#include [struct utmp ut; time_t t; ut.ut_time = t;], samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)]) if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then - AC_DEFINE(HAVE_UT_UT_TIME) + AC_DEFINE(HAVE_UT_UT_TIME,1,[Whether the utmp struct has a property ut_time]) fi AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[ @@ -1304,7 +1303,7 @@ AC_TRY_COMPILE([#include [struct utmp ut; struct timeval tv; ut.ut_tv = tv;], samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)]) if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then - AC_DEFINE(HAVE_UT_UT_TV) + AC_DEFINE(HAVE_UT_UT_TV,1,[Whether the utmp struct has a property ut_tv]) fi AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[ @@ -1313,7 +1312,7 @@ AC_TRY_COMPILE([#include [struct utmp ut; ut.ut_type = 0;], samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)]) if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then - AC_DEFINE(HAVE_UT_UT_TYPE) + AC_DEFINE(HAVE_UT_UT_TYPE,1,[Whether the utmp struct has a property ut_type]) fi AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[ @@ -1322,7 +1321,7 @@ AC_TRY_COMPILE([#include [struct utmp ut; ut.ut_pid = 0;], samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)]) if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then - AC_DEFINE(HAVE_UT_UT_PID) + AC_DEFINE(HAVE_UT_UT_PID,1,[Whether the utmp struct has a property ut_pid]) fi AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[ @@ -1331,7 +1330,7 @@ AC_TRY_COMPILE([#include [struct utmp ut; ut.ut_exit.e_exit = 0;], samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)]) if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then - AC_DEFINE(HAVE_UT_UT_EXIT) + AC_DEFINE(HAVE_UT_UT_EXIT,1,[Whether the utmp struct has a property ut_exit]) fi AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[ @@ -1340,7 +1339,7 @@ AC_TRY_COMPILE([#include [struct utmp ut; ut.ut_addr = 0;], samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)]) if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then - AC_DEFINE(HAVE_UT_UT_ADDR) + AC_DEFINE(HAVE_UT_UT_ADDR,1,[Whether the utmp struct has a property ut_addr]) fi if test x$ac_cv_func_pututline = xyes ; then @@ -1350,7 +1349,7 @@ if test x$ac_cv_func_pututline = xyes ; then [struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);], samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)]) if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then - AC_DEFINE(PUTUTLINE_RETURNS_UTMP) + AC_DEFINE(PUTUTLINE_RETURNS_UTMP,1,[Whether pututline returns pointer]) fi fi @@ -1360,7 +1359,7 @@ AC_TRY_COMPILE([#include [struct utmpx ux; ux.ut_syslen = 0;], samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)]) if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then - AC_DEFINE(HAVE_UX_UT_SYSLEN) + AC_DEFINE(HAVE_UX_UT_SYSLEN,1,[Whether the utmpx struct has a property ut_syslen]) fi @@ -1378,7 +1377,7 @@ AC_ARG_WITH(libiconv, CFLAGS="$CFLAGS -I$withval/include" LDFLAGS="$LDFLAGS -L$withval/lib" AC_CHECK_LIB(iconv, iconv_open) - AC_DEFINE_UNQUOTED(WITH_LIBICONV, "${withval}") + AC_DEFINE_UNQUOTED(WITH_LIBICONV, "${withval}",[Path to iconv]) ;; esac ], AC_MSG_RESULT(no) @@ -1398,7 +1397,7 @@ main() { ], samba_cv_HAVE_NATIVE_ICONV=yes,samba_cv_HAVE_NATIVE_ICONV=no,samba_cv_HAVE_NATIVE_ICONV=cross)]) if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then - AC_DEFINE(HAVE_NATIVE_ICONV) + AC_DEFINE(HAVE_NATIVE_ICONV,1,[Whether to use native iconv]) fi @@ -1416,7 +1415,7 @@ main() { ], samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)]) if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then - AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX) + AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX,1,[Whether to use linux kernel oplocks]) fi AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[ @@ -1433,7 +1432,7 @@ main() { ], samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)]) if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then - AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY) + AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY,1,[Whether kernel notifies changes]) fi AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[ @@ -1452,7 +1451,7 @@ main() { ], samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)]) if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then - AC_DEFINE(HAVE_KERNEL_SHARE_MODES) + AC_DEFINE(HAVE_KERNEL_SHARE_MODES,1,[Whether the kernel supports share modes]) fi @@ -1464,7 +1463,7 @@ AC_TRY_COMPILE([#include [oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;], samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)]) if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then - AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX) + AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX,1,[Whether IRIX kernel oplock type definitions are available]) fi AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[ @@ -1482,7 +1481,7 @@ main() { ], samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)]) if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then - AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES) + AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES,1,[Whether IRIX specific capabilities are available]) fi # @@ -1498,7 +1497,7 @@ AC_TRY_COMPILE([#include [int16 testvar;], samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)]) if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then - AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H) + AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H,1,[Whether int16 typedef is included by rpc/rpc.h]) fi AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[ @@ -1509,7 +1508,7 @@ AC_TRY_COMPILE([#include [uint16 testvar;], samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)]) if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then - AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H) + AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H,1,[Whether uint16 typedef is included by rpc/rpc.h]) fi AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[ @@ -1520,7 +1519,7 @@ AC_TRY_COMPILE([#include [int32 testvar;], samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)]) if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then - AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H) + AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H,1,[Whether int32 typedef is included by rpc/rpc.h]) fi AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[ @@ -1531,7 +1530,7 @@ AC_TRY_COMPILE([#include [uint32 testvar;], samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)]) if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then - AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H) + AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H,1,[Whether uint32 typedef is included by rpc/rpc.h]) fi dnl @@ -1553,7 +1552,7 @@ AC_TRY_COMPILE([#include [int testvar;], samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)]) if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then - AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT) + AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT,1,[Whether there is a conflicting AUTH_ERROR define in rpc/rpc.h]) fi AC_MSG_CHECKING([for test routines]) @@ -1566,7 +1565,7 @@ AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[ AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"], samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)]) if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then - AC_DEFINE(HAVE_FTRUNCATE_EXTEND) + AC_DEFINE(HAVE_FTRUNCATE_EXTEND,1,[Truncate extend]) fi AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [ @@ -1583,7 +1582,7 @@ AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[ AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"], samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)]) if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then - AC_DEFINE(HAVE_BROKEN_GETGROUPS) + AC_DEFINE(HAVE_BROKEN_GETGROUPS,1,[Whether getgroups is broken]) fi AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[ @@ -1599,7 +1598,7 @@ AC_TRY_COMPILE([ CPPFLAGS="$SAVE_CPPFLAGS" ]) if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then - AC_DEFINE(REPLACE_GETPASS) + AC_DEFINE(REPLACE_GETPASS,1,[Whether getpass should be replaced]) fi AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[ @@ -1616,7 +1615,7 @@ if (strcmp(inet_ntoa(ip),"18.52.86.120") && exit(1);}], samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)]) if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then - AC_DEFINE(REPLACE_INET_NTOA) + AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced]) fi AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[ @@ -1638,7 +1637,7 @@ samba_cv_HAVE_SECURE_MKSTEMP=yes, samba_cv_HAVE_SECURE_MKSTEMP=no, samba_cv_HAVE_SECURE_MKSTEMP=cross)]) if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then - AC_DEFINE(HAVE_SECURE_MKSTEMP) + AC_DEFINE(HAVE_SECURE_MKSTEMP,1,[Whether mkstemp is secure]) fi AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[ @@ -1646,14 +1645,14 @@ AC_TRY_RUN([#include main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }], samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)]) if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then - AC_DEFINE(SYSCONF_SC_NGROUPS_MAX) + AC_DEFINE(SYSCONF_SC_NGROUPS_MAX,1,[Whether sysconf(_SC_NGROUPS_MAX) is available]) fi AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[ AC_TRY_RUN([main() { exit(getuid() != 0); }], samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)]) if test x"$samba_cv_HAVE_ROOT" = x"yes"; then - AC_DEFINE(HAVE_ROOT) + AC_DEFINE(HAVE_ROOT,1,[Whether current user is root]) else AC_MSG_WARN(running as non-root will disable some tests) fi @@ -1669,7 +1668,7 @@ AC_TRY_RUN([ #include "${srcdir-.}/lib/interfaces.c"], samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)]) if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then - iface=yes;AC_DEFINE(HAVE_IFACE_AIX) + iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available]) fi if test $iface = no; then @@ -1681,7 +1680,7 @@ AC_TRY_RUN([ #include "${srcdir-.}/lib/interfaces.c"], samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)]) if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then - iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF) + iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available]) fi fi @@ -1694,7 +1693,7 @@ AC_TRY_RUN([ #include "${srcdir-.}/lib/interfaces.c"], samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)]) if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then - iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ) + iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available]) fi fi @@ -1711,7 +1710,7 @@ AC_TRY_RUN([ #include "${srcdir-.}/lib/util_sec.c"], samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)]) if test x"$samba_cv_USE_SETRESUID" = x"yes"; then - seteuid=yes;AC_DEFINE(USE_SETRESUID) + seteuid=yes;AC_DEFINE(USE_SETRESUID,1,[Whether setresuid() is available]) fi fi @@ -1725,7 +1724,7 @@ AC_TRY_RUN([ #include "${srcdir-.}/lib/util_sec.c"], samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)]) if test x"$samba_cv_USE_SETREUID" = x"yes"; then - seteuid=yes;AC_DEFINE(USE_SETREUID) + seteuid=yes;AC_DEFINE(USE_SETREUID,1,[Whether setreuid() is available]) fi fi @@ -1738,7 +1737,7 @@ AC_TRY_RUN([ #include "${srcdir-.}/lib/util_sec.c"], samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)]) if test x"$samba_cv_USE_SETEUID" = x"yes"; then - seteuid=yes;AC_DEFINE(USE_SETEUID) + seteuid=yes;AC_DEFINE(USE_SETEUID,1,[Whether seteuid() is available]) fi fi @@ -1751,7 +1750,7 @@ AC_TRY_RUN([ #include "${srcdir-.}/lib/util_sec.c"], samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)]) if test x"$samba_cv_USE_SETUIDX" = x"yes"; then - seteuid=yes;AC_DEFINE(USE_SETUIDX) + seteuid=yes;AC_DEFINE(USE_SETUIDX,1,[Whether setuidx() is available]) fi fi @@ -1760,28 +1759,28 @@ AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[ AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"], samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)]) if test x"$samba_cv_HAVE_MMAP" = x"yes"; then - AC_DEFINE(HAVE_MMAP) + AC_DEFINE(HAVE_MMAP,1,[Whether mmap works]) fi AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[ AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"], samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)]) if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then - AC_DEFINE(FTRUNCATE_NEEDS_ROOT) + AC_DEFINE(FTRUNCATE_NEEDS_ROOT,1,[Whether ftruncate() needs root]) fi AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[ AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"], samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)]) if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then - AC_DEFINE(HAVE_FCNTL_LOCK) + AC_DEFINE(HAVE_FCNTL_LOCK,1,[Whether fcntl locking is available]) fi AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[ AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"], samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)]) if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then - AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS) + AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS,1,[Whether fcntl64 locks are broken]) else @@ -1815,7 +1814,7 @@ exit(1); samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)]) if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then - AC_DEFINE(HAVE_STRUCT_FLOCK64) + AC_DEFINE(HAVE_STRUCT_FLOCK64,1,[Whether the flock64 struct is available]) fi fi @@ -1826,7 +1825,7 @@ AC_TRY_COMPILE([#include [struct stat st; st.st_blocks = 0;], samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)]) if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then - AC_DEFINE(HAVE_STAT_ST_BLOCKS) + AC_DEFINE(HAVE_STAT_ST_BLOCKS,1,[Whether the stat struct has a st_block property]) fi AC_CACHE_CHECK([for st_blksize in struct stat],samba_cv_HAVE_STAT_ST_BLKSIZE,[ @@ -1836,7 +1835,7 @@ AC_TRY_COMPILE([#include [struct stat st; st.st_blksize = 0;], samba_cv_HAVE_STAT_ST_BLKSIZE=yes,samba_cv_HAVE_STAT_ST_BLKSIZE=no,samba_cv_HAVE_STAT_ST_BLKSIZE=cross)]) if test x"$samba_cv_HAVE_STAT_ST_BLKSIZE" = x"yes"; then - AC_DEFINE(HAVE_STAT_ST_BLKSIZE) + AC_DEFINE(HAVE_STAT_ST_BLKSIZE,1,[Whether the stat struct has a st_blksize property]) fi case "$host_os" in @@ -1852,7 +1851,7 @@ AC_TRY_COMPILE([ ],[int i;], samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)]) if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then - AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS) + AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS,1,[Broken RedHat 7.2 system header files]) fi ;; esac @@ -1865,7 +1864,7 @@ AC_TRY_COMPILE([#include [int i;], samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)]) if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then - AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES) + AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES,1,[Whether the nisplus include files are broken]) fi @@ -1877,7 +1876,7 @@ AC_ARG_WITH(smbwrapper, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_SMBWRAPPER) + AC_DEFINE(WITH_SMBWRAPPER,1,[Whether to include smbwrapper support]) WRAPPROG="bin/smbsh" WRAP="bin/smbwrapper.$SHLIBEXT" @@ -1916,7 +1915,7 @@ AC_ARG_WITH(afs, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_AFS) + AC_DEFINE(WITH_AFS,1,[Whether to include AFS clear-text auth support]) ;; *) AC_MSG_RESULT(no) @@ -1934,7 +1933,7 @@ AC_ARG_WITH(dfs, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_DFS) + AC_DEFINE(WITH_DFS,1,[Whether to include DFS support]) ;; *) AC_MSG_RESULT(no) @@ -1958,7 +1957,7 @@ AC_ARG_WITH(ads, esac ]) if test x"$with_ads_support" = x"yes"; then - AC_DEFINE(WITH_ADS) + AC_DEFINE(WITH_ADS,1,[Whether to include Active Directory support]) fi AC_MSG_RESULT($with_ads_support) @@ -2021,12 +2020,12 @@ fi # now see if we can find the krb5 libs in standard paths # or as specified above AC_CHECK_LIB(krb5, krb5_mk_req_extended, [LIBS="$LIBS -lkrb5"; - AC_DEFINE(HAVE_KRB5)]) + AC_DEFINE(HAVE_KRB5,1,[Whether KRB5 is available])]) ######################################################## # now see if we can find the gssapi libs in standard paths AC_CHECK_LIB(gssapi_krb5, gss_display_status, [LIBS="$LIBS -lgssapi_krb5"; - AC_DEFINE(HAVE_GSSAPI)]) + AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available])]) fi ######################################################## @@ -2056,7 +2055,7 @@ if test x"$with_ldap_support" = x"yes"; then # now see if we can find the ldap libs in standard paths if test x$have_ldap != xyes; then AC_CHECK_LIB(ldap, ldap_domain2hostlist, [LIBS="$LIBS -lldap"; - AC_DEFINE(HAVE_LDAP)]) + AC_DEFINE(HAVE_LDAP,1,[Whether ldap is available])]) ######################################################## # If we have LDAP, does it's rebind procedure take 2 or 3 arguments? @@ -2066,7 +2065,7 @@ if test x"$with_ldap_support" = x"yes"; then AC_TRY_COMPILE([ #include #include ], [ldap_set_rebind_proc(0, 0, 0);], [pam_ldap_cv_ldap_set_rebind_proc=3], [pam_ldap_cv_ldap_set_rebind_proc=2]) ]) - AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $pam_ldap_cv_ldap_set_rebind_proc) + AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $pam_ldap_cv_ldap_set_rebind_proc, [Number of arguments to ldap_set_rebind_proc]) fi fi @@ -2078,7 +2077,7 @@ AC_ARG_WITH(automount, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_AUTOMOUNT) + AC_DEFINE(WITH_AUTOMOUNT,1,[Whether to include automount support]) ;; *) AC_MSG_RESULT(no) @@ -2097,7 +2096,7 @@ AC_ARG_WITH(smbmount, case "$host_os" in *linux*) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_SMBMOUNT) + AC_DEFINE(WITH_SMBMOUNT,1,[Whether to build smbmount]) MPROGS="bin/smbmount bin/smbmnt bin/smbumount" ;; *) @@ -2124,7 +2123,7 @@ AC_ARG_WITH(pam, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_PAM) + AC_DEFINE(WITH_PAM,1,[Whether to include PAM support]) AUTHLIBS="$AUTHLIBS -lpam" with_pam_for_crypt=yes ;; @@ -2136,7 +2135,7 @@ AC_ARG_WITH(pam, ) # we can't build a pam module if we don't have pam. -AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM)]) +AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM,1,[Whether libpam is available])]) ################################################# # check for pam_smbpass support @@ -2174,7 +2173,7 @@ if test x"$with_pam_for_crypt" = x"no"; then AC_CHECK_FUNCS(crypt) if test x"$ac_cv_func_crypt" = x"no"; then AC_CHECK_LIB(crypt, crypt, [AUTHLIBS="$AUTHLIBS -lcrypt"; - AC_DEFINE(HAVE_CRYPT)]) + AC_DEFINE(HAVE_CRYPT,1,[Whether crypt() is available])]) fi fi @@ -2192,7 +2191,7 @@ AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"], samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross) LIBS="$crypt_LIBS"]) if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then - AC_DEFINE(HAVE_TRUNCATED_SALT) + AC_DEFINE(HAVE_TRUNCATED_SALT,1,[Whether crypt needs truncated salt]) fi fi @@ -2204,7 +2203,7 @@ AC_ARG_WITH(sam, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_SAM) + AC_DEFINE(WITH_SAM,1,[Whether to build the new (experimental) SAM database]) ;; *) AC_MSG_RESULT(no) @@ -2228,7 +2227,7 @@ AC_ARG_WITH(ldapsam, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_LDAP_SAMCONFIG) + AC_DEFINE(WITH_LDAP_SAMCONFIG,1,[Whether to include 2.2 compatibel LDAP SAM configuration]) ;; *) AC_MSG_RESULT(no) @@ -2245,7 +2244,7 @@ AC_ARG_WITH(tdbsam, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_TDB_SAM) + AC_DEFINE(WITH_TDB_SAM,1,[Whether to include experimental TDB SAM support]) ;; *) AC_MSG_RESULT(no) @@ -2262,7 +2261,7 @@ AC_ARG_WITH(nisplussam, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_NISPLUS_SAM) + AC_DEFINE(WITH_NISPLUS_SAM,1,[Whether to include nisplus SAM support]) ;; *) AC_MSG_RESULT(no) @@ -2285,7 +2284,7 @@ AC_ARG_WITH(nisplus-home, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_NISPLUS_HOME) + AC_DEFINE(WITH_NISPLUS_HOME,1,[Whether to include nisplus_home support]) ;; *) AC_MSG_RESULT(no) @@ -2302,7 +2301,7 @@ AC_ARG_WITH(syslog, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_SYSLOG) + AC_DEFINE(WITH_SYSLOG,1,[Whether to include experimental syslog support]) ;; *) AC_MSG_RESULT(no) @@ -2319,7 +2318,7 @@ AC_ARG_WITH(profiling-data, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_PROFILE) + AC_DEFINE(WITH_PROFILE,1,[Whether to use profiling]) ;; *) AC_MSG_RESULT(no) @@ -2351,16 +2350,16 @@ AC_ARG_WITH(quotas, #include ],[struct mem_dqblk D;], samba_cv_linux_2_4_quota_braindamage=yes,samba_cv_linux_2_4_quota_braindamage=no)]) if test x"$samba_cv_linux_2_4_quota_braindamage" = x"yes"; then - AC_DEFINE(LINUX_QUOTAS_2) + AC_DEFINE(LINUX_QUOTAS_2,1,[linux 2.4.x quota braindamage]) else - AC_DEFINE(LINUX_QUOTAS_1) + AC_DEFINE(LINUX_QUOTAS_1,1,[linux quotas]) fi ;; *) ;; esac QUOTAOBJS=smbd/quotas.o - AC_DEFINE(WITH_QUOTAS) + AC_DEFINE(WITH_QUOTAS,1,[Whether to include experimental quota support]) ;; *) AC_MSG_RESULT(no) @@ -2379,7 +2378,7 @@ AC_ARG_WITH(utmp, [ case "$withval" in yes) AC_MSG_RESULT(yes) - AC_DEFINE(WITH_UTMP) + AC_DEFINE(WITH_UTMP,1,[Whether to include experimental utmp accounting]) ;; *) AC_MSG_RESULT(no) @@ -2463,7 +2462,7 @@ if test $space = no; then fu_cv_sys_stat_statvfs64=cross)]) if test $fu_cv_sys_stat_statvfs64 = yes; then space=yes - AC_DEFINE(STAT_STATVFS64) + AC_DEFINE(STAT_STATVFS64,1,[Whether statvfs64() is available]) fi fi @@ -2483,7 +2482,7 @@ if test $space = no; then fu_cv_sys_stat_statvfs=no)]) if test $fu_cv_sys_stat_statvfs = yes; then space=yes - AC_DEFINE(STAT_STATVFS) + AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available]) fi fi @@ -2507,7 +2506,7 @@ if test $space = no; then AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1) if test $fu_cv_sys_stat_statfs3_osf1 = yes; then space=yes - AC_DEFINE(STAT_STATFS3_OSF1) + AC_DEFINE(STAT_STATFS3_OSF1,1,[Whether statfs requires 3 arguments]) fi fi @@ -2538,7 +2537,7 @@ member (AIX, 4.3BSD)]) AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize) if test $fu_cv_sys_stat_statfs2_bsize = yes; then space=yes - AC_DEFINE(STAT_STATFS2_BSIZE) + AC_DEFINE(STAT_STATFS2_BSIZE,1,[Whether statfs requires two arguments and struct statfs has bsize property]) fi fi @@ -2559,7 +2558,7 @@ if test $space = no; then AC_MSG_RESULT($fu_cv_sys_stat_statfs4) if test $fu_cv_sys_stat_statfs4 = yes; then space=yes - AC_DEFINE(STAT_STATFS4) + AC_DEFINE(STAT_STATFS4,1,[Whether statfs requires 4 arguments]) fi fi @@ -2587,7 +2586,7 @@ member (4.4BSD and NetBSD)]) AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize) if test $fu_cv_sys_stat_statfs2_fsize = yes; then space=yes - AC_DEFINE(STAT_STATFS2_FSIZE) + AC_DEFINE(STAT_STATFS2_FSIZE,1,[Whether statfs requires 2 arguments and struct statfs has fsize]) fi fi @@ -2618,7 +2617,7 @@ if test $space = no; then AC_MSG_RESULT($fu_cv_sys_stat_fs_data) if test $fu_cv_sys_stat_fs_data = yes; then space=yes - AC_DEFINE(STAT_STATFS2_FS_DATA) + AC_DEFINE(STAT_STATFS2_FS_DATA,1,[Whether statfs requires 2 arguments and struct fs_data is available]) fi fi @@ -2641,30 +2640,30 @@ __COMPILE_ERROR_ [int i], samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no) if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then - AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT) + AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT,1,[Whether large file support can be enabled]) fi AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT]) AC_ARG_WITH(spinlocks, [ --with-spinlocks Use spin locks instead of fcntl locks (default=no) ]) if test "x$with_spinlocks" = "xyes"; then - AC_DEFINE(USE_SPINLOCKS) + AC_DEFINE(USE_SPINLOCKS,1,[Whether to use spin locks instead of fcntl locks]) case "$host_cpu" in sparc) - AC_DEFINE(SPARC_SPINLOCKS) + AC_DEFINE(SPARC_SPINLOCKS,1,[Whether to use sparc spinlocks]) ;; i386|i486|i586|i686) - AC_DEFINE(INTEL_SPINLOCKS) + AC_DEFINE(INTEL_SPINLOCKS,1,[Whether to use intel spinlocks]) ;; mips) - AC_DEFINE(MIPS_SPINLOCKS) + AC_DEFINE(MIPS_SPINLOCKS,1,[Whether to use mips spinlocks]) ;; powerpc) - AC_DEFINE(POWERPC_SPINLOCKS) + AC_DEFINE(POWERPC_SPINLOCKS,1,[Whether to use powerpc spinlocks]) ;; esac fi @@ -2681,27 +2680,27 @@ AC_ARG_WITH(acl-support, case "$host_os" in *sysv5*) AC_MSG_RESULT(Using UnixWare ACLs) - AC_DEFINE(HAVE_UNIXWARE_ACLS) + AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available]) ;; *solaris*) AC_MSG_RESULT(Using solaris ACLs) - AC_DEFINE(HAVE_SOLARIS_ACLS) + AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available]) ;; *hpux*) AC_MSG_RESULT(Using HPUX ACLs) - AC_DEFINE(HAVE_HPUX_ACLS) + AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available]) ;; *irix*) AC_MSG_RESULT(Using IRIX ACLs) - AC_DEFINE(HAVE_IRIX_ACLS) + AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available]) ;; *aix*) AC_MSG_RESULT(Using AIX ACLs) - AC_DEFINE(HAVE_AIX_ACLS) + AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available]) ;; *osf*) AC_MSG_RESULT(Using Tru64 ACLs) - AC_DEFINE(HAVE_TRU64_ACLS) + AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available]) LIBS="$LIBS -lpacl" ;; *) @@ -2713,14 +2712,14 @@ AC_ARG_WITH(acl-support, samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)]) if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then AC_MSG_RESULT(Using posix ACLs) - AC_DEFINE(HAVE_POSIX_ACLS) + AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available]) AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[ AC_TRY_LINK([#include #include ], [ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);], samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)]) if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then - AC_DEFINE(HAVE_ACL_GET_PERM_NP) + AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available]) fi fi ;; @@ -2728,10 +2727,10 @@ samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)]) ;; *) AC_MSG_RESULT(no) - AC_DEFINE(HAVE_NO_ACLS) + AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available]) ;; esac ], - AC_DEFINE(HAVE_NO_ACLS) + AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in]) AC_MSG_RESULT(no) ) @@ -2785,16 +2784,16 @@ ssize_t nwritten = sendfile(tofd, fromfd, &offset, total); samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,samba_cv_HAVE_BROKEN_LINUX_SENDFILE=no)]) if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then - AC_DEFINE(HAVE_SENDFILE64) - AC_DEFINE(LINUX_SENDFILE_API) - AC_DEFINE(WITH_SENDFILE) + AC_DEFINE(HAVE_SENDFILE64,1,[Whether 64-bit sendfile() is available]) + AC_DEFINE(LINUX_SENDFILE_API,1,[Whether linux sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used]) elif test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then - AC_DEFINE(HAVE_SENDFILE) - AC_DEFINE(LINUX_SENDFILE_API) - AC_DEFINE(WITH_SENDFILE) + AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available]) + AC_DEFINE(LINUX_SENDFILE_API,1,[Whether linux sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used]) elif test x"$samba_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then - AC_DEFINE(LINUX_BROKEN_SENDFILE_API) - AC_DEFINE(WITH_SENDFILE) + AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used]) else AC_MSG_RESULT(no); fi @@ -2822,9 +2821,9 @@ samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,samba_cv_HAVE_BROKEN_LINUX_SENDFILE=no)] samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)]) if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then - AC_DEFINE(HAVE_SENDFILE) - AC_DEFINE(FREEBSD_SENDFILE_API) - AC_DEFINE(WITH_SENDFILE) + AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() support is available]) + AC_DEFINE(FREEBSD_SENDFILE_API,1,[Whether the FreeBSD sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included]) else AC_MSG_RESULT(no); fi @@ -2849,9 +2848,9 @@ samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)]) ], samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)]) if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then - AC_DEFINE(HAVE_SENDFILE64) - AC_DEFINE(HPUX_SENDFILE_API) - AC_DEFINE(WITH_SENDFILE) + AC_DEFINE(HAVE_SENDFILE64,1,[Whether sendfile64() is available]) + AC_DEFINE(HPUX_SENDFILE_API,1,[Whether the hpux sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included]) else AC_MSG_RESULT(no); fi @@ -2874,9 +2873,9 @@ samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)]) ], samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)]) if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then - AC_DEFINE(HAVE_SENDFILE) - AC_DEFINE(HPUX_SENDFILE_API) - AC_DEFINE(WITH_SENDFILE) + AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available]) + AC_DEFINE(HPUX_SENDFILE_API,1,[Whether the hpux sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included]) else AC_MSG_RESULT(no); fi @@ -2910,9 +2909,9 @@ samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)]) samba_cv_HAVE_SENDFILEV64=yes,samba_cv_HAVE_SENDFILEV64=no)]) if test x"$samba_cv_HAVE_SENDFILEV64" = x"yes"; then - AC_DEFINE(HAVE_SENDFILEV64) - AC_DEFINE(SOLARIS_SENDFILE_API) - AC_DEFINE(WITH_SENDFILE) + AC_DEFINE(HAVE_SENDFILEV64,1,[Whether sendfilev64() is available]) + AC_DEFINE(SOLARIS_SENDFILE_API,1,[Whether the soloris sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included]) else AC_MSG_RESULT(no); fi @@ -2943,9 +2942,9 @@ samba_cv_HAVE_SENDFILEV64=yes,samba_cv_HAVE_SENDFILEV64=no)]) samba_cv_HAVE_SENDFILEV=yes,samba_cv_HAVE_SENDFILEV=no)]) if test x"$samba_cv_HAVE_SENDFILEV" = x"yes"; then - AC_DEFINE(HAVE_SENDFILEV) - AC_DEFINE(SOLARIS_SENDFILE_API) - AC_DEFINE(WITH_SENDFILE) + AC_DEFINE(HAVE_SENDFILEV,1,[Whether sendfilev() is available]) + AC_DEFINE(SOLARIS_SENDFILE_API,1,[Whether the solaris sendfile() API is available]) + AC_DEFINE(WITH_SENDFILE,1,[Whether to include sendfile() support]) else AC_MSG_RESULT(no); fi @@ -3025,7 +3024,7 @@ WINBIND_PAM_PROGS="" if test x"$HAVE_WINBIND" = x"yes"; then AC_MSG_RESULT(yes) - AC_DEFINE(WITH_WINBIND) + AC_DEFINE(WITH_WINBIND,1,[Whether to build winbind]) WINBIND_TARGETS="bin/wbinfo" WINBIND_STARGETS="bin/winbindd" @@ -3062,7 +3061,7 @@ AC_CACHE_CHECK([whether struct passwd has pw_comment],samba_cv_passwd_pw_comment AC_TRY_COMPILE([#include ],[struct passwd p; p.pw_comment;], samba_cv_passwd_pw_comment=yes,samba_cv_passwd_pw_comment=no)]) if test x"$samba_cv_passwd_pw_comment" = x"yes"; then - AC_DEFINE(HAVE_PASSWD_PW_COMMENT) + AC_DEFINE(HAVE_PASSWD_PW_COMMENT,1,[Whether struct passwd has pw_comment]) fi #AC_CHECK_MEMBER(struct passwd.pw_age, @@ -3073,7 +3072,7 @@ AC_CACHE_CHECK([whether struct passwd has pw_age],samba_cv_passwd_pw_age, [ AC_TRY_COMPILE([#include ],[struct passwd p; p.pw_age;], samba_cv_passwd_pw_age=yes,samba_cv_passwd_pw_age=no)]) if test x"$samba_cv_passwd_pw_age" = x"yes"; then - AC_DEFINE(HAVE_PASSWD_PW_AGE) + AC_DEFINE(HAVE_PASSWD_PW_AGE,1,[Whether struct passwd has pw_age]) fi ################################################# diff --git a/source3/include/config.h.in b/source3/include/config.h.in index 4b707ba51f..a8cd81ddf9 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -1,241 +1,16 @@ /* include/config.h.in. Generated from configure.in by autoheader. */ -#undef HAVE_VOLATILE -#undef HAVE_BROKEN_READDIR -#undef HAVE_C99_VSNPRINTF -#undef HAVE_ERRNO_DECL -#undef HAVE_LONGLONG -#undef HAVE_OFF64_T -#undef HAVE_REMSH -#undef HAVE_UNSIGNED_CHAR -#undef HAVE_UTIMBUF -#undef HAVE_SIG_ATOMIC_T_TYPE -#undef HAVE_SOCKLEN_T_TYPE -#undef ssize_t -#undef ino_t -#undef ssize_t -#undef loff_t -#undef offset_t -#undef aclent_t -#undef wchar_t -#undef HAVE_CONNECT -#undef HAVE_SHORT_INO_T -#undef WITH_SMBWRAPPER -#undef WITH_AFS -#undef WITH_DFS -#undef SUNOS5 -#undef SUNOS4 -#undef LINUX + +/* Whether the host os is aix */ #undef AIX -#undef BSD -#undef IRIX -#undef UNIXWARE -#undef SYSV -#undef IRIX6 -#undef HPUX -#undef QNX -#undef SCO -#undef OSF1 -#undef NEXT2 -#undef RELIANTUNIX -#undef HAVE_MMAP -#undef HAVE_FCNTL_LOCK -#undef HAVE_FTRUNCATE_EXTEND -#undef FTRUNCATE_NEEDS_ROOT -#undef HAVE_TRAPDOOR_UID -#undef HAVE_ROOT -#undef HAVE_GETTIMEOFDAY_TZ -#undef HAVE_SOCK_SIN_LEN -#undef STAT_READ_FILSYS -#undef STAT_STATFS2_BSIZE -#undef STAT_STATFS2_FSIZE -#undef STAT_STATFS2_FS_DATA -#undef STAT_STATFS3_OSF1 -#undef STAT_STATFS4 -#undef STAT_STATVFS -#undef STAT_STATVFS64 -#undef HAVE_IFACE_AIX -#undef HAVE_IFACE_IFCONF -#undef HAVE_IFACE_IFREQ -#undef HAVE_CRYPT -#undef HAVE_PUTPRPWNAM -#undef HAVE_SET_AUTH_PARAMETERS -#undef WITH_SYSLOG -#undef WITH_PROFILE -#undef WITH_PAM -#undef WITH_NISPLUS_HOME -#undef WITH_AUTOMOUNT -#undef WITH_SMBMOUNT -#undef WITH_QUOTAS -#undef WITH_WINBIND -#undef HAVE_BROKEN_GETGROUPS -#undef REPLACE_GETPASS -#undef REPLACE_INET_NTOA -#undef HAVE_FILE_MACRO -#undef HAVE_FUNCTION_MACRO -#undef HAVE_VA_COPY -#undef HAVE_SETRESUID_DECL -#undef HAVE_SETRESUID -#undef WITH_NETATALK -#undef WITH_UTMP -#undef WITH_MSDFS -#undef WITH_LIBICONV -#undef HAVE_INO64_T -#undef HAVE_DEV64_T -#undef HAVE_STRUCT_FLOCK64 -#undef SIZEOF_INO_T -#undef SIZEOF_OFF_T -#undef STAT_STATVFS64 -#undef HAVE_LIBREADLINE -#undef HAVE_KERNEL_SHARE_MODES -#undef HAVE_KERNEL_OPLOCKS_IRIX -#undef HAVE_KERNEL_OPLOCKS_LINUX -#undef HAVE_KERNEL_CHANGE_NOTIFY -#undef HAVE_IRIX_SPECIFIC_CAPABILITIES -#undef HAVE_INT16_FROM_RPC_RPC_H -#undef HAVE_UINT16_FROM_RPC_RPC_H -#undef HAVE_INT32_FROM_RPC_RPC_H -#undef HAVE_UINT32_FROM_RPC_RPC_H -#undef KRB4_AUTH -#undef KRB5_AUTH -#undef KRB4_DIR -#undef KRB5_DIR -#undef SEEKDIR_RETURNS_VOID -#undef HAVE_DIRENT_D_OFF -#undef HAVE_GETSPNAM -#undef HAVE_BIGCRYPT -#undef HAVE_GETPRPWNAM -#undef HAVE_FSTAT64 -#undef HAVE_LSTAT64 -#undef HAVE_STAT64 -#undef HAVE_SETRESGID -#undef HAVE_SETRESGID_DECL -#undef HAVE_SHADOW_H -#undef HAVE_CUPS -#undef HAVE_MEMSET -#undef HAVE_STRCASECMP -#undef HAVE_STRUCT_DIRENT64 -#undef HAVE_TRUNCATED_SALT + +/* Whether the nisplus include files are broken */ #undef BROKEN_NISPLUS_INCLUDE_FILES -#undef HAVE_RPC_AUTH_ERROR_CONFLICT -#undef HAVE_EXPLICIT_LARGEFILE_SUPPORT -#undef USE_BOTH_CRYPT_CALLS -#undef HAVE_BROKEN_FCNTL64_LOCKS -#undef HAVE_SECURE_MKSTEMP -#undef HAVE_FNMATCH -#undef USE_SETEUID -#undef USE_SETRESUID -#undef USE_SETREUID -#undef USE_SETUIDX -#undef HAVE_DLOPEN -#undef HAVE_DLCLOSE -#undef HAVE_DLSYM -#undef HAVE_DLERROR -#undef SYSCONF_SC_NGROUPS_MAX -#undef HAVE_UT_UT_NAME -#undef HAVE_UT_UT_USER -#undef HAVE_UT_UT_ID -#undef HAVE_UT_UT_HOST -#undef HAVE_UT_UT_TIME -#undef HAVE_UT_UT_TV -#undef HAVE_UT_UT_TYPE -#undef HAVE_UT_UT_PID -#undef HAVE_UT_UT_EXIT -#undef HAVE_UT_UT_ADDR -#undef HAVE_UX_UT_SYSLEN -#undef PUTUTLINE_RETURNS_UTMP -#undef COMPILER_SUPPORTS_LL -#undef HAVE_YP_GET_DEFAULT_DOMAIN -#undef USE_SPINLOCKS -#undef SPARC_SPINLOCKS -#undef INTEL_SPINLOCKS -#undef MIPS_SPINLOCKS -#undef POWERPC_SPINLOCKS -#undef HAVE_POSIX_ACLS -#undef HAVE_ACL_GET_PERM_NP -#undef HAVE_UNIXWARE_ACLS -#undef HAVE_SOLARIS_ACLS -#undef HAVE_HPUX_ACLS -#undef HAVE_IRIX_ACLS -#undef HAVE_AIX_ACLS -#undef HAVE_TRU64_ACLS -#undef HAVE_NO_ACLS -#undef HAVE_LIBPAM -#undef HAVE_ASPRINTF_DECL -#undef HAVE_VASPRINTF_DECL -#undef HAVE_SNPRINTF_DECL -#undef HAVE_VSNPRINTF_DECL -#undef HAVE_NATIVE_ICONV -#undef HAVE_UNIXSOCKET -#undef MMAP_BLACKLIST -#undef HAVE_IMMEDIATE_STRUCTURES -#undef HAVE_CUPS -#undef WITH_SAM -#undef WITH_LDAP_SAMCONFIG -#undef WITH_NISPLUS_SAM -#undef WITH_TDB_SAM -#undef LINUX_QUOTAS_1 -#undef LINUX_QUOTAS_2 -#undef PACKAGE -#undef VERSION -#undef HAVE_LC_MESSAGES -#undef ENABLE_NLS -#undef HAVE_CATGETS -#undef HAVE_GETTEXT -#undef HAVE_STPCPY -#undef I18N_SWAT -#undef I18N_DEFAULT_PREF_LANG -#undef HAVE_KRB5 -#undef HAVE_GSSAPI + +/* Broken RedHat 7.2 system header files */ #undef BROKEN_REDHAT_7_SYSTEM_HEADERS -#undef HAVE_LDAP -#undef HAVE_STAT_ST_BLOCKS -#undef STAT_ST_BLOCKSIZE -#undef HAVE_STAT_ST_BLKSIZE -#undef HAVE_DEVICE_MAJOR_FN -#undef HAVE_DEVICE_MINOR_FN -#undef HAVE_PASSWD_PW_COMMENT -#undef HAVE_PASSWD_PW_AGE -/* - * Add these definitions to allow VFS modules to - * see the CPPFLAGS defines. - */ -#ifndef _HPUX_SOURCE -#undef _HPUX_SOURCE -#endif -#ifndef _POSIX_SOURCE -#undef _POSIX_SOURCE -#endif -#ifndef _LARGEFILE64_SOURCE -#undef _LARGEFILE64_SOURCE -#endif -#ifndef _ALIGNMENT_REQUIRED -#undef _ALIGNMENT_REQUIRED -#endif -#ifndef _MAX_ALIGNMENT -#undef _MAX_ALIGNMENT -#endif -#ifndef _LARGE_FILES -#undef _LARGE_FILES -#endif -#ifndef _FILE_OFFSET_BITS -#undef _FILE_OFFSET_BITS -#endif -#ifndef _GNU_SOURCE -#undef _GNU_SOURCE -#endif -#undef LDAP_SET_REBIND_PROC_ARGS -#undef HAVE_SENDFILE -#undef HAVE_SENDFILE64 -#undef LINUX_SENDFILE_API -#undef LINUX_BROKEN_SENDFILE_API -#undef WITH_SENDFILE -#undef FREEBSD_SENDFILE_API -#undef HPUX_SENDFILE_API -#undef WITH_ADS -#undef HAVE_SENDFILEV -#undef HAVE_SENDFILEV64 -#undef SOLARIS_SENDFILE_API +/* Whether the compiler supports the LL prefix on long long integers */ +#undef COMPILER_SUPPORTS_LL /* Define to check invariants around some common functions */ #undef DMALLOC_FUNC_CHECK @@ -243,21 +18,48 @@ /* Define to turn on dmalloc debugging */ #undef ENABLE_DMALLOC +/* Whether the FreeBSD sendfile() API is available */ +#undef FREEBSD_SENDFILE_API + +/* Whether ftruncate() needs root */ +#undef FTRUNCATE_NEEDS_ROOT + +/* Whether acl_get_perm_np() is available */ +#undef HAVE_ACL_GET_PERM_NP + +/* Whether AIX ACLs are available */ +#undef HAVE_AIX_ACLS + /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the `asprintf' function. */ #undef HAVE_ASPRINTF +/* Whether asprintf() is available */ +#undef HAVE_ASPRINTF_DECL + /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the `bigcrypt' function. */ #undef HAVE_BIGCRYPT +/* Whether fcntl64 locks are broken */ +#undef HAVE_BROKEN_FCNTL64_LOCKS + +/* Whether getgroups is broken */ +#undef HAVE_BROKEN_GETGROUPS + +/* Whether readdir() is broken */ +#undef HAVE_BROKEN_READDIR + /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO +/* Whether there is a C99 compliant vsnprintf */ +#undef HAVE_C99_VSNPRINTF + /* Define to 1 if you have the `chmod' function. */ #undef HAVE_CHMOD @@ -270,13 +72,13 @@ /* Define to 1 if you have the header file. */ #undef HAVE_COMPAT_H -/* Define to 1 if you have the `connect' function. */ +/* Whether the system has connect() */ #undef HAVE_CONNECT /* Define to 1 if you have the `creat64' function. */ #undef HAVE_CREAT64 -/* Define to 1 if you have the `crypt' function. */ +/* Whether crypt() is available */ #undef HAVE_CRYPT /* Define to 1 if you have the `crypt16' function. */ @@ -285,6 +87,21 @@ /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H +/* Whether we have CUPS */ +#undef HAVE_CUPS + +/* Whether the 'dev64_t' type is available */ +#undef HAVE_DEV64_T + +/* Whether the major macro for dev_t is available */ +#undef HAVE_DEVICE_MAJOR_FN + +/* Whether the minor macro for dev_t is available */ +#undef HAVE_DEVICE_MINOR_FN + +/* Whether dirent has a d_off member */ +#undef HAVE_DIRENT_D_OFF + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H @@ -310,9 +127,15 @@ /* Define to 1 if you have the `endnetgrent' function. */ #undef HAVE_ENDNETGRENT +/* Whether errno() is available */ +#undef HAVE_ERRNO_DECL + /* Define to 1 if you have the `execl' function. */ #undef HAVE_EXECL +/* Whether large file support can be enabled */ +#undef HAVE_EXPLICIT_LARGEFILE_SUPPORT + /* Define to 1 if you have the `fchmod' function. */ #undef HAVE_FCHMOD @@ -322,12 +145,18 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H +/* Whether fcntl locking is available */ +#undef HAVE_FCNTL_LOCK + /* Define to 1 if you have the `fcvt' function. */ #undef HAVE_FCVT /* Define to 1 if you have the `fcvtl' function. */ #undef HAVE_FCVTL +/* Whether there is a __FILE__ macro */ +#undef HAVE_FILE_MACRO + /* Define to 1 if you have the `fopen64' function. */ #undef HAVE_FOPEN64 @@ -340,7 +169,7 @@ /* Define to 1 if you have the `fstat' function. */ #undef HAVE_FSTAT -/* Define to 1 if you have the `fstat64' function. */ +/* Whether fstat64() is available */ #undef HAVE_FSTAT64 /* Define to 1 if you have the `fsync' function. */ @@ -358,6 +187,12 @@ /* Define to 1 if you have the `ftruncate64' function. */ #undef HAVE_FTRUNCATE64 +/* Truncate extend */ +#undef HAVE_FTRUNCATE_EXTEND + +/* Whether there is a __FUNCTION__ macro */ +#undef HAVE_FUNCTION_MACRO + /* Define to 1 if you have the `getauthuid' function. */ #undef HAVE_GETAUTHUID @@ -391,6 +226,9 @@ /* Define to 1 if you have the `getspnam' function. */ #undef HAVE_GETSPNAM +/* Whether gettimeofday() is available */ +#undef HAVE_GETTIMEOFDAY_TZ + /* Define to 1 if you have the `getutmpx' function. */ #undef HAVE_GETUTMPX @@ -406,6 +244,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H +/* Whether GSSAPI is available */ +#undef HAVE_GSSAPI + /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_GSSAPI_GENERIC_H @@ -415,15 +256,60 @@ /* Define to 1 if you have the header file. */ #undef HAVE_HISTORY_H +/* Whether HPUX ACLs are available */ +#undef HAVE_HPUX_ACLS + +/* Whether iface AIX is available */ +#undef HAVE_IFACE_AIX + +/* Whether iface ifconf is available */ +#undef HAVE_IFACE_IFCONF + +/* Whether iface ifreq is available */ +#undef HAVE_IFACE_IFREQ + +/* Whether the compiler supports immediate structures */ +#undef HAVE_IMMEDIATE_STRUCTURES + /* Define to 1 if you have the `initgroups' function. */ #undef HAVE_INITGROUPS /* Define to 1 if you have the `innetgr' function. */ #undef HAVE_INNETGR +/* Whether the 'ino64_t' type is available */ +#undef HAVE_INO64_T + +/* Whether int16 typedef is included by rpc/rpc.h */ +#undef HAVE_INT16_FROM_RPC_RPC_H + +/* Whether int32 typedef is included by rpc/rpc.h */ +#undef HAVE_INT32_FROM_RPC_RPC_H + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Whether IRIX ACLs are available */ +#undef HAVE_IRIX_ACLS + +/* Whether IRIX specific capabilities are available */ +#undef HAVE_IRIX_SPECIFIC_CAPABILITIES + +/* Whether kernel notifies changes */ +#undef HAVE_KERNEL_CHANGE_NOTIFY + +/* Whether IRIX kernel oplock type definitions are available */ +#undef HAVE_KERNEL_OPLOCKS_IRIX + +/* Whether to use linux kernel oplocks */ +#undef HAVE_KERNEL_OPLOCKS_LINUX + +/* Whether the kernel supports share modes */ +#undef HAVE_KERNEL_SHARE_MODES + +/* Whether KRB5 is available */ +#undef HAVE_KRB5 + /* Define to 1 if you have the header file. */ #undef HAVE_KRB5_H @@ -433,6 +319,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LBER_H +/* Whether ldap is available */ +#undef HAVE_LDAP + /* Define to 1 if you have the header file. */ #undef HAVE_LDAP_H @@ -457,6 +346,12 @@ /* Define to 1 if you have the `nsl_s' library (-lnsl_s). */ #undef HAVE_LIBNSL_S +/* Whether libpam is available */ +#undef HAVE_LIBPAM + +/* Whether the system has readline */ +#undef HAVE_LIBREADLINE + /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV @@ -481,6 +376,9 @@ /* Define to 1 if you have the `llseek' function. */ #undef HAVE_LLSEEK +/* Whether the host supports long long's */ +#undef HAVE_LONGLONG + /* Define to 1 if you have the `lseek64' function. */ #undef HAVE_LSEEK64 @@ -493,7 +391,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H -/* Define to 1 if you have the `memset' function. */ +/* Whether memset() is available */ #undef HAVE_MEMSET /* Define to 1 if you have the `mknod' function. */ @@ -505,6 +403,12 @@ /* Define to 1 if you have the `mktime' function. */ #undef HAVE_MKTIME +/* Whether mmap works */ +#undef HAVE_MMAP + +/* Whether to use native iconv */ +#undef HAVE_NATIVE_ICONV + /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H @@ -526,6 +430,9 @@ /* Do we have rl_completion_matches? */ #undef HAVE_NEW_LIBREADLINE +/* Whether no ACLs support is available */ +#undef HAVE_NO_ACLS + /* Define to 1 if you have the header file. */ #undef HAVE_NSS_COMMON_H @@ -535,9 +442,18 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NS_API_H +/* Whether off64_t is available */ +#undef HAVE_OFF64_T + /* Define to 1 if you have the `open64' function. */ #undef HAVE_OPEN64 +/* Whether struct passwd has pw_age */ +#undef HAVE_PASSWD_PW_AGE + +/* Whether struct passwd has pw_comment */ +#undef HAVE_PASSWD_PW_COMMENT + /* Define to 1 if you have the `pathconf' function. */ #undef HAVE_PATHCONF @@ -550,6 +466,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_POLL_H +/* Whether POSIX ACLs are available */ +#undef HAVE_POSIX_ACLS + /* Define to 1 if you have the `pread' function. */ #undef HAVE_PREAD @@ -601,6 +520,9 @@ /* Define to 1 if you have the `rename' function. */ #undef HAVE_RENAME +/* Whether current user is root */ +#undef HAVE_ROOT + /* Define to 1 if you have the header file. */ #undef HAVE_RPCSVC_NIS_H @@ -610,9 +532,15 @@ /* Define to 1 if you have the header file. */ #undef HAVE_RPCSVC_YP_PROT_H +/* Whether there is a conflicting AUTH_ERROR define in rpc/rpc.h */ +#undef HAVE_RPC_AUTH_ERROR_CONFLICT + /* Define to 1 if you have the header file. */ #undef HAVE_RPC_RPC_H +/* Whether mkstemp is secure */ +#undef HAVE_SECURE_MKSTEMP + /* Define to 1 if you have the header file. */ #undef HAVE_SECURITY_PAM_APPL_H @@ -625,6 +553,18 @@ /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT +/* Whether sendfile() is available */ +#undef HAVE_SENDFILE + +/* Whether sendfile64() is available */ +#undef HAVE_SENDFILE64 + +/* Whether sendfilev() is available */ +#undef HAVE_SENDFILEV + +/* Whether sendfilev64() is available */ +#undef HAVE_SENDFILEV64 + /* Define to 1 if you have the `setbuffer' function. */ #undef HAVE_SETBUFFER @@ -652,6 +592,18 @@ /* Define to 1 if you have the `setpriv' function. */ #undef HAVE_SETPRIV +/* Whether the system has setresgid */ +#undef HAVE_SETRESGID + +/* Whether setresgid() is available */ +#undef HAVE_SETRESGID_DECL + +/* Whether the system has setresuid */ +#undef HAVE_SETRESUID + +/* Whether setresuid() is available */ +#undef HAVE_SETRESUID_DECL + /* Define to 1 if you have the `setsid' function. */ #undef HAVE_SETSID @@ -676,18 +628,39 @@ /* Define to 1 if you have the `sigset' function. */ #undef HAVE_SIGSET +/* Whether we have the atomic_t variable type */ +#undef HAVE_SIG_ATOMIC_T_TYPE + /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF +/* Whether snprintf() is available */ +#undef HAVE_SNPRINTF_DECL + +/* Whether we have the variable type socklen_t */ +#undef HAVE_SOCKLEN_T_TYPE + +/* Whether the sockaddr_in struct has a sin_len property */ +#undef HAVE_SOCK_SIN_LEN + +/* Whether solaris ACLs are available */ +#undef HAVE_SOLARIS_ACLS + /* Define to 1 if you have the `srand' function. */ #undef HAVE_SRAND /* Define to 1 if you have the `srandom' function. */ #undef HAVE_SRANDOM -/* Define to 1 if you have the `stat64' function. */ +/* Whether stat64() is available */ #undef HAVE_STAT64 +/* Whether the stat struct has a st_blksize property */ +#undef HAVE_STAT_ST_BLKSIZE + +/* Whether the stat struct has a st_block property */ +#undef HAVE_STAT_ST_BLOCKS + /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H @@ -739,6 +712,12 @@ /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL +/* Whether the 'dirent64' struct is available */ +#undef HAVE_STRUCT_DIRENT64 + +/* Whether the flock64 struct is available */ +#undef HAVE_STRUCT_FLOCK64 + /* Define to 1 if `st_rdev' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_RDEV @@ -880,9 +859,30 @@ /* Define to 1 if you have the header file. */ #undef HAVE_TERMIO_H +/* Whether Tru64 ACLs are available */ +#undef HAVE_TRU64_ACLS + +/* Whether crypt needs truncated salt */ +#undef HAVE_TRUNCATED_SALT + +/* Whether uint16 typedef is included by rpc/rpc.h */ +#undef HAVE_UINT16_FROM_RPC_RPC_H + +/* Whether uint32 typedef is included by rpc/rpc.h */ +#undef HAVE_UINT32_FROM_RPC_RPC_H + /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* If we need to build with unixscoket support */ +#undef HAVE_UNIXSOCKET + +/* Whether UnixWare ACLs are available */ +#undef HAVE_UNIXWARE_ACLS + +/* Whether the 'unsigned char' type is available */ +#undef HAVE_UNSIGNED_CHAR + /* Define to 1 if you have the `updwtmp' function. */ #undef HAVE_UPDWTMP @@ -892,6 +892,9 @@ /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP +/* Whether struct utimbuf is available */ +#undef HAVE_UTIMBUF + /* Define to 1 if you have the `utime' function. */ #undef HAVE_UTIME @@ -907,12 +910,57 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UTMP_H +/* Whether the utmp struct has a property ut_addr */ +#undef HAVE_UT_UT_ADDR + +/* Whether the utmp struct has a property ut_exit */ +#undef HAVE_UT_UT_EXIT + +/* Whether the utmp struct has a property ut_host */ +#undef HAVE_UT_UT_HOST + +/* Whether the utmp struct has a property ut_id */ +#undef HAVE_UT_UT_ID + +/* Whether the utmp struct has a property ut_name */ +#undef HAVE_UT_UT_NAME + +/* Whether the utmp struct has a property ut_pid */ +#undef HAVE_UT_UT_PID + +/* Whether the utmp struct has a property ut_time */ +#undef HAVE_UT_UT_TIME + +/* Whether the utmp struct has a property ut_tv */ +#undef HAVE_UT_UT_TV + +/* Whether the utmp struct has a property ut_type */ +#undef HAVE_UT_UT_TYPE + +/* Whether the utmp struct has a property ut_user */ +#undef HAVE_UT_UT_USER + +/* Whether the utmpx struct has a property ut_syslen */ +#undef HAVE_UX_UT_SYSLEN + /* Define to 1 if you have the `vasprintf' function. */ #undef HAVE_VASPRINTF +/* Whether vasprintf() is available */ +#undef HAVE_VASPRINTF_DECL + +/* Whether __va_copy() is available */ +#undef HAVE_VA_COPY + +/* Whether the C compiler understands volatile */ +#undef HAVE_VOLATILE + /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF +/* Whether vsnprintf() is available */ +#undef HAVE_VSNPRINTF_DECL + /* Define to 1 if you have the `vsyslog' function. */ #undef HAVE_VSYSLOG @@ -922,7 +970,7 @@ /* Define if you have working AF_LOCAL sockets */ #undef HAVE_WORKING_AF_LOCAL -/* Define to 1 if you have the `yp_get_default_domain' function. */ +/* Whether the system has yp_get_default_domain() */ #undef HAVE_YP_GET_DEFAULT_DOMAIN /* Define to 1 if you have the `_acl' function. */ @@ -1135,9 +1183,54 @@ /* Define to 1 if you have the `__xstat' function. */ #undef HAVE___XSTAT +/* Whether the host os is HPUX */ +#undef HPUX + +/* Whether the hpux sendfile() API is available */ +#undef HPUX_SENDFILE_API + +/* Whether to use intel spinlocks */ +#undef INTEL_SPINLOCKS + +/* Whether the host os is irix */ +#undef IRIX + +/* Whether the host os is irix6 */ +#undef IRIX6 + +/* Number of arguments to ldap_set_rebind_proc */ +#undef LDAP_SET_REBIND_PROC_ARGS + +/* Whether the host os is linux */ +#undef LINUX + +/* Whether (linux) sendfile() is broken */ +#undef LINUX_BROKEN_SENDFILE_API + +/* linux quotas */ +#undef LINUX_QUOTAS_1 + +/* linux 2.4.x quota braindamage */ +#undef LINUX_QUOTAS_2 + +/* Whether linux sendfile() API is available */ +#undef LINUX_SENDFILE_API + +/* Whether to use mips spinlocks */ +#undef MIPS_SPINLOCKS + +/* Whether MMAP is broken */ +#undef MMAP_BLACKLIST + +/* Whether the host os is NeXT v2 */ +#undef NEXT2 + /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O +/* Whether the host os is osf1 */ +#undef OSF1 + /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT @@ -1153,28 +1246,203 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* Whether to use powerpc spinlocks */ +#undef POWERPC_SPINLOCKS + +/* Whether pututline returns pointer */ +#undef PUTUTLINE_RETURNS_UTMP + +/* Whether the host os is qnx */ +#undef QNX + +/* Whether the host os is reliantunix */ +#undef RELIANTUNIX + +/* Whether getpass should be replaced */ +#undef REPLACE_GETPASS + +/* Whether inet_ntoa should be replaced */ +#undef REPLACE_INET_NTOA + /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE +/* Whether the host os is sco unix */ +#undef SCO + +/* Whether seekdir returns void */ +#undef SEEKDIR_RETURNS_VOID + +/* The size of the 'ino_t' type */ +#undef SIZEOF_INO_T + /* The size of a `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG +/* The size of the 'off_t' type */ +#undef SIZEOF_OFF_T + /* The size of a `short', as computed by sizeof. */ #undef SIZEOF_SHORT +/* Whether the solaris sendfile() API is available */ +#undef SOLARIS_SENDFILE_API + +/* Whether to use sparc spinlocks */ +#undef SPARC_SPINLOCKS + +/* Whether statfs requires two arguments and struct statfs has bsize property + */ +#undef STAT_STATFS2_BSIZE + +/* Whether statfs requires 2 arguments and struct statfs has fsize */ +#undef STAT_STATFS2_FSIZE + +/* Whether statfs requires 2 arguments and struct fs_data is available */ +#undef STAT_STATFS2_FS_DATA + +/* Whether statfs requires 3 arguments */ +#undef STAT_STATFS3_OSF1 + +/* Whether statfs requires 4 arguments */ +#undef STAT_STATFS4 + +/* Whether statvfs() is available */ +#undef STAT_STATVFS + +/* Whether statvfs64() is available */ +#undef STAT_STATVFS64 + +/* The size of a block */ +#undef STAT_ST_BLOCKSIZE + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Whether the host os is sunos4 */ +#undef SUNOS4 + +/* Whether the host os is solaris */ +#undef SUNOS5 + +/* Whether sysconf(_SC_NGROUPS_MAX) is available */ +#undef SYSCONF_SC_NGROUPS_MAX + +/* Whether this is a system V system */ +#undef SYSV + /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME +/* Whether the host os is unixware */ +#undef UNIXWARE + +/* Whether to use both of HPUX' crypt calls */ +#undef USE_BOTH_CRYPT_CALLS + +/* Whether seteuid() is available */ +#undef USE_SETEUID + +/* Whether setresuid() is available */ +#undef USE_SETRESUID + +/* Whether setreuid() is available */ +#undef USE_SETREUID + +/* Whether setuidx() is available */ +#undef USE_SETUIDX + +/* Whether to use spin locks instead of fcntl locks */ +#undef USE_SPINLOCKS + +/* Whether to include Active Directory support */ +#undef WITH_ADS + +/* Whether to include AFS clear-text auth support */ +#undef WITH_AFS + +/* Whether to include automount support */ +#undef WITH_AUTOMOUNT + +/* Whether to include DFS support */ +#undef WITH_DFS + +/* Whether to include 2.2 compatibel LDAP SAM configuration */ +#undef WITH_LDAP_SAMCONFIG + +/* Path to iconv */ +#undef WITH_LIBICONV + +/* Whether to include nisplus_home support */ +#undef WITH_NISPLUS_HOME + +/* Whether to include nisplus SAM support */ +#undef WITH_NISPLUS_SAM + +/* Whether to include PAM support */ +#undef WITH_PAM + +/* Whether to use profiling */ +#undef WITH_PROFILE + +/* Whether to include experimental quota support */ +#undef WITH_QUOTAS + +/* Whether to build the new (experimental) SAM database */ +#undef WITH_SAM + +/* Whether to include sendfile() support */ +#undef WITH_SENDFILE + +/* Whether to build smbmount */ +#undef WITH_SMBMOUNT + +/* Whether to include smbwrapper support */ +#undef WITH_SMBWRAPPER + +/* Whether to include experimental syslog support */ +#undef WITH_SYSLOG + +/* Whether to include experimental TDB SAM support */ +#undef WITH_TDB_SAM + +/* Whether to include experimental utmp accounting */ +#undef WITH_UTMP + +/* Whether to build winbind */ +#undef WITH_WINBIND + /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN +/* Required alignment */ +#undef _ALIGNMENT_REQUIRED + +/* File offset bits */ +#undef _FILE_OFFSET_BITS + +/* Whether to use GNU libc extensions */ +#undef _GNU_SOURCE + +/* Whether to use HPUX extensions */ +#undef _HPUX_SOURCE + +/* Whether to enable large file support */ +#undef _LARGEFILE64_SOURCE + +/* Whether to enable large file support */ +#undef _LARGE_FILES + +/* Maximum alignment */ +#undef _MAX_ALIGNMENT + +/* Whether to use POSIX compatible functions */ +#undef _POSIX_SOURCE + /* Define to 1 if type `char' is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ # undef __CHAR_UNSIGNED__ -- cgit From c6e4a84cfaa9cf0909a1cd22f7e52112fbf2084b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 21 Oct 2002 19:22:46 +0000 Subject: Fix usage message (This used to be commit 2e328928aa9bfafbfa00596f261dbc68bcd51e6b) --- source3/utils/nmblookup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c index 8e4f5aab03..cdaa434e3c 100644 --- a/source3/utils/nmblookup.c +++ b/source3/utils/nmblookup.c @@ -60,7 +60,7 @@ usage on the program ****************************************************************************/ static void usage(void) { - d_printf("Usage: nmblookup [-M] [-B bcast address] [-d debuglevel] name\n"); + d_printf("Usage: nmblookup [options] name\n"); d_printf("Version %s\n",VERSION); d_printf("\t-d debuglevel set the debuglevel\n"); d_printf("\t-B broadcast address the address to use for broadcasts\n"); -- cgit From 0f8e10868621174d1dc987505515a7e44464327c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 Oct 2002 19:25:04 +0000 Subject: I was somewhat annoyed by 'pdbedit -a vl' spitting an error message at me :-) Volker (This used to be commit c4452ef22cf63c73bfb3574a55a4810af511ff20) --- source3/utils/pdbedit.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c index 0151b6b153..1199dec7fb 100644 --- a/source3/utils/pdbedit.c +++ b/source3/utils/pdbedit.c @@ -492,7 +492,13 @@ int main (int argc, char **argv) break; } } - + + poptGetArg(pc); /* Drop argv[0], the program name */ + + if (user_name == NULL) { + user_name = poptGetArg(pc); + } + if (!lp_load(dyn_CONFIGFILE,True,False,False)) { fprintf(stderr, "Can't load %s - run testparm to debug it\n", dyn_CONFIGFILE); exit(1); -- cgit From 5dbf435408cce525431dbe43bc379797293f5c99 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 Oct 2002 19:28:56 +0000 Subject: This moves the group mapping API into the passdb backend. Currently this calls back to mapping.c, but we have the framework to get the information into LDAP and the passdb.tdb (should we? I think so..). This has received moderate testing with net rpc vampire and usrmgr. I found the add_groupmem segfault in add_aliasmem as well, but that will be another checkin. Volker (This used to be commit f30095852fea19421ac8e25dfe9c5cd4b2206f84) --- source3/groupdb/mapping.c | 10 +- source3/include/mapping.h | 1 + source3/include/passdb.h | 48 ++++++++- source3/passdb/passdb.c | 14 +-- source3/passdb/pdb_interface.c | 223 +++++++++++++++++++++++++++++++++++++++ source3/passdb/pdb_ldap.c | 61 ++++++++++- source3/passdb/pdb_nisplus.c | 5 +- source3/passdb/pdb_smbpasswd.c | 51 +++++++++ source3/passdb/pdb_tdb.c | 59 +++++++++++ source3/passdb/pdb_unix.c | 51 +++++++++ source3/rpc_server/srv_lsa_nt.c | 18 ++-- source3/rpc_server/srv_samr_nt.c | 18 ++-- source3/rpc_server/srv_util.c | 2 +- source3/smbd/lanman.c | 2 +- source3/utils/net_rpc_samsync.c | 25 +++-- source3/utils/smbgroupedit.c | 10 +- 16 files changed, 546 insertions(+), 52 deletions(-) diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c index 0f05316949..f1f9fdafc1 100644 --- a/source3/groupdb/mapping.c +++ b/source3/groupdb/mapping.c @@ -313,7 +313,7 @@ BOOL add_initial_entry(gid_t gid, fstring sid, enum SID_NAME_USE sid_name_use, map.priv_set.count=priv_set.count; map.priv_set.set=priv_set.set; - add_mapping_entry(&map, TDB_INSERT); + pdb_add_group_mapping_entry(&map); return True; } @@ -915,7 +915,7 @@ BOOL get_domain_group_from_sid(DOM_SID sid, GROUP_MAP *map, BOOL with_priv) DEBUG(10, ("get_domain_group_from_sid\n")); /* if the group is NOT in the database, it CAN NOT be a domain group */ - if(!get_group_map_from_sid(sid, map, with_priv)) + if(!pdb_getgrsid(map, sid, with_priv)) return False; DEBUG(10, ("get_domain_group_from_sid: SID found in the TDB\n")); @@ -962,7 +962,7 @@ BOOL get_local_group_from_sid(DOM_SID sid, GROUP_MAP *map, BOOL with_priv) } /* The group is in the mapping table */ - if(get_group_map_from_sid(sid, map, with_priv)) { + if(pdb_getgrsid(map, sid, with_priv)) { if (map->sid_name_use!=SID_NAME_ALIAS) { if (with_priv) free_privilege(&map->priv_set); @@ -1016,7 +1016,7 @@ BOOL get_builtin_group_from_sid(DOM_SID sid, GROUP_MAP *map, BOOL with_priv) return(False); } - if(!get_group_map_from_sid(sid, map, with_priv)) + if(!pdb_getgrsid(map, sid, with_priv)) return False; if (map->sid_name_use!=SID_NAME_WKN_GRP) { @@ -1060,7 +1060,7 @@ BOOL get_group_from_gid(gid_t gid, GROUP_MAP *map, BOOL with_priv) /* * make a group map from scratch if doesn't exist. */ - if (!get_group_map_from_gid(gid, map, with_priv)) { + if (!pdb_getgrgid(map, gid, with_priv)) { map->gid=gid; map->sid_name_use=SID_NAME_ALIAS; map->systemaccount=PR_ACCESS_FROM_NETWORK; diff --git a/source3/include/mapping.h b/source3/include/mapping.h index 5ef5c19dd2..d2fb89d1de 100644 --- a/source3/include/mapping.h +++ b/source3/include/mapping.h @@ -43,6 +43,7 @@ typedef struct _GROUP_MAP { + struct pdb_methods *methods; gid_t gid; DOM_SID sid; enum SID_NAME_USE sid_name_use; diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 32f416de4a..f63fd52e84 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -32,7 +32,7 @@ * this SAMBA will load. Increment this if *ANY* changes are made to the interface. */ -#define PASSDB_INTERFACE_VERSION 3 +#define PASSDB_INTERFACE_VERSION 4 /* use this inside a passdb module */ #define PDB_MODULE_VERSIONING_MAGIC \ @@ -64,7 +64,30 @@ typedef struct pdb_context NTSTATUS (*pdb_update_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); NTSTATUS (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); + + NTSTATUS (*pdb_getgrsid)(struct pdb_context *context, GROUP_MAP *map, + DOM_SID sid, BOOL with_priv); + + NTSTATUS (*pdb_getgrgid)(struct pdb_context *context, GROUP_MAP *map, + gid_t gid, BOOL with_priv); + + NTSTATUS (*pdb_getgrnam)(struct pdb_context *context, GROUP_MAP *map, + char *name, BOOL with_priv); + + NTSTATUS (*pdb_add_group_mapping_entry)(struct pdb_context *context, + GROUP_MAP *map); + NTSTATUS (*pdb_update_group_mapping_entry)(struct pdb_context *context, + GROUP_MAP *map); + + NTSTATUS (*pdb_delete_group_mapping_entry)(struct pdb_context *context, + DOM_SID sid); + + NTSTATUS (*pdb_enum_group_mapping)(struct pdb_context *context, + enum SID_NAME_USE sid_name_use, + GROUP_MAP **rmap, int *num_entries, + BOOL unix_only, BOOL with_priv); + void (*free_fn)(struct pdb_context **); TALLOC_CTX *mem_ctx; @@ -96,6 +119,29 @@ typedef struct pdb_methods NTSTATUS (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username); + NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, + DOM_SID sid, BOOL with_priv); + + NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, + gid_t gid, BOOL with_priv); + + NTSTATUS (*getgrnam)(struct pdb_methods *methods, GROUP_MAP *map, + char *name, BOOL with_priv); + + NTSTATUS (*add_group_mapping_entry)(struct pdb_methods *methods, + GROUP_MAP *map); + + NTSTATUS (*update_group_mapping_entry)(struct pdb_methods *methods, + GROUP_MAP *map); + + NTSTATUS (*delete_group_mapping_entry)(struct pdb_methods *methods, + DOM_SID sid); + + NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, + enum SID_NAME_USE sid_name_use, + GROUP_MAP **rmap, int *num_entries, + BOOL unix_only, BOOL with_priv); + void *private_data; /* Private data of some kind */ void (*free_private_data)(void **); diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 9402f0c94c..04786b59e5 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -214,7 +214,7 @@ NTSTATUS pdb_fill_sam_pw(SAM_ACCOUNT *sam_account, const struct passwd *pwd) } /* call the mapping code here */ - if(get_group_map_from_gid(pwd->pw_gid, &map, MAPPING_WITHOUT_PRIV)) { + if(pdb_getgrgid(&map, pwd->pw_gid, MAPPING_WITHOUT_PRIV)) { if (!pdb_set_group_sid(sam_account,&map.sid, PDB_SET)){ DEBUG(0,("Can't set Group SID!\n")); return NT_STATUS_INVALID_PARAMETER; @@ -636,7 +636,7 @@ BOOL local_lookup_sid(DOM_SID *sid, char *name, enum SID_NAME_USE *psid_name_use pdb_free_sam(&sam_account); - if (get_group_map_from_sid(*sid, &map, MAPPING_WITHOUT_PRIV)) { + if (pdb_getgrsid(&map, *sid, MAPPING_WITHOUT_PRIV)) { if (map.gid!=-1) { DEBUG(5,("local_lookup_sid: mapped group %s to gid %u\n", map.nt_name, (unsigned int)map.gid)); } else { @@ -746,7 +746,7 @@ BOOL local_lookup_name(const char *c_user, DOM_SID *psid, enum SID_NAME_USE *psi */ /* check if it's a mapped group */ - if (get_group_map_from_ntname(user, &map, MAPPING_WITHOUT_PRIV)) { + if (pdb_getgrnam(&map, user, MAPPING_WITHOUT_PRIV)) { /* yes it's a mapped group */ sid_copy(&local_sid, &map.sid); *psid_name_use = map.sid_name_use; @@ -768,7 +768,7 @@ BOOL local_lookup_name(const char *c_user, DOM_SID *psid, enum SID_NAME_USE *psi * JFM, 30/11/2001 */ - if (get_group_map_from_gid(grp->gr_gid, &map, MAPPING_WITHOUT_PRIV)){ + if (pdb_getgrgid(&map, grp->gr_gid, MAPPING_WITHOUT_PRIV)){ return False; } @@ -859,7 +859,7 @@ BOOL local_sid_to_uid(uid_t *puid, const DOM_SID *psid, enum SID_NAME_USE *name_ pdb_free_sam(&sam_user); - if (get_group_map_from_sid(*psid, &map, MAPPING_WITHOUT_PRIV)) { + if (pdb_getgrsid(&map, *psid, MAPPING_WITHOUT_PRIV)) { DEBUG(3, ("local_sid_to_uid: SID '%s' is a group, not a user... \n", sid_to_string(str, psid))); /* It's a group, not a user... */ return False; @@ -897,7 +897,7 @@ DOM_SID *local_gid_to_sid(DOM_SID *psid, gid_t gid) sid_copy(psid, get_global_sam_sid()); - if (get_group_map_from_gid(gid, &map, MAPPING_WITHOUT_PRIV)) { + if (pdb_getgrgid(&map, gid, MAPPING_WITHOUT_PRIV)) { sid_copy(psid, &map.sid); } else { @@ -925,7 +925,7 @@ BOOL local_sid_to_gid(gid_t *pgid, const DOM_SID *psid, enum SID_NAME_USE *name_ * Or in the Builtin SID too. JFM, 11/30/2001 */ - if (get_group_map_from_sid(*psid, &map, MAPPING_WITHOUT_PRIV)) { + if (pdb_getgrsid(&map, *psid, MAPPING_WITHOUT_PRIV)) { /* the SID is in the mapping table but not mapped */ if (map.gid==-1) diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index a94b8b8992..7200150e37 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -215,6 +215,135 @@ static NTSTATUS context_delete_sam_account(struct pdb_context *context, SAM_ACCO return sam_acct->methods->delete_sam_account(sam_acct->methods, sam_acct); } +static NTSTATUS context_getgrsid(struct pdb_context *context, + GROUP_MAP *map, DOM_SID sid, BOOL with_priv) +{ + NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; + + struct pdb_methods *curmethods; + if ((!context)) { + DEBUG(0, ("invalid pdb_context specified!\n")); + return ret; + } + curmethods = context->pdb_methods; + while (curmethods){ + ret = curmethods->getgrsid(curmethods, map, sid, with_priv); + if (NT_STATUS_IS_OK(ret)) { + map->methods = curmethods; + return ret; + } + curmethods = curmethods->next; + } + + return ret; +} + +static NTSTATUS context_getgrgid(struct pdb_context *context, + GROUP_MAP *map, gid_t gid, BOOL with_priv) +{ + NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; + + struct pdb_methods *curmethods; + if ((!context)) { + DEBUG(0, ("invalid pdb_context specified!\n")); + return ret; + } + curmethods = context->pdb_methods; + while (curmethods){ + ret = curmethods->getgrgid(curmethods, map, gid, with_priv); + if (NT_STATUS_IS_OK(ret)) { + map->methods = curmethods; + return ret; + } + curmethods = curmethods->next; + } + + return ret; +} + +static NTSTATUS context_getgrnam(struct pdb_context *context, + GROUP_MAP *map, char *name, BOOL with_priv) +{ + NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; + + struct pdb_methods *curmethods; + if ((!context)) { + DEBUG(0, ("invalid pdb_context specified!\n")); + return ret; + } + curmethods = context->pdb_methods; + while (curmethods){ + ret = curmethods->getgrnam(curmethods, map, name, with_priv); + if (NT_STATUS_IS_OK(ret)) { + map->methods = curmethods; + return ret; + } + curmethods = curmethods->next; + } + + return ret; +} + +static NTSTATUS context_add_group_mapping_entry(struct pdb_context *context, + GROUP_MAP *map) +{ + NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; + + if ((!context) || (!context->pdb_methods)) { + DEBUG(0, ("invalid pdb_context specified!\n")); + return ret; + } + + return context->pdb_methods->add_group_mapping_entry(context->pdb_methods, + map); +} + +static NTSTATUS context_update_group_mapping_entry(struct pdb_context *context, + GROUP_MAP *map) +{ + NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; + + if ((!context) || (!context->pdb_methods)) { + DEBUG(0, ("invalid pdb_context specified!\n")); + return ret; + } + + return context-> + pdb_methods->update_group_mapping_entry(context->pdb_methods, map); +} + +static NTSTATUS context_delete_group_mapping_entry(struct pdb_context *context, + DOM_SID sid) +{ + NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; + + if ((!context) || (!context->pdb_methods)) { + DEBUG(0, ("invalid pdb_context specified!\n")); + return ret; + } + + return context-> + pdb_methods->delete_group_mapping_entry(context->pdb_methods, sid); +} + +static NTSTATUS context_enum_group_mapping(struct pdb_context *context, + enum SID_NAME_USE sid_name_use, + GROUP_MAP **rmap, int *num_entries, + BOOL unix_only, BOOL with_priv) +{ + NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; + + if ((!context) || (!context->pdb_methods)) { + DEBUG(0, ("invalid pdb_context specified!\n")); + return ret; + } + + return context->pdb_methods->enum_group_mapping(context->pdb_methods, + sid_name_use, rmap, + num_entries, unix_only, + with_priv); +} + /****************************************************************** Free and cleanup a pdb context, any associated data and anything that the attached modules might have associated. @@ -310,6 +439,13 @@ static NTSTATUS make_pdb_context(struct pdb_context **context) (*context)->pdb_add_sam_account = context_add_sam_account; (*context)->pdb_update_sam_account = context_update_sam_account; (*context)->pdb_delete_sam_account = context_delete_sam_account; + (*context)->pdb_getgrsid = context_getgrsid; + (*context)->pdb_getgrgid = context_getgrgid; + (*context)->pdb_getgrnam = context_getgrnam; + (*context)->pdb_add_group_mapping_entry = context_add_group_mapping_entry; + (*context)->pdb_update_group_mapping_entry = context_update_group_mapping_entry; + (*context)->pdb_delete_group_mapping_entry = context_delete_group_mapping_entry; + (*context)->pdb_enum_group_mapping = context_enum_group_mapping; (*context)->free_fn = free_pdb_context; @@ -479,6 +615,93 @@ BOOL pdb_delete_sam_account(SAM_ACCOUNT *sam_acct) return NT_STATUS_IS_OK(pdb_context->pdb_delete_sam_account(pdb_context, sam_acct)); } +BOOL pdb_getgrsid(GROUP_MAP *map, DOM_SID sid, BOOL with_priv) +{ + struct pdb_context *pdb_context = pdb_get_static_context(False); + + if (!pdb_context) { + return False; + } + + return NT_STATUS_IS_OK(pdb_context-> + pdb_getgrsid(pdb_context, map, sid, with_priv)); +} + +BOOL pdb_getgrgid(GROUP_MAP *map, gid_t gid, BOOL with_priv) +{ + struct pdb_context *pdb_context = pdb_get_static_context(False); + + if (!pdb_context) { + return False; + } + + return NT_STATUS_IS_OK(pdb_context-> + pdb_getgrgid(pdb_context, map, gid, with_priv)); +} + +BOOL pdb_getgrnam(GROUP_MAP *map, char *name, BOOL with_priv) +{ + struct pdb_context *pdb_context = pdb_get_static_context(False); + + if (!pdb_context) { + return False; + } + + return NT_STATUS_IS_OK(pdb_context-> + pdb_getgrnam(pdb_context, map, name, with_priv)); +} + +BOOL pdb_add_group_mapping_entry(GROUP_MAP *map) +{ + struct pdb_context *pdb_context = pdb_get_static_context(False); + + if (!pdb_context) { + return False; + } + + return NT_STATUS_IS_OK(pdb_context-> + pdb_add_group_mapping_entry(pdb_context, map)); +} + +BOOL pdb_update_group_mapping_entry(GROUP_MAP *map) +{ + struct pdb_context *pdb_context = pdb_get_static_context(False); + + if (!pdb_context) { + return False; + } + + return NT_STATUS_IS_OK(pdb_context-> + pdb_update_group_mapping_entry(pdb_context, map)); +} + +BOOL pdb_delete_group_mapping_entry(DOM_SID sid) +{ + struct pdb_context *pdb_context = pdb_get_static_context(False); + + if (!pdb_context) { + return False; + } + + return NT_STATUS_IS_OK(pdb_context-> + pdb_delete_group_mapping_entry(pdb_context, sid)); +} + +BOOL pdb_enum_group_mapping(enum SID_NAME_USE sid_name_use, GROUP_MAP **rmap, + int *num_entries, BOOL unix_only, BOOL with_priv) +{ + struct pdb_context *pdb_context = pdb_get_static_context(False); + + if (!pdb_context) { + return False; + } + + return NT_STATUS_IS_OK(pdb_context-> + pdb_enum_group_mapping(pdb_context, sid_name_use, + rmap, num_entries, unix_only, + with_priv)); +} + #endif /* !defined(WITH_NISPLUS_SAM) */ /*************************************************************** diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 3f625d1690..63c422abea 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -722,7 +722,7 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, if (group_rid == 0) { GROUP_MAP map; /* call the mapping code here */ - if(get_group_map_from_gid(gid, &map, MAPPING_WITHOUT_PRIV)) { + if(pdb_getgrgid(&map, gid, MAPPING_WITHOUT_PRIV)) { pdb_set_group_sid(sampass, &map.sid, PDB_SET); } else { @@ -1733,6 +1733,58 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO return NT_STATUS_OK; } +static NTSTATUS lsapsam_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, + DOM_SID sid, BOOL with_priv) +{ + return get_group_map_from_sid(sid, map, with_priv) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + +static NTSTATUS lsapsam_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, + gid_t gid, BOOL with_priv) +{ + return get_group_map_from_gid(gid, map, with_priv) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + +static NTSTATUS lsapsam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, + char *name, BOOL with_priv) +{ + return get_group_map_from_ntname(name, map, with_priv) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + +static NTSTATUS lsapsam_add_group_mapping_entry(struct pdb_methods *methods, + GROUP_MAP *map) +{ + return add_mapping_entry(map, TDB_INSERT) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + +static NTSTATUS lsapsam_update_group_mapping_entry(struct pdb_methods *methods, + GROUP_MAP *map) +{ + return add_mapping_entry(map, TDB_REPLACE) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + +static NTSTATUS lsapsam_delete_group_mapping_entry(struct pdb_methods *methods, + DOM_SID sid) +{ + return group_map_remove(sid) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + +static NTSTATUS lsapsam_enum_group_mapping(struct pdb_methods *methods, + enum SID_NAME_USE sid_name_use, + GROUP_MAP **rmap, int *num_entries, + BOOL unix_only, BOOL with_priv) +{ + return enum_group_mapping(sid_name_use, rmap, num_entries, unix_only, + with_priv) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + static void free_private_data(void **vp) { struct ldapsam_privates **ldap_state = (struct ldapsam_privates **)vp; @@ -1772,6 +1824,13 @@ NTSTATUS pdb_init_ldapsam(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, co (*pdb_method)->add_sam_account = ldapsam_add_sam_account; (*pdb_method)->update_sam_account = ldapsam_update_sam_account; (*pdb_method)->delete_sam_account = ldapsam_delete_sam_account; + (*pdb_method)->getgrsid = lsapsam_getgrsid; + (*pdb_method)->getgrgid = lsapsam_getgrgid; + (*pdb_method)->getgrnam = lsapsam_getgrnam; + (*pdb_method)->add_group_mapping_entry = lsapsam_add_group_mapping_entry; + (*pdb_method)->update_group_mapping_entry = lsapsam_update_group_mapping_entry; + (*pdb_method)->delete_group_mapping_entry = lsapsam_delete_group_mapping_entry; + (*pdb_method)->enum_group_mapping = lsapsam_enum_group_mapping; /* TODO: Setup private data and free */ diff --git a/source3/passdb/pdb_nisplus.c b/source3/passdb/pdb_nisplus.c index 6334408ef5..80e55454ef 100644 --- a/source3/passdb/pdb_nisplus.c +++ b/source3/passdb/pdb_nisplus.c @@ -1080,9 +1080,8 @@ static BOOL init_nisp_from_sam (nis_object * obj, const SAM_ACCOUNT * sampass, rid = pdb_get_group_rid (sampass); if (rid == 0) { - if (get_group_map_from_gid - (pdb_get_gid (sampass), &map, - MAPPING_WITHOUT_PRIV)) { + if (pdb_getgrgid(&map, pdb_get_gid (sampass), + MAPPING_WITHOUT_PRIV)) { if (!sid_peek_check_rid (get_global_sam_sid (), &map.sid, &rid)) return False; diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index 94a562fc36..3ab524f488 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -1492,6 +1492,50 @@ static NTSTATUS smbpasswd_delete_sam_account (struct pdb_methods *my_methods, SA return NT_STATUS_UNSUCCESSFUL; } +static NTSTATUS smbpasswd_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, + DOM_SID sid, BOOL with_priv) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS smbpasswd_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, + gid_t gid, BOOL with_priv) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS smbpasswd_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, + char *name, BOOL with_priv) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS smbpasswd_add_group_mapping_entry(struct pdb_methods *methods, + GROUP_MAP *map) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS smbpasswd_update_group_mapping_entry(struct pdb_methods *methods, + GROUP_MAP *map) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS smbpasswd_delete_group_mapping_entry(struct pdb_methods *methods, + DOM_SID sid) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS smbpasswd_enum_group_mapping(struct pdb_methods *methods, + enum SID_NAME_USE sid_name_use, + GROUP_MAP **rmap, int *num_entries, + BOOL unix_only, BOOL with_priv) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + static void free_private_data(void **vp) { struct smbpasswd_privates **privates = (struct smbpasswd_privates**)vp; @@ -1522,6 +1566,13 @@ NTSTATUS pdb_init_smbpasswd(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, (*pdb_method)->add_sam_account = smbpasswd_add_sam_account; (*pdb_method)->update_sam_account = smbpasswd_update_sam_account; (*pdb_method)->delete_sam_account = smbpasswd_delete_sam_account; + (*pdb_method)->getgrsid = smbpasswd_getgrsid; + (*pdb_method)->getgrgid = smbpasswd_getgrgid; + (*pdb_method)->getgrnam = smbpasswd_getgrnam; + (*pdb_method)->add_group_mapping_entry = smbpasswd_add_group_mapping_entry; + (*pdb_method)->update_group_mapping_entry = smbpasswd_update_group_mapping_entry; + (*pdb_method)->delete_group_mapping_entry = smbpasswd_delete_group_mapping_entry; + (*pdb_method)->enum_group_mapping = smbpasswd_enum_group_mapping; /* Setup private data and free function */ diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index fb01539d3f..2aa2e504d7 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -896,6 +896,58 @@ static NTSTATUS tdbsam_add_sam_account (struct pdb_methods *my_methods, SAM_ACCO return NT_STATUS_UNSUCCESSFUL; } +static NTSTATUS tdbsam_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, + DOM_SID sid, BOOL with_priv) +{ + return get_group_map_from_sid(sid, map, with_priv) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + +static NTSTATUS tdbsam_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, + gid_t gid, BOOL with_priv) +{ + return get_group_map_from_gid(gid, map, with_priv) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + +static NTSTATUS tdbsam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, + char *name, BOOL with_priv) +{ + return get_group_map_from_ntname(name, map, with_priv) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + +static NTSTATUS tdbsam_add_group_mapping_entry(struct pdb_methods *methods, + GROUP_MAP *map) +{ + return add_mapping_entry(map, TDB_INSERT) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + +static NTSTATUS tdbsam_update_group_mapping_entry(struct pdb_methods *methods, + GROUP_MAP *map) +{ + return add_mapping_entry(map, TDB_REPLACE) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + +static NTSTATUS tdbsam_delete_group_mapping_entry(struct pdb_methods *methods, + DOM_SID sid) +{ + return group_map_remove(sid) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + +static NTSTATUS tdbsam_enum_group_mapping(struct pdb_methods *methods, + enum SID_NAME_USE sid_name_use, + GROUP_MAP **rmap, int *num_entries, + BOOL unix_only, BOOL with_priv) +{ + return enum_group_mapping(sid_name_use, rmap, num_entries, unix_only, + with_priv) ? + NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL; +} + static void free_private_data(void **vp) { struct tdbsam_privates **tdb_state = (struct tdbsam_privates **)vp; @@ -933,6 +985,13 @@ NTSTATUS pdb_init_tdbsam(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, con (*pdb_method)->add_sam_account = tdbsam_add_sam_account; (*pdb_method)->update_sam_account = tdbsam_update_sam_account; (*pdb_method)->delete_sam_account = tdbsam_delete_sam_account; + (*pdb_method)->getgrsid = tdbsam_getgrsid; + (*pdb_method)->getgrgid = tdbsam_getgrgid; + (*pdb_method)->getgrnam = tdbsam_getgrnam; + (*pdb_method)->add_group_mapping_entry = tdbsam_add_group_mapping_entry; + (*pdb_method)->update_group_mapping_entry = tdbsam_update_group_mapping_entry; + (*pdb_method)->delete_group_mapping_entry = tdbsam_delete_group_mapping_entry; + (*pdb_method)->enum_group_mapping = tdbsam_enum_group_mapping; tdb_state = talloc_zero(pdb_context->mem_ctx, sizeof(struct tdbsam_privates)); diff --git a/source3/passdb/pdb_unix.c b/source3/passdb/pdb_unix.c index ba5ed0abdf..f5bbeb4ba3 100644 --- a/source3/passdb/pdb_unix.c +++ b/source3/passdb/pdb_unix.c @@ -131,6 +131,50 @@ static void unixsam_endsampwent(struct pdb_methods *methods) return; /* NT_STATUS_NOT_IMPLEMENTED; */ } +static NTSTATUS unixsam_getgrsid(struct pdb_methods *methods, GROUP_MAP *map, + DOM_SID sid, BOOL with_priv) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS unixsam_getgrgid(struct pdb_methods *methods, GROUP_MAP *map, + gid_t gid, BOOL with_priv) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS unixsam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map, + char *name, BOOL with_priv) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS unixsam_add_group_mapping_entry(struct pdb_methods *methods, + GROUP_MAP *map) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS unixsam_update_group_mapping_entry(struct pdb_methods *methods, + GROUP_MAP *map) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS unixsam_delete_group_mapping_entry(struct pdb_methods *methods, + DOM_SID sid) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + +static NTSTATUS unixsam_enum_group_mapping(struct pdb_methods *methods, + enum SID_NAME_USE sid_name_use, + GROUP_MAP **rmap, int *num_entries, + BOOL unix_only, BOOL with_priv) +{ + return NT_STATUS_NOT_IMPLEMENTED; +} + NTSTATUS pdb_init_unixsam(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, const char *location) { NTSTATUS nt_status; @@ -154,6 +198,13 @@ NTSTATUS pdb_init_unixsam(PDB_CONTEXT *pdb_context, PDB_METHODS **pdb_method, co (*pdb_method)->add_sam_account = unixsam_add_sam_account; (*pdb_method)->update_sam_account = unixsam_update_sam_account; (*pdb_method)->delete_sam_account = unixsam_delete_sam_account; + (*pdb_method)->getgrsid = unixsam_getgrsid; + (*pdb_method)->getgrgid = unixsam_getgrgid; + (*pdb_method)->getgrnam = unixsam_getgrnam; + (*pdb_method)->add_group_mapping_entry = unixsam_add_group_mapping_entry; + (*pdb_method)->update_group_mapping_entry = unixsam_update_group_mapping_entry; + (*pdb_method)->delete_group_mapping_entry = unixsam_delete_group_mapping_entry; + (*pdb_method)->enum_group_mapping = unixsam_enum_group_mapping; /* There's not very much to initialise here */ return NT_STATUS_OK; diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index e187e1556e..c4fc0a5de7 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/rpc_server/srv_lsa_nt.c @@ -856,7 +856,7 @@ NTSTATUS _lsa_enum_accounts(pipes_struct *p, LSA_Q_ENUM_ACCOUNTS *q_u, LSA_R_ENU return NT_STATUS_ACCESS_DENIED; /* get the list of mapped groups (domain, local, builtin) */ - if(!enum_group_mapping(SID_NAME_UNKNOWN, &map, &num_entries, ENUM_ONLY_MAPPED, MAPPING_WITHOUT_PRIV)) + if(!pdb_enum_group_mapping(SID_NAME_UNKNOWN, &map, &num_entries, ENUM_ONLY_MAPPED, MAPPING_WITHOUT_PRIV)) return NT_STATUS_OK; if (q_u->enum_context >= num_entries) @@ -971,7 +971,7 @@ NTSTATUS _lsa_enum_privsaccount(pipes_struct *p, LSA_Q_ENUMPRIVSACCOUNT *q_u, LS if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info)) return NT_STATUS_INVALID_HANDLE; - if (!get_group_map_from_sid(info->sid, &map, MAPPING_WITH_PRIV)) + if (!pdb_getgrsid(&map, info->sid, MAPPING_WITH_PRIV)) return NT_STATUS_NO_SUCH_GROUP; DEBUG(10,("_lsa_enum_privsaccount: %d privileges\n", map.priv_set.count)); @@ -1012,7 +1012,7 @@ NTSTATUS _lsa_getsystemaccount(pipes_struct *p, LSA_Q_GETSYSTEMACCOUNT *q_u, LSA if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info)) return NT_STATUS_INVALID_HANDLE; - if (!get_group_map_from_sid(info->sid, &map, MAPPING_WITHOUT_PRIV)) + if (!pdb_getgrsid(&map, info->sid, MAPPING_WITHOUT_PRIV)) return NT_STATUS_NO_SUCH_GROUP; /* @@ -1043,12 +1043,12 @@ NTSTATUS _lsa_setsystemaccount(pipes_struct *p, LSA_Q_SETSYSTEMACCOUNT *q_u, LSA if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info)) return NT_STATUS_INVALID_HANDLE; - if (!get_group_map_from_sid(info->sid, &map, MAPPING_WITH_PRIV)) + if (!pdb_getgrsid(&map, info->sid, MAPPING_WITH_PRIV)) return NT_STATUS_NO_SUCH_GROUP; map.systemaccount=q_u->access; - if(!add_mapping_entry(&map, TDB_REPLACE)) + if(!pdb_update_group_mapping_entry(&map)) return NT_STATUS_NO_SUCH_GROUP; free_privilege(&map.priv_set); @@ -1075,7 +1075,7 @@ NTSTATUS _lsa_addprivs(pipes_struct *p, LSA_Q_ADDPRIVS *q_u, LSA_R_ADDPRIVS *r_u if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info)) return NT_STATUS_INVALID_HANDLE; - if (!get_group_map_from_sid(info->sid, &map, MAPPING_WITH_PRIV)) + if (!pdb_getgrsid(&map, info->sid, MAPPING_WITH_PRIV)) return NT_STATUS_NO_SUCH_GROUP; set=&q_u->set; @@ -1092,7 +1092,7 @@ NTSTATUS _lsa_addprivs(pipes_struct *p, LSA_Q_ADDPRIVS *q_u, LSA_R_ADDPRIVS *r_u add_privilege(&map.priv_set, *luid_attr); } - if(!add_mapping_entry(&map, TDB_REPLACE)) + if(!pdb_update_group_mapping_entry(&map)) return NT_STATUS_NO_SUCH_GROUP; free_privilege(&map.priv_set); @@ -1119,7 +1119,7 @@ NTSTATUS _lsa_removeprivs(pipes_struct *p, LSA_Q_REMOVEPRIVS *q_u, LSA_R_REMOVEP if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info)) return NT_STATUS_INVALID_HANDLE; - if (!get_group_map_from_sid(info->sid, &map, MAPPING_WITH_PRIV)) + if (!pdb_getgrsid(&map, info->sid, MAPPING_WITH_PRIV)) return NT_STATUS_NO_SUCH_GROUP; if (q_u->allrights!=0) { @@ -1149,7 +1149,7 @@ NTSTATUS _lsa_removeprivs(pipes_struct *p, LSA_Q_REMOVEPRIVS *q_u, LSA_R_REMOVEP remove_privilege(&map.priv_set, *luid_attr); } - if(!add_mapping_entry(&map, TDB_REPLACE)) + if(!pdb_update_group_mapping_entry(&map)) return NT_STATUS_NO_SUCH_GROUP; free_privilege(&map.priv_set); diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index 126db91700..1db3f60c87 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -302,7 +302,7 @@ static NTSTATUS load_group_domain_entries(struct samr_info *info, DOM_SID *sid) return NT_STATUS_OK; } - if (!enum_group_mapping(SID_NAME_DOM_GRP, &map, (int *)&group_entries, ENUM_ONLY_MAPPED, MAPPING_WITHOUT_PRIV)) { + if (!pdb_enum_group_mapping(SID_NAME_DOM_GRP, &map, (int *)&group_entries, ENUM_ONLY_MAPPED, MAPPING_WITHOUT_PRIV)) { return NT_STATUS_NO_MEMORY; } @@ -894,7 +894,7 @@ static NTSTATUS get_group_alias_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM /* well-known aliases */ if (sid_equal(sid, &global_sid_Builtin) && !lp_hide_local_users()) { - enum_group_mapping(SID_NAME_WKN_GRP, &map, (int *)&num_entries, ENUM_ONLY_MAPPED, MAPPING_WITHOUT_PRIV); + pdb_enum_group_mapping(SID_NAME_WKN_GRP, &map, (int *)&num_entries, ENUM_ONLY_MAPPED, MAPPING_WITHOUT_PRIV); if (num_entries != 0) { *d_grp=(DOMAIN_GRP *)talloc_zero(ctx, num_entries*sizeof(DOMAIN_GRP)); @@ -931,7 +931,7 @@ static NTSTATUS get_group_alias_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM for (; (num_entries < max_entries) && (grp != NULL); grp = grp->next) { uint32 trid; - if(!get_group_map_from_gid(grp->gr_gid, &smap, MAPPING_WITHOUT_PRIV)) + if(!pdb_getgrgid(&smap, grp->gr_gid, MAPPING_WITHOUT_PRIV)) continue; if (smap.sid_name_use!=SID_NAME_ALIAS) { @@ -1012,7 +1012,7 @@ static NTSTATUS get_group_domain_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DO *p_num_entries = 0; - enum_group_mapping(SID_NAME_DOM_GRP, &map, (int *)&group_entries, ENUM_ONLY_MAPPED, MAPPING_WITHOUT_PRIV); + pdb_enum_group_mapping(SID_NAME_DOM_GRP, &map, (int *)&group_entries, ENUM_ONLY_MAPPED, MAPPING_WITHOUT_PRIV); num_entries=group_entries-start_idx; @@ -1337,7 +1337,7 @@ NTSTATUS _samr_query_aliasinfo(pipes_struct *p, SAMR_Q_QUERY_ALIASINFO *q_u, SAM !sid_check_is_in_builtin(&sid)) return NT_STATUS_OBJECT_TYPE_MISMATCH; - if (!get_group_map_from_sid(sid, &map, MAPPING_WITHOUT_PRIV)) + if (!pdb_getgrsid(&map, sid, MAPPING_WITHOUT_PRIV)) return NT_STATUS_NO_SUCH_ALIAS; switch (q_u->switch_level) { @@ -3798,7 +3798,7 @@ NTSTATUS _samr_delete_dom_group(pipes_struct *p, SAMR_Q_DELETE_DOM_GROUP *q_u, S if ( (grp=getgrgid(gid)) != NULL) return NT_STATUS_ACCESS_DENIED; - if(!group_map_remove(group_sid)) + if(!pdb_delete_group_mapping_entry(group_sid)) return NT_STATUS_ACCESS_DENIED; if (!close_policy_hnd(p, &q_u->group_pol)) @@ -3861,7 +3861,7 @@ NTSTATUS _samr_delete_dom_alias(pipes_struct *p, SAMR_Q_DELETE_DOM_ALIAS *q_u, S return NT_STATUS_ACCESS_DENIED; /* don't check if we removed it as it could be an un-mapped group */ - group_map_remove(alias_sid); + pdb_delete_group_mapping_entry(alias_sid); if (!close_policy_hnd(p, &q_u->alias_pol)) return NT_STATUS_OBJECT_NAME_INVALID; @@ -4091,7 +4091,7 @@ NTSTATUS _samr_set_groupinfo(pipes_struct *p, SAMR_Q_SET_GROUPINFO *q_u, SAMR_R_ return NT_STATUS_INVALID_INFO_CLASS; } - if(!add_mapping_entry(&map, TDB_REPLACE)) { + if(!pdb_update_group_mapping_entry(&map)) { free_privilege(&map.priv_set); return NT_STATUS_NO_SUCH_GROUP; } @@ -4135,7 +4135,7 @@ NTSTATUS _samr_set_aliasinfo(pipes_struct *p, SAMR_Q_SET_ALIASINFO *q_u, SAMR_R_ return NT_STATUS_INVALID_INFO_CLASS; } - if(!add_mapping_entry(&map, TDB_REPLACE)) { + if(!pdb_update_group_mapping_entry(&map)) { free_privilege(&map.priv_set); return NT_STATUS_NO_SUCH_GROUP; } diff --git a/source3/rpc_server/srv_util.c b/source3/rpc_server/srv_util.c index 50bf5db4fd..519daff1f6 100644 --- a/source3/rpc_server/srv_util.c +++ b/source3/rpc_server/srv_util.c @@ -276,7 +276,7 @@ BOOL get_domain_user_groups(TALLOC_CTX *ctx, int *numgroups, DOM_GID **pgids, SA DEBUG(10,("get_domain_user_groups: searching domain groups [%s] is a member of\n", user_name)); /* first get the list of the domain groups */ - if (!enum_group_mapping(SID_NAME_DOM_GRP, &map, &num_entries, ENUM_ONLY_MAPPED, MAPPING_WITHOUT_PRIV)) + if (!pdb_enum_group_mapping(SID_NAME_DOM_GRP, &map, &num_entries, ENUM_ONLY_MAPPED, MAPPING_WITHOUT_PRIV)) return False; DEBUG(10,("get_domain_user_groups: there are %d mapped groups\n", num_entries)); diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index 3b07eb3a9b..38333ca0c2 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -1778,7 +1778,7 @@ static BOOL api_RNetGroupEnum(connection_struct *conn,uint16 vuid, char *param,c return False; /* get list of domain groups SID_DOMAIN_GRP=2 */ - if(!enum_group_mapping(SID_NAME_DOM_GRP , &group_list, &num_entries, False, False)) { + if(!pdb_enum_group_mapping(SID_NAME_DOM_GRP , &group_list, &num_entries, False, False)) { DEBUG(3,("api_RNetGroupEnum:failed to get group list")); return False; } diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index 4b0163bcf5..10fba52be8 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -324,8 +324,7 @@ fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta) pdb_update_sam_account(sam_account); } - if (!get_group_map_from_sid(*pdb_get_group_sid(sam_account), - &map, False)) { + if (!pdb_getgrsid(&map, *pdb_get_group_sid(sam_account), False)) { DEBUG(0, ("Primary group of %s has no mapping!\n", pdb_get_username(sam_account))); pdb_free_sam(&sam_account); @@ -353,7 +352,7 @@ fetch_group_info(uint32 rid, SAM_GROUP_INFO *delta) DOM_SID group_sid; fstring sid_string; GROUP_MAP map; - int flag = TDB_INSERT; + BOOL insert = True; unistr2_to_ascii(name, &delta->uni_grp_name, sizeof(name)-1); unistr2_to_ascii(comment, &delta->uni_grp_desc, sizeof(comment)-1); @@ -363,9 +362,9 @@ fetch_group_info(uint32 rid, SAM_GROUP_INFO *delta) sid_append_rid(&group_sid, rid); sid_to_string(sid_string, &group_sid); - if (get_group_map_from_sid(group_sid, &map, False)) { + if (pdb_getgrsid(&map, group_sid, False)) { grp = getgrgid(map.gid); - flag = 0; /* Don't TDB_INSERT, mapping exists */ + insert = False; } if (grp == NULL) @@ -392,7 +391,10 @@ fetch_group_info(uint32 rid, SAM_GROUP_INFO *delta) map.priv_set.count = 0; map.priv_set.set = NULL; - add_mapping_entry(&map, flag); + if (insert) + pdb_add_group_mapping_entry(&map); + else + pdb_update_group_mapping_entry(&map); return NT_STATUS_OK; } @@ -530,7 +532,7 @@ static NTSTATUS fetch_alias_info(uint32 rid, SAM_ALIAS_INFO *delta, DOM_SID alias_sid; fstring sid_string; GROUP_MAP map; - int insert_flag = TDB_INSERT; + BOOL insert = True; unistr2_to_ascii(name, &delta->uni_als_name, sizeof(name)-1); unistr2_to_ascii(comment, &delta->uni_als_desc, sizeof(comment)-1); @@ -540,9 +542,9 @@ static NTSTATUS fetch_alias_info(uint32 rid, SAM_ALIAS_INFO *delta, sid_append_rid(&alias_sid, rid); sid_to_string(sid_string, &alias_sid); - if (get_group_map_from_sid(alias_sid, &map, False)) { + if (pdb_getgrsid(&map, alias_sid, False)) { grp = getgrgid(map.gid); - insert_flag = 0; /* Don't TDB_INSERT, mapping exists */ + insert = False; } if (grp == NULL) { @@ -573,7 +575,10 @@ static NTSTATUS fetch_alias_info(uint32 rid, SAM_ALIAS_INFO *delta, map.priv_set.count = 0; map.priv_set.set = NULL; - add_mapping_entry(&map, insert_flag); + if (insert) + pdb_add_group_mapping_entry(&map); + else + pdb_update_group_mapping_entry(&map); return NT_STATUS_OK; } diff --git a/source3/utils/smbgroupedit.c b/source3/utils/smbgroupedit.c index 589dafc231..bdff59c6f2 100644 --- a/source3/utils/smbgroupedit.c +++ b/source3/utils/smbgroupedit.c @@ -69,7 +69,7 @@ static BOOL get_sid_from_input(DOM_SID *sid, char *input) if (StrnCaseCmp( input, "S-", 2)) { /* Perhaps its the NT group name? */ - if (!get_group_map_from_ntname(input, &map, MAPPING_WITHOUT_PRIV)) { + if (!pdb_getgrnam(&map, input, MAPPING_WITHOUT_PRIV)) { printf("NT Group %s doesn't exist in mapping DB\n", input); return False; } else { @@ -133,7 +133,7 @@ static int changegroup(char *sid_string, char *group, enum SID_NAME_USE sid_type } /* Get the current mapping from the database */ - if(!get_group_map_from_sid(sid, &map, MAPPING_WITH_PRIV)) { + if(!pdb_getgrsid(&map, sid, MAPPING_WITH_PRIV)) { printf("This SID does not exist in the database\n"); return -1; } @@ -177,7 +177,7 @@ static int changegroup(char *sid_string, char *group, enum SID_NAME_USE sid_type if (privilege!=NULL) convert_priv_from_text(&map.priv_set, privilege); - if (!add_mapping_entry(&map, TDB_REPLACE)) { + if (!pdb_add_group_mapping_entry(&map)) { printf("Count not update group database\n"); free_privilege(&map.priv_set); return -1; @@ -198,7 +198,7 @@ static int deletegroup(char *group) return -1; } - if(!group_map_remove(sid)) { + if(!pdb_delete_group_mapping_entry(sid)) { printf("removing group %s from the mapping db failed!\n", group); return -1; } @@ -220,7 +220,7 @@ static int listgroup(enum SID_NAME_USE sid_type, BOOL long_list) if (!long_list) printf("NT group (SID) -> Unix group\n"); - if (!enum_group_mapping(sid_type, &map, &entries, ENUM_ALL_MAPPED, MAPPING_WITH_PRIV)) + if (!pdb_enum_group_mapping(sid_type, &map, &entries, ENUM_ALL_MAPPED, MAPPING_WITH_PRIV)) return -1; for (i=0; i Date: Mon, 21 Oct 2002 20:28:11 +0000 Subject: merge from samba_3_0 removed the following parameters * postscript * printer driver * printer driver location * printer driver file also removed the get_a_printer_driver_9x_compatible() function (This used to be commit e7dd8cf903144393b1362719d75430a2ee7e5f27) --- source3/param/loadparm.c | 19 --- source3/printing/nt_printing.c | 62 --------- source3/printing/printing.c | 11 -- source3/smbd/fileio.c | 10 +- source3/smbd/lanman.c | 309 ++++++++++++----------------------------- 5 files changed, 94 insertions(+), 317 deletions(-) diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7bec315631..effbb7af68 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -300,9 +300,6 @@ typedef struct char *szQueuepausecommand; char *szQueueresumecommand; char *szPrintername; - char *szPrinterDriver; - char *szPrinterDriverLocation; - char *szDriverFile; char *szDontdescend; char **szHostsallow; char **szHostsdeny; @@ -357,7 +354,6 @@ typedef struct BOOL bGuest_only; BOOL bGuest_ok; BOOL bPrint_ok; - BOOL bPostscript; BOOL bMap_system; BOOL bMap_hidden; BOOL bMap_archive; @@ -422,9 +418,6 @@ static service sDefault = { NULL, /* szQueuepausecommand */ NULL, /* szQueueresumecommand */ NULL, /* szPrintername */ - NULL, /* szPrinterDriver - this is set in init_globals() */ - NULL, /* szPrinterDriverLocation */ - NULL, /* szDriverFile */ NULL, /* szDontdescend */ NULL, /* szHostsallow */ NULL, /* szHostsdeny */ @@ -479,7 +472,6 @@ static service sDefault = { False, /* bGuest_only */ False, /* bGuest_ok */ False, /* bPrint_ok */ - False, /* bPostscript */ False, /* bMap_system */ False, /* bMap_hidden */ True, /* bMap_archive */ @@ -884,7 +876,6 @@ static struct parm_struct parm_table[] = { {"printcap", P_STRING, P_GLOBAL, &Globals.szPrintcapname, NULL, NULL, FLAG_HIDE}, {"printable", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_PRINT}, {"print ok", P_BOOL, P_LOCAL, &sDefault.bPrint_ok, NULL, NULL, FLAG_HIDE}, - {"postscript", P_BOOL, P_LOCAL, &sDefault.bPostscript, NULL, NULL, FLAG_PRINT | FLAG_DEPRECATED}, {"printing", P_ENUM, P_LOCAL, &sDefault.iPrinting, NULL, enum_printing, FLAG_PRINT | FLAG_GLOBAL}, {"print command", P_STRING, P_LOCAL, &sDefault.szPrintcommand, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, {"disable spoolss", P_BOOL, P_GLOBAL, &Globals.bDisableSpoolss, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL}, @@ -905,9 +896,6 @@ static struct parm_struct parm_table[] = { {"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_HIDE}, {"use client driver", P_BOOL, P_LOCAL, &sDefault.bUseClientDriver, NULL, NULL, FLAG_PRINT}, {"default devmode", P_BOOL, P_LOCAL, &sDefault.bDefaultDevmode, NULL, NULL, FLAG_PRINT}, - {"printer driver", P_STRING, P_LOCAL, &sDefault.szPrinterDriver, NULL, NULL, FLAG_PRINT | FLAG_DEPRECATED}, - {"printer driver file", P_STRING, P_LOCAL, &sDefault.szDriverFile, NULL, NULL, FLAG_PRINT | FLAG_DEPRECATED}, - {"printer driver location", P_STRING, P_LOCAL, &sDefault.szPrinterDriverLocation, NULL, NULL, FLAG_PRINT | FLAG_GLOBAL | FLAG_DEPRECATED}, {"Filename Handling", P_SEP, P_SEPARATOR}, {"strip dot", P_BOOL, P_GLOBAL, &Globals.bStripDot, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, @@ -1104,9 +1092,6 @@ Initialise the sDefault parameter structure for the printer values. ***************************************************************************/ static void init_printer_values(void) { - string_set(&sDefault.szPrinterDriver, ""); - string_set(&sDefault.szDriverFile, dyn_DRIVERFILE); - /* choose defaults depending on the type of printing */ switch (sDefault.iPrinting) { @@ -1713,8 +1698,6 @@ FN_LOCAL_STRING(lp_lpresumecommand, szLpresumecommand) FN_LOCAL_STRING(lp_queuepausecommand, szQueuepausecommand) FN_LOCAL_STRING(lp_queueresumecommand, szQueueresumecommand) static FN_LOCAL_STRING(_lp_printername, szPrintername) -FN_LOCAL_STRING(lp_driverfile, szDriverFile) -FN_LOCAL_STRING(lp_printerdriver, szPrinterDriver) FN_LOCAL_LIST(lp_hostsallow, szHostsallow) FN_LOCAL_LIST(lp_hostsdeny, szHostsdeny) FN_LOCAL_STRING(lp_magicscript, szMagicScript) @@ -1734,7 +1717,6 @@ FN_LOCAL_STRING(lp_mangled_map, szMangledMap) FN_LOCAL_STRING(lp_veto_files, szVetoFiles) FN_LOCAL_STRING(lp_hide_files, szHideFiles) FN_LOCAL_STRING(lp_veto_oplocks, szVetoOplockFiles) -FN_LOCAL_STRING(lp_driverlocation, szPrinterDriverLocation) FN_LOCAL_BOOL(lp_msdfs_root, bMSDfsRoot) FN_LOCAL_BOOL(lp_autoloaded, autoloaded) FN_LOCAL_BOOL(lp_preexec_close, bPreexecClose) @@ -1753,7 +1735,6 @@ FN_LOCAL_BOOL(lp_no_set_dir, bNo_set_dir) FN_LOCAL_BOOL(lp_guest_ok, bGuest_ok) FN_LOCAL_BOOL(lp_guest_only, bGuest_only) FN_LOCAL_BOOL(lp_print_ok, bPrint_ok) -FN_LOCAL_BOOL(lp_postscript, bPostscript) FN_LOCAL_BOOL(lp_map_hidden, bMap_hidden) FN_LOCAL_BOOL(lp_map_archive, bMap_archive) FN_LOCAL_BOOL(lp_locking, bLocking) diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index fcb493a614..2226190323 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -1793,67 +1793,6 @@ static WERROR get_a_printer_driver_3(NT_PRINTER_DRIVER_INFO_LEVEL_3 **info_ptr, return WERR_OK; } -/**************************************************************************** -****************************************************************************/ -uint32 get_a_printer_driver_9x_compatible(pstring line, fstring model) -{ - NT_PRINTER_DRIVER_INFO_LEVEL_3 *info3; - TDB_DATA kbuf; - pstring key; - int i; - line[0] = '\0'; - - slprintf(key, sizeof(key)-1, "%s%s/%d/%s", DRIVERS_PREFIX, "WIN40", 0, model); - DEBUG(10,("driver key: [%s]\n", key)); - - kbuf.dptr = key; - kbuf.dsize = strlen(key)+1; - if (!tdb_exists(tdb_drivers, kbuf)) - return False; - - ZERO_STRUCT(info3); - get_a_printer_driver_3(&info3, model, "Windows 4.0", 0); - - DEBUGADD(10,("info3->name [%s]\n", info3->name)); - DEBUGADD(10,("info3->datafile [%s]\n", info3->datafile)); - DEBUGADD(10,("info3->helpfile [%s]\n", info3->helpfile)); - DEBUGADD(10,("info3->monitorname [%s]\n", info3->monitorname)); - DEBUGADD(10,("info3->defaultdatatype [%s]\n", info3->defaultdatatype)); - for (i=0; info3->dependentfiles && *info3->dependentfiles[i]; i++) { - DEBUGADD(10,("info3->dependentfiles [%s]\n", info3->dependentfiles[i])); - } - DEBUGADD(10,("info3->environment [%s]\n", info3->environment)); - DEBUGADD(10,("info3->driverpath [%s]\n", info3->driverpath)); - DEBUGADD(10,("info3->configfile [%s]\n", info3->configfile)); - - /*pstrcat(line, info3->name); pstrcat(line, ":");*/ - trim_string(info3->driverpath, "\\print$\\WIN40\\0\\", 0); - pstrcat(line, info3->driverpath); - pstrcat(line, ":"); - trim_string(info3->datafile, "\\print$\\WIN40\\0\\", 0); - pstrcat(line, info3->datafile); - pstrcat(line, ":"); - trim_string(info3->helpfile, "\\print$\\WIN40\\0\\", 0); - pstrcat(line, info3->helpfile); - pstrcat(line, ":"); - trim_string(info3->monitorname, "\\print$\\WIN40\\0\\", 0); - pstrcat(line, info3->monitorname); - pstrcat(line, ":"); - pstrcat(line, "RAW"); /*info3->defaultdatatype);*/ - pstrcat(line, ":"); - - for (i=0; info3->dependentfiles && *info3->dependentfiles[i]; i++) { - if (i) - pstrcat(line, ","); /* don't end in a "," */ - trim_string(info3->dependentfiles[i], "\\print$\\WIN40\\0\\", 0); - pstrcat(line, info3->dependentfiles[i]); - } - - SAFE_FREE(info3); - - return True; -} - /**************************************************************************** Debugging function, dump at level 6 the struct in the logs. ****************************************************************************/ @@ -2839,7 +2778,6 @@ static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstrin get_called_name(), sharename); fstrcpy(info.sharename, sharename); fstrcpy(info.portname, SAMBA_PRINTER_PORT_NAME); - fstrcpy(info.drivername, lp_printerdriver(snum)); /* by setting the driver name to an empty string, a local NT admin can now run the **local** APW to install a local printer driver diff --git a/source3/printing/printing.c b/source3/printing/printing.c index 95d8915976..afcf0ee720 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -1572,17 +1572,6 @@ to open spool file %s.\n", pjob.filename)); release_print_db(pdb); - /* - * If the printer is marked as postscript output a leading - * file identifier to ensure the file is treated as a raw - * postscript file. - * This has a similar effect as CtrlD=0 in WIN.INI file. - * tim@fsg.com 09/06/94 - */ - if (lp_postscript(snum)) { - print_job_write(snum, jobid, "%!\n",3); - } - return jobid; fail: diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c index d5df9826df..6bae1df996 100644 --- a/source3/smbd/fileio.c +++ b/source3/smbd/fileio.c @@ -30,13 +30,9 @@ static BOOL setup_write_cache(files_struct *, SMB_OFF_T); static SMB_OFF_T seek_file(files_struct *fsp,SMB_OFF_T pos) { - SMB_OFF_T offset = 0; SMB_OFF_T seek_ret; - if (fsp->print_file && lp_postscript(fsp->conn->service)) - offset = 3; - - seek_ret = fsp->conn->vfs_ops.lseek(fsp,fsp->fd,pos+offset,SEEK_SET); + seek_ret = fsp->conn->vfs_ops.lseek(fsp,fsp->fd,pos,SEEK_SET); if(seek_ret == -1) { DEBUG(0,("seek_file: (%s) sys_lseek failed. Error was %s\n", @@ -45,10 +41,10 @@ static SMB_OFF_T seek_file(files_struct *fsp,SMB_OFF_T pos) return -1; } - fsp->pos = seek_ret - offset; + fsp->pos = seek_ret; DEBUG(10,("seek_file (%s): requested pos = %.0f, new pos = %.0f\n", - fsp->fsp_name, (double)(pos+offset), (double)fsp->pos )); + fsp->fsp_name, (double)pos, (double)fsp->pos )); return(fsp->pos); } diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index 38333ca0c2..7ab1be9dd9 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -494,7 +494,7 @@ static void fill_printjob_info(connection_struct *conn, int snum, int uLevel, /******************************************************************** Return a driver name given an snum. - Looks in a tdb first. Returns True if from tdb, False otherwise. + Returns True if from tdb, False otherwise. ********************************************************************/ static BOOL get_driver_name(int snum, pstring drivername) @@ -507,8 +507,6 @@ static BOOL get_driver_name(int snum, pstring drivername) pstrcpy( drivername, info->info_2->drivername); in_tdb = True; free_a_printer(&info, 2); - } else { - pstrcpy( drivername, lp_printerdriver(snum)); } return in_tdb; @@ -518,162 +516,83 @@ static BOOL get_driver_name(int snum, pstring drivername) Respond to the DosPrintQInfo command with a level of 52 This is used to get printer driver information for Win9x clients ********************************************************************/ -static void fill_printq_info_52(connection_struct *conn, int snum, int uLevel, - struct pack_desc* desc, - int count, print_queue_struct* queue, - print_status_struct* status) +static void fill_printq_info_52(connection_struct *conn, int snum, + struct pack_desc* desc, int count ) { - int i; - BOOL ok = False; - pstring tok,driver,datafile,langmon,helpfile,datatype; - char *p; - char **lines = NULL; - pstring gen_line; - BOOL in_tdb = False; - fstring location; - pstring drivername; - - /* - * Check in the tdb *first* before checking the legacy - * files. This allows an NT upload to take precedence over - * the existing fileset. JRA. - * - * we need to lookup the driver name prior to making the call - * to get_a_printer_driver_9x_compatible() and not rely on the - * 'print driver' parameter --jerry - */ - - - if ((get_driver_name(snum,drivername)) && - ((ok = get_a_printer_driver_9x_compatible(gen_line, drivername)) == True)) - { - in_tdb = True; - p = gen_line; - DEBUG(10,("9x compatable driver line for [%s]: [%s]\n", drivername, gen_line)); - } - else - { - /* didn't find driver in tdb */ - - DEBUG(10,("snum: %d\nprinterdriver: [%s]\nlp_driverfile: [%s]\n", - snum, drivername, lp_driverfile(snum))); - - lines = file_lines_load(lp_driverfile(snum),NULL); - if (!lines) - { - DEBUG(3,("Can't open %s - %s\n", lp_driverfile(snum), - strerror(errno))); - desc->errcode=NERR_notsupported; - goto done; - } - - /* lookup the long printer driver name in the file description */ - for (i=0;lines[i] && !ok;i++) - { - p = lines[i]; - if (next_token(&p,tok,":",sizeof(tok)) && - (strlen(drivername) == strlen(tok)) && - (!strncmp(tok,drivername,strlen(drivername)))) - { - ok = True; - } - } + int i; + fstring location; + NT_PRINTER_DRIVER_INFO_LEVEL driver; + NT_PRINTER_INFO_LEVEL *printer = NULL; + + if ( !W_ERROR_IS_OK(get_a_printer( &printer, 2, lp_servicename(snum))) ) { + DEBUG(3,("fill_printq_info_52: Failed to lookup printer [%s]\n", + lp_servicename(snum))); + goto err; } - - if (ok) + + if ( !W_ERROR_IS_OK(get_a_printer_driver(&driver, 3, printer->info_2->drivername, + "Windows 4.0", 0)) ) { - /* driver file name */ - if (!next_token(&p,driver,":",sizeof(driver))) - goto err; - - /* data file name */ - if (!next_token(&p,datafile,":",sizeof(datafile))) - goto err; - - /* - * for the next tokens - which may be empty - I have - * to check for empty tokens first because the - * next_token function will skip all empty token - * fields */ + DEBUG(3,("fill_printq_info_52: Failed to lookup driver [%s]\n", + printer->info_2->drivername)); + goto err; + } - /* help file */ - if (*p == ':') - { - *helpfile = '\0'; - p++; - } - else if (!next_token(&p,helpfile,":",sizeof(helpfile))) - goto err; + trim_string(driver.info_3->driverpath, "\\print$\\WIN40\\0\\", 0); + trim_string(driver.info_3->datafile, "\\print$\\WIN40\\0\\", 0); + trim_string(driver.info_3->helpfile, "\\print$\\WIN40\\0\\", 0); - /* language monitor */ - if (*p == ':') - { - *langmon = '\0'; - p++; - } - else if (!next_token(&p,langmon,":",sizeof(langmon))) - goto err; + PACKI(desc, "W", 0x0400); /* don't know */ + PACKS(desc, "z", driver.info_3->name); /* long printer name */ + PACKS(desc, "z", driver.info_3->driverpath); /* Driverfile Name */ + PACKS(desc, "z", driver.info_3->datafile); /* Datafile name */ + PACKS(desc, "z", driver.info_3->monitorname); /* language monitor */ - /* default data type */ - if (!next_token(&p,datatype,":",sizeof(datatype))) - goto err; + fstrcpy(location, "\\\\"); + fstrcat(location, get_called_name()); + fstrcat(location, "\\print$\\WIN40\\0"); + PACKS(desc,"z", location); /* share to retrieve files */ - PACKI(desc,"W",0x0400); /* don't know */ - PACKS(desc,"z",drivername); /* long printer name */ - PACKS(desc,"z",driver); /* Driverfile Name */ - PACKS(desc,"z",datafile); /* Datafile name */ - PACKS(desc,"z",langmon); /* language monitor */ - if (in_tdb) - { - fstrcpy(location, "\\\\"); - fstrcat(location, global_myname); - fstrcat(location, "\\print$\\WIN40\\0"); - PACKS(desc,"z",location); /* share to retrieve files */ - } - else - { - PACKS(desc,"z",lp_driverlocation(snum)); /* share to retrieve files */ - } - PACKS(desc,"z",datatype); /* default data type */ - PACKS(desc,"z",helpfile); /* helpfile name */ - PACKS(desc,"z",driver); /* driver name */ - - DEBUG(3,("printerdriver:%s:\n",drivername)); - DEBUG(3,("Driver:%s:\n",driver)); - DEBUG(3,("Data File:%s:\n",datafile)); - DEBUG(3,("Language Monitor:%s:\n",langmon)); - if (in_tdb) - DEBUG(3,("lp_driverlocation:%s:\n",location)); - else - DEBUG(3,("lp_driverlocation:%s:\n",lp_driverlocation(snum))); - DEBUG(3,("Data Type:%s:\n",datatype)); - DEBUG(3,("Help File:%s:\n",helpfile)); - PACKI(desc,"N",count); /* number of files to copy */ - - for (i=0;i gave %d entries\n", - SERVICE(snum),count)); - - desc->errcode=NERR_Success; - goto done; + PACKS(desc,"z", driver.info_3->defaultdatatype); /* default data type */ + PACKS(desc,"z", driver.info_3->helpfile); /* helpfile name */ + PACKS(desc,"z", driver.info_3->driverpath); /* driver name */ + + DEBUG(3,("Printer Driver Name: %s:\n",driver.info_3->name)); + DEBUG(3,("Driver: %s:\n",driver.info_3->driverpath)); + DEBUG(3,("Data File: %s:\n",driver.info_3->datafile)); + DEBUG(3,("Language Monitor: %s:\n",driver.info_3->monitorname)); + DEBUG(3,("Driver Location: %s:\n",location)); + DEBUG(3,("Data Type: %s:\n",driver.info_3->defaultdatatype)); + DEBUG(3,("Help File: %s:\n",driver.info_3->helpfile)); + PACKI(desc,"N",count); /* number of files to copy */ + + for ( i=0; idependentfiles && *driver.info_3->dependentfiles[i]; i++) + { + trim_string(driver.info_3->dependentfiles[i], "\\print$\\WIN40\\0\\", 0); + PACKS(desc,"z",driver.info_3->dependentfiles[i]); /* driver files to copy */ + DEBUG(3,("Dependent File: %s:\n",driver.info_3->dependentfiles[i])); } + + /* sanity check */ + if ( i != count ) + DEBUG(3,("fill_printq_info_52: file count specified by client [%d] != number of dependent files [%i]\n", + count, i)); + + DEBUG(3,("fill_printq_info on <%s> gave %d entries\n", SERVICE(snum),i)); - err: + desc->errcode=NERR_Success; + goto done; +err: DEBUG(3,("fill_printq_info: Can't supply driver files\n")); desc->errcode=NERR_notsupported; - done: - file_lines_free(lines); +done: + if ( printer ) + free_a_printer( &printer, 2 ); + + if ( driver.info_3 ) + free_a_printer_driver( driver, 3 ); } @@ -751,88 +670,42 @@ static void fill_printq_info(connection_struct *conn, int snum, int uLevel, fill_printjob_info(conn,snum,uLevel == 2 ? 1 : 2,desc,&queue[i],i); } - if (uLevel==52) { - fill_printq_info_52(conn, snum, uLevel, desc, count, queue, status); - } + if (uLevel==52) + fill_printq_info_52( conn, snum, desc, count ); } /* This function returns the number of files for a given driver */ static int get_printerdrivernumber(int snum) { - int i, result = 0; - BOOL ok = False; - pstring tok; - char *p; - char **lines = NULL; - pstring gen_line; - pstring drivername; - - /* - * Check in the tdb *first* before checking the legacy - * files. This allows an NT upload to take precedence over - * the existing fileset. JRA. - * - * we need to lookup the driver name prior to making the call - * to get_a_printer_driver_9x_compatible() and not rely on the - * 'print driver' parameter --jerry - */ - - if ((get_driver_name(snum,drivername)) && - (ok = get_a_printer_driver_9x_compatible(gen_line, drivername) == True)) - { - p = gen_line; - DEBUG(10,("9x compatable driver line for [%s]: [%s]\n", drivername, gen_line)); - } - else - { - /* didn't find driver in tdb */ - - DEBUG(10,("snum: %d\nprinterdriver: [%s]\nlp_driverfile: [%s]\n", - snum, drivername, lp_driverfile(snum))); - - lines = file_lines_load(lp_driverfile(snum), NULL); - if (!lines) - { - DEBUG(3,("Can't open %s - %s\n", lp_driverfile(snum),strerror(errno))); - goto done; - } + int result = 0; + NT_PRINTER_DRIVER_INFO_LEVEL driver; + NT_PRINTER_INFO_LEVEL *printer = NULL; - /* lookup the long printer driver name in the file description */ - for (i=0;lines[i] && !ok;i++) - { - p = lines[i]; - if (next_token(&p,tok,":",sizeof(tok)) && - (strlen(drivername) == strlen(tok)) && - (!strncmp(tok,drivername,strlen(drivername)))) - { - ok = True; - } - } + if ( !W_ERROR_IS_OK(get_a_printer( &printer, 2, lp_servicename(snum))) ) { + DEBUG(3,("get_printerdrivernumber: Failed to lookup printer [%s]\n", + lp_servicename(snum))); + goto done; } - - if( ok ) - { - /* skip 5 fields */ - i = 5; - while (*p && i) { - if (*p++ == ':') i--; - } - if (!*p || i) { - DEBUG(3,("Can't determine number of printer driver files\n")); - goto done; - } - /* count the number of files */ - while (next_token(&p,tok,",",sizeof(tok))) - i++; - - result = i; + if ( !W_ERROR_IS_OK(get_a_printer_driver(&driver, 3, printer->info_2->drivername, + "Windows 4.0", 0)) ) + { + DEBUG(3,("get_printerdrivernumber: Failed to lookup driver [%s]\n", + printer->info_2->drivername)); + goto done; } - + + /* count the number of files */ + while ( driver.info_3->dependentfiles && *driver.info_3->dependentfiles[result] ) + result++; + \ done: - - file_lines_free(lines); - + if ( printer ) + free_a_printer( &printer, 2 ); + + if ( driver.info_3 ) + free_a_printer_driver( driver, 3 ); + return result; } -- cgit From 2d19a6550bd1dc41fcd9f198fcee18a2e56b6e56 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 Oct 2002 20:31:59 +0000 Subject: pdb_unix.c did not really expect group RIDs dictated by a PDC and looking like user RIDs. Volker (This used to be commit 872c7d40454545108ec9e7eee12894af77b4adc3) --- source3/passdb/pdb_unix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source3/passdb/pdb_unix.c b/source3/passdb/pdb_unix.c index f5bbeb4ba3..8acc29b7a4 100644 --- a/source3/passdb/pdb_unix.c +++ b/source3/passdb/pdb_unix.c @@ -48,7 +48,7 @@ static NTSTATUS unixsam_getsampwrid (struct pdb_methods *methods, SAM_ACCOUNT *user, uint32 rid) { NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - struct passwd *pass; + struct passwd *pass = NULL; const char *guest_account = lp_guestaccount(); if (!(guest_account && *guest_account)) { DEBUG(1, ("NULL guest account!?!?\n")); @@ -68,7 +68,9 @@ static NTSTATUS unixsam_getsampwrid (struct pdb_methods *methods, } } else if (pdb_rid_is_user(rid)) { pass = getpwuid_alloc(fallback_pdb_user_rid_to_uid (rid)); - } else { + } + + if (pass == NULL) { return nt_status; } -- cgit From c7731c988ed289952310f4bec19f6afdb6c1d1fc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 Oct 2002 20:33:00 +0000 Subject: Same segfault as in add_groupmem. Volker (This used to be commit 1f702dcd2ced6f64a619e3ddbb570f41f7f0986b) --- source3/rpc_server/srv_samr_nt.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index 1db3f60c87..1bdfefff65 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -3414,19 +3414,21 @@ NTSTATUS _samr_add_aliasmem(pipes_struct *p, SAMR_Q_ADD_ALIASMEM *q_u, SAMR_R_AD if ((pwd=getpwuid_alloc(uid)) == NULL) { return NT_STATUS_NO_SUCH_USER; - } else { - passwd_free(&pwd); } - if ((grp=getgrgid(map.gid)) == NULL) + if ((grp=getgrgid(map.gid)) == NULL) { + passwd_free(&pwd); return NT_STATUS_NO_SUCH_ALIAS; + } /* we need to copy the name otherwise it's overloaded in user_in_group_list */ fstrcpy(grp_name, grp->gr_name); /* if the user is already in the group */ - if(user_in_group_list(pwd->pw_name, grp_name)) + if(user_in_group_list(pwd->pw_name, grp_name)) { + passwd_free(&pwd); return NT_STATUS_MEMBER_IN_ALIAS; + } /* * ok, the group exist, the user exist, the user is not in the group, @@ -3435,9 +3437,12 @@ NTSTATUS _samr_add_aliasmem(pipes_struct *p, SAMR_Q_ADD_ALIASMEM *q_u, SAMR_R_AD smb_add_user_group(grp_name, pwd->pw_name); /* check if the user has been added then ... */ - if(!user_in_group_list(pwd->pw_name, grp_name)) + if(!user_in_group_list(pwd->pw_name, grp_name)) { + passwd_free(&pwd); return NT_STATUS_MEMBER_NOT_IN_ALIAS; /* don't know what to reply else */ + } + passwd_free(&pwd); return NT_STATUS_OK; } -- cgit From 5324adb825c406360ee1482c6413cee9d63bfb40 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 21 Oct 2002 21:21:33 +0000 Subject: Fixed bug in session setup kwlist. Added some basic error handling. Just throw a RuntimeError exception on error. (This used to be commit 06caeed588f702814be76a2b2aa7ed43504adef5) --- source3/python/py_smb.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/source3/python/py_smb.c b/source3/python/py_smb.c index c9ac24659d..85f7792047 100644 --- a/source3/python/py_smb.c +++ b/source3/python/py_smb.c @@ -97,7 +97,7 @@ static PyObject *py_smb_session_setup(PyObject *self, PyObject *args, PyObject *kw) { cli_state_object *cli = (cli_state_object *)self; - static char *kwlist[] = { "creds" }; + static char *kwlist[] = { "creds", NULL }; PyObject *creds; char *username, *domain, *password, *errstr; BOOL result; @@ -114,6 +114,11 @@ static PyObject *py_smb_session_setup(PyObject *self, PyObject *args, cli->cli, username, password, strlen(password) + 1, password, strlen(password) + 1, domain); + if (cli_is_error(cli->cli)) { + PyErr_SetString(PyExc_RuntimeError, "session setup failed"); + return NULL; + } + return Py_BuildValue("i", result); } @@ -131,6 +136,11 @@ static PyObject *py_smb_tconx(PyObject *self, PyObject *args, PyObject *kw) cli->cli, service, strequal(service, "IPC$") ? "IPC" : "?????", "", 1); + if (cli_is_error(cli->cli)) { + PyErr_SetString(PyExc_RuntimeError, "tconx failed"); + return NULL; + } + return Py_BuildValue("i", result); } @@ -159,6 +169,11 @@ static PyObject *py_smb_nt_create_andx(PyObject *self, PyObject *args, cli->cli, filename, desired_access, file_attributes, share_access, create_disposition, create_options); + if (cli_is_error(cli->cli)) { + PyErr_SetString(PyExc_RuntimeError, "nt_create_andx failed"); + return NULL; + } + /* Return FID */ return PyInt_FromLong(result); @@ -184,7 +199,10 @@ static PyObject *py_smb_query_secdesc(PyObject *self, PyObject *args, secdesc = cli_query_secdesc(cli->cli, fnum, mem_ctx); - /* FIXME: we should raise an exception here */ + if (cli_is_error(cli->cli)) { + PyErr_SetString(PyExc_RuntimeError, "query_secdesc failed"); + return NULL; + } if (!secdesc) { Py_INCREF(Py_None); @@ -232,6 +250,11 @@ static PyObject *py_smb_set_secdesc(PyObject *self, PyObject *args, result = cli_set_secdesc(cli->cli, fnum, secdesc); + if (cli_is_error(cli->cli)) { + PyErr_SetString(PyExc_RuntimeError, "set_secdesc failed"); + return NULL; + } + return PyInt_FromLong(result); } -- cgit From c166b812a9d1733a8aec896884c37c6bdc73f070 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 22 Oct 2002 16:10:45 +0000 Subject: Some was asking to look at this code, so better it stay there until we decide what to do with it. Last updates are support for the right way to support privileges. Simo. (This used to be commit cae9074405dec5baf6bd34d48f36e2c81b24d2ea) --- source3/include/gums.h | 224 +++++++++++++ source3/sam/gumm_tdb.c | 70 ++++ source3/sam/gums.c | 131 ++++++++ source3/sam/gums_api.c | 814 ++++++++++++++++++++++++++++++++++++++++++++++ source3/sam/gums_helper.c | 607 ++++++++++++++++++++++++++++++++++ 5 files changed, 1846 insertions(+) create mode 100644 source3/include/gums.h create mode 100644 source3/sam/gumm_tdb.c create mode 100644 source3/sam/gums.c create mode 100644 source3/sam/gums_api.c create mode 100644 source3/sam/gums_helper.c diff --git a/source3/include/gums.h b/source3/include/gums.h new file mode 100644 index 0000000000..d1799f377d --- /dev/null +++ b/source3/include/gums.h @@ -0,0 +1,224 @@ +/* + Unix SMB/CIFS implementation. + GUMS structures + Copyright (C) Simo Sorce 2002 + + 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. +*/ + +#ifndef _GUMS_H +#define _GUMS_H + +#define GUMS_VERSION_MAJOR 0 +#define GUMS_VERSION_MINOR 1 + +#define GUMS_OBJ_NORMAL_USER 1 +#define GUMS_OBJ_GROUP 2 +#define GUMS_OBJ_DOMAIN 3 +#define GUMS_OBJ_ALIAS 4 +#define GUMS_OBJ_WORKSTATION_TRUST 5 +#define GUMS_OBJ_SERVER_TRUST 6 +#define GUMS_OBJ_DOMAIN_TRUST 7 + +typedef struct gums_object +{ + TALLOC_CTX *mem_ctx; + + uint32 type; /* Object Type */ + uint32 version; /* Object Version */ + uint32 seq_num; /* Object Sequence Number */ + + SEC_DESC *sec_desc; /* Security Descriptor */ + + DOM_SID *sid; /* Object Sid */ + char *name; /* Object Name */ + char *description; /* Object Description */ + + void *data; /* Object Specific data */ + +} GUMS_OBJECT; + +typedef struct gums_user +{ + DOM_SID *group_sid; /* Primary Group SID */ + + NTTIME *logon_time; /* logon time */ + NTTIME *logoff_time; /* logoff time */ + NTTIME *kickoff_time; /* kickoff time */ + NTTIME *pass_last_set_time; /* password last set time */ + NTTIME *pass_can_change_time; /* password can change time */ + NTTIME *pass_must_change_time; /* password must change time */ + + char *full_name; /* user's full name string */ + char *home_dir; /* home directory string */ + char *dir_drive; /* home directory drive string */ + char *logon_script; /* logon script string */ + char *profile_path; /* profile path string */ + char *workstations; /* login from workstations string */ + char *unknown_str; /* don't know what this is, yet. */ + char *munged_dial; /* munged path name and dial-back tel number */ + + DATA_BLOB *lm_pw; /* .data is Null if no password */ + DATA_BLOB *nt_pw; /* .data is Null if no password */ + + uint32 unknown_3; /* 0x00ff ffff */ + + uint16 logon_divs; /* 168 - number of hours in a week */ + uint32 hours_len; /* normally 21 bytes */ + uint8 hours[MAX_HOURS_LEN]; + + uint32 unknown_5; /* 0x0002 0000 */ + uint32 unknown_6; /* 0x0000 04ec */ + +} GUMS_USER; + +typedef struct gums_group +{ + uint32 count; /* Number of SIDs */ + DOM_SID *members; /* SID array */ + +} GUMS_GROUP; + +typedef struct gums_data_set +{ + int type; /* GUMS_SET_xxx */ + void *data; + +} GUMS_DATA_SET; + +typedef struct gums_commit_set +{ + TALLOC_CTX *mem_ctx; + + uint32 type; /* Object type */ + DOM_SID sid; /* Object Sid */ + uint32 count; /* number of changes */ + GUMS_DATA_SET *data; +} GUMS_COMMIT_SET; + +typedef struct gums_privilege +{ + TALLOC_CTX *mem_ctx; + + uint32 type; /* Object Type */ + uint32 version; /* Object Version */ + uint32 seq_num; /* Object Sequence Number */ + + LUID_ATTR *privilege; /* Privilege Type */ + char *name; /* Object Name */ + char *description; /* Object Description */ + + uint32 count; + DOM_SID *members; + +} GUMS_PRIVILEGE; + + +typedef struct gums_functions +{ + /* Generic object functions */ + + NTSTATUS (*get_domain_sid) (DOM_SID **sid, const char* name); + NTSTATUS (*set_domain_sid) (const DOM_SID *sid); + + NTSTATUS (*get_sequence_number) (void); + + NTSTATUS (*new_object) (DOM_SID **sid, const char *name, const int obj_type); + NTSTATUS (*delete_object) (const DOM_SID *sid); + + NTSTATUS (*get_object_from_sid) (GUMS_OBJECT **object, const DOM_SID *sid, const int obj_type); + NTSTATUS (*get_sid_from_name) (GUMS_OBJECT **object, const char *name); + /* This function is used to get the list of all objects changed since b_time, it is + used to support PDC<->BDC synchronization */ + NTSTATUS (*get_updated_objects) (GUMS_OBJECT **objects, const NTTIME base_time); + + NTSTATUS (*enumerate_objects_start) (void *handle, const DOM_SID *sid, const int obj_type); + NTSTATUS (*enumerate_objects_get_next) (GUMS_OBJECT **object, void *handle); + NTSTATUS (*enumerate_objects_stop) (void *handle); + + /* This function MUST be used ONLY by PDC<->BDC replication code or recovery tools. + Never use this function to update an object in the database, use set_object_values() */ + NTSTATUS (*set_object) (const GUMS_OBJECT *object); + + /* set object values function */ + NTSTATUS (*set_object_values) (DOM_SID *sid, uint32 count, GUMS_DATA_SET *data_set); + + /* Group related functions */ + NTSTATUS (*add_memberss_to_group) (const DOM_SID *group, const DOM_SID **members); + NTSTATUS (*delete_members_from_group) (const DOM_SID *group, const DOM_SID **members); + NTSTATUS (*enumerate_group_members) (DOM_SID **members, const DOM_SID *sid, const int type); + + NTSTATUS (*get_sid_groups) (DOM_SID **groups, const DOM_SID *sid); + + NTSTATUS (*lock_sid) (const DOM_SID *sid); + NTSTATUS (*unlock_sid) (const DOM_SID *sid); + + /* privileges related functions */ + + NTSTATUS (*add_members_to_privilege) (const LUID_ATTR *priv, const DOM_SID **members); + NTSTATUS (*delete_members_from_privilege) (const LUID_ATTR *priv, const DOM_SID **members); + NTSTATUS (*enumerate_privilege_members) (DOM_SID **members, const LUID_ATTR *priv); + NTSTATUS (*get_sid_privileges) (DOM_SID **privs, const DOM_SID *sid); + /* warning!: set_privilege will overwrite a prior existing privilege if such exist */ + NTSTATUS (*set_privilege) (GUMS_PRIVILEGE *priv); + +} GUMS_FUNCTIONS; + +/* define value types */ + +#define GUMS_SET_PRIMARY_GROUP 1 +#define GUMS_SET_SEC_DESC 2 + +/* user specific type values */ +#define GUMS_SET_LOGON_TIME 10 /* keep NTTIME consecutive */ +#define GUMS_SET_LOGOFF_TIME 11 /* too ease checking */ +#define GUMS_SET_KICKOFF_TIME 13 +#define GUMS_SET_PASS_LAST_SET_TIME 14 +#define GUMS_SET_PASS_CAN_CHANGE_TIME 15 +#define GUMS_SET_PASS_MUST_CHANGE_TIME 16 /* NTTIME end */ + +#define GUMS_SET_NAME 20 /* keep strings consecutive */ +#define GUMS_SET_DESCRIPTION 21 /* too ease checking */ +#define GUMS_SET_FULL_NAME 22 +#define GUMS_SET_HOME_DIRECTORY 23 +#define GUMS_SET_DRIVE 24 +#define GUMS_SET_LOGON_SCRIPT 25 +#define GUMS_SET_PROFILE_PATH 26 +#define GUMS_SET_WORKSTATIONS 27 +#define GUMS_SET_UNKNOWN_STRING 28 +#define GUMS_SET_MUNGED_DIAL 29 /* strings end */ + +#define GUMS_SET_LM_PASSWORD 40 +#define GUMS_SET_NT_PASSWORD 41 +#define GUMS_SET_PLAINTEXT_PASSWORD 42 +#define GUMS_SET_UNKNOWN_3 43 +#define GUMS_SET_LOGON_DIVS 44 +#define GUMS_SET_HOURS_LEN 45 +#define GUMS_SET_HOURS 46 +#define GUMS_SET_UNKNOWN_5 47 +#define GUMS_SET_UNKNOWN_6 48 + +#define GUMS_SET_MUST_CHANGE_PASS 50 +#define GUMS_SET_CANNOT_CHANGE_PASS 51 +#define GUMS_SET_PASS_NEVER_EXPIRE 52 +#define GUMS_SET_ACCOUNT_DISABLED 53 +#define GUMS_SET_ACCOUNT_LOCKOUT 54 + +/*group specific type values */ +#define GUMS_ADD_SID_LIST 60 +#define GUMS_DEL_SID_LIST 61 +#define GUMS_SET_SID_LIST 62 + +#endif /* _GUMS_H */ diff --git a/source3/sam/gumm_tdb.c b/source3/sam/gumm_tdb.c new file mode 100644 index 0000000000..967890e99c --- /dev/null +++ b/source3/sam/gumm_tdb.c @@ -0,0 +1,70 @@ +/* + * Unix SMB/CIFS implementation. + * SMB parameters and setup + * Copyright (C) Andrew Tridgell 1992-1998 + * Copyright (C) Simo Sorce 2000-2002 + * Copyright (C) Gerald Carter 2000 + * Copyright (C) Jeremy Allison 2001 + * Copyright (C) Andrew Bartlett 2002 + * + * 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" + +static int tdbgumm_debug_level = DBGC_ALL; +#undef DBGC_CLASS +#define DBGC_CLASS tdbgumm_debug_level + +#define GUMM_VERSION "20021012" +#define TDB_FILE_NAME "gums_storage.tdb" +#define TDB_FORMAT_STRING "B" +#define DOMAIN_PREFIX "DOMAIN_" +#define USER_PREFIX "USER_" +#define GROUP_PREFIX "GROUP_" +#define SID_PREFIX "SID_" + +static TDB_CONTEXT *gumm_tdb = NULL; + +/*************************************************************** + objects enumeration. +****************************************************************/ + +static NTSTATUS enumerate_objects(DOM_SID **sids, const DOM_SID *sid, const int obj_type); +{ + TDB_CONTEXT *enum_tdb = NULL; + TDB_DATA key; + + /* Open tdb gums module */ + if (!(enum_tdb = tdb_open_log(TDB_FILE_NAME, 0, TDB_DEFAULT, update?(O_RDWR|O_CREAT):O_RDONLY, 0600))) + { + DEBUG(0, ("Unable to open/create gumm tdb database\n")); + return NT_STATUS_UNSUCCESSFUL; + } + + enum_key = tdb_firstkey(enum_tdb); + + + + tdb_close(enum_tdb); + + return NT_STATUS_OK; +} + + +static NTSTATUS module_init() +{ +} + diff --git a/source3/sam/gums.c b/source3/sam/gums.c new file mode 100644 index 0000000000..41218cee36 --- /dev/null +++ b/source3/sam/gums.c @@ -0,0 +1,131 @@ +/* + Unix SMB/CIFS implementation. + Grops and Users Management System initializations. + Copyright (C) Simo Sorce 2002 + + 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" + +/*#undef DBGC_CLASS +#define DBGC_CLASS DBGC_GUMS*/ + +#define GMV_MAJOR 0 +#define GMV_MINOR 1 + +GUMS_FUNCTIONS *gums_storage; +static void *dl_handle; + +PRIVS privs[] = { + {PRIV_NONE, "no_privs", "No privilege"}, /* this one MUST be first */ + {PRIV_CREATE_TOKEN, "SeCreateToken", "Create Token"}, + {PRIV_ASSIGNPRIMARYTOKEN, "SeAssignPrimaryToken", "Assign Primary Token"}, + {PRIV_LOCK_MEMORY, "SeLockMemory", "Lock Memory"}, + {PRIV_INCREASE_QUOTA, "SeIncreaseQuotaPrivilege", "Increase Quota Privilege"}, + {PRIV_MACHINE_ACCOUNT, "SeMachineAccount", "Machine Account"}, + {PRIV_TCB, "SeTCB", "TCB"}, + {PRIV_SECURITY, "SeSecurityPrivilege", "Security Privilege"}, + {PRIV_TAKE_OWNERSHIP, "SeTakeOwnershipPrivilege", "Take Ownership Privilege"}, + {PRIV_LOAD_DRIVER, "SeLocalDriverPrivilege", "Local Driver Privilege"}, + {PRIV_SYSTEM_PROFILE, "SeSystemProfilePrivilege", "System Profile Privilege"}, + {PRIV_SYSTEMTIME, "SeSystemtimePrivilege", "System Time"}, + {PRIV_PROF_SINGLE_PROCESS, "SeProfileSingleProcessPrivilege", "Profile Single Process Privilege"}, + {PRIV_INC_BASE_PRIORITY, "SeIncreaseBasePriorityPrivilege", "Increase Base Priority Privilege"}, + {PRIV_CREATE_PAGEFILE, "SeCreatePagefilePrivilege", "Create Pagefile Privilege"}, + {PRIV_CREATE_PERMANENT, "SeCreatePermanent", "Create Permanent"}, + {PRIV_BACKUP, "SeBackupPrivilege", "Backup Privilege"}, + {PRIV_RESTORE, "SeRestorePrivilege", "Restore Privilege"}, + {PRIV_SHUTDOWN, "SeShutdownPrivilege", "Shutdown Privilege"}, + {PRIV_DEBUG, "SeDebugPrivilege", "Debug Privilege"}, + {PRIV_AUDIT, "SeAudit", "Audit"}, + {PRIV_SYSTEM_ENVIRONMENT, "SeSystemEnvironmentPrivilege", "System Environment Privilege"}, + {PRIV_CHANGE_NOTIFY, "SeChangeNotify", "Change Notify"}, + {PRIV_REMOTE_SHUTDOWN, "SeRemoteShutdownPrivilege", "Remote Shutdown Privilege"}, + {PRIV_UNDOCK, "SeUndock", "Undock"}, + {PRIV_SYNC_AGENT, "SeSynchronizationAgent", "Synchronization Agent"}, + {PRIV_ENABLE_DELEGATION, "SeEnableDelegation", "Enable Delegation"}, + {PRIV_ALL, "SaAllPrivs", "All Privileges"} +}; + +NTSTATUS gums_init(const char *module_name) +{ + int (*module_version)(int); + NTSTATUS (*module_init)(); +/* gums_module_init module_init;*/ + NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; + + DEBUG(5, ("Opening gums module %s\n", module_name)); + dl_handle = sys_dlopen(module_name, RTLD_NOW); + if (!dl_handle) { + DEBUG(0, ("ERROR: Failed to load gums module %s, error: %s\n", module_name, sys_dlerror())); + return NT_STATUS_UNSUCCESSFUL; + } + + module_version = sys_dlsym(dl_handle, "gumm_version"); + if (!module_version) { + DEBUG(0, ("ERROR: Failed to find gums module version!\n")); + goto error; + } + + if (module_version(GMV_MAJOR) != GUMS_VERSION_MAJOR) { + DEBUG(0, ("ERROR: Module's major version does not match gums version!\n")); + goto error; + } + + if (module_version(GMV_MINOR) != GUMS_VERSION_MINOR) { + DEBUG(1, ("WARNING: Module's minor version does not match gums version!\n")); + } + + module_open = sys_dlsym(dl_handle, "gumm_init"); + if (!module_open) { + DEBUG(0, ("ERROR: Failed to find gums module's init function!\n")); + goto error; + } + + DEBUG(5, ("Initializing module %s\n", module_name)); + + ret = module_init(&gums_storage); + goto done; + +error: + ret = NT_STATUS_UNSUCCESSFUL; + sys_dlclose(dl_handle); + +done: + return ret; +} + +NTSTATUS gums_unload(void) +{ + NSTATUS ret; + NTSTATUS (*module_finalize)(); + + if (!dl_handle) + return NT_STATUS_UNSUCCESSFUL; + + module_close = sys_dlsym(dl_handle, "gumm_finalize"); + if (!module_finalize) { + DEBUG(0, ("ERROR: Failed to find gums module's init function!\n")); + return NT_STATUS_UNSUCCESSFUL; + } + + DEBUG(5, ("Finalizing module %s\n", module_name)); + + ret = module_finalize(); + sys_dlclose(dl_handle); +3 + return ret; +} diff --git a/source3/sam/gums_api.c b/source3/sam/gums_api.c new file mode 100644 index 0000000000..c6c8402c93 --- /dev/null +++ b/source3/sam/gums_api.c @@ -0,0 +1,814 @@ +/* + Unix SMB/CIFS implementation. + GUMS structures + Copyright (C) Simo Sorce 2002 + + 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" + +extern GUMS_FUNCTIONS *gums_storage; + +/* Functions to get info from a GUMS object */ + +NTSTATUS gums_get_object_type(uint32 *type, const GUMS_OBJECT *obj) +{ + *type = obj->type; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_object_seq_num(uint32 *version, const GUMS_OBJECT *obj) +{ + *version = obj->version; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_sec_desc(SEC_DESC **sec_desc, const GUMS_OBJECT *obj) +{ + *sec_desc = obj->sec_desc; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_object_sid(DOM_SID **sid, const GUMS_OBJECT *obj) +{ + *sid = obj->sid; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_object_name(char **name, const GUMS_OBJECT *obj) +{ + *name = obj->name; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_object_description(char **description, const GUMS_OBJECT *obj) +{ + *description = obj->description; + return NT_STATUS_OK; +} + +/* User specific functions */ + +NTSTATUS gums_get_object_privileges(PRIVILEGE_SET **priv_set, const GUMS_OBJECT *obj) +{ + if (!priv_set) + return NT_STATUS_INVALID_PARAMETER; + + *priv_set = obj->priv_set; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_pri_group(DOM_SID **sid, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!sid) + return NT_STATUS_INVALID_PARAMETER; + + *sid = ((GUMS_USER *)(obj->data))->group_sid; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_nt_pwd(DATA_BLOB **nt_pwd, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!nt_pwd) + return NT_STATUS_INVALID_PARAMETER; + + *nt_pwd = ((GUMS_USER *)(obj->data))->nt_pw; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_lm_pwd(DATA_BLOB **lm_pwd, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!lm_pwd) + return NT_STATUS_INVALID_PARAMETER; + + *lm_pwd = ((GUMS_USER *)(obj->data))->lm_pw; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_fullname(char **fullname, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!fullname) + return NT_STATUS_INVALID_PARAMETER; + + *fullname = ((GUMS_USER *)(obj->data))->full_name; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_homedir(char **homedir, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!homedir) + return NT_STATUS_INVALID_PARAMETER; + + *homedir = ((GUMS_USER *)(obj->data))->home_dir; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_dir_drive(char **dirdrive, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!dirdrive) + return NT_STATUS_INVALID_PARAMETER; + + *dirdrive = ((GUMS_USER *)(obj->data))->dir_drive; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_logon_script(char **logon_script, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!logon_script) + return NT_STATUS_INVALID_PARAMETER; + + *logon_script = ((GUMS_USER *)(obj->data))->logon_script; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_profile_path(char **profile_path, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!profile_path) + return NT_STATUS_INVALID_PARAMETER; + + *profile_path = ((GUMS_USER *)(obj->data))->profile_path; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_workstations(char **workstations, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!workstations) + return NT_STATUS_INVALID_PARAMETER; + + *workstations = ((GUMS_USER *)(obj->data))->workstations; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_unknown_str(char **unknown_str, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!unknown_str) + return NT_STATUS_INVALID_PARAMETER; + + *unknown_str = ((GUMS_USER *)(obj->data))->unknown_str; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_munged_dial(char **munged_dial, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!munged_dial) + return NT_STATUS_INVALID_PARAMETER; + + *munged_dial = ((GUMS_USER *)(obj->data))->munged_dial; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_logon_time(NTTIME **logon_time, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!logon_time) + return NT_STATUS_INVALID_PARAMETER; + + *logon_time = ((GUMS_USER *)(obj->data))->logon_time; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_logoff_time(NTTIME **logoff_time, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!logoff_time) + return NT_STATUS_INVALID_PARAMETER; + + *logoff_time = ((GUMS_USER *)(obj->data))->logoff_time; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_kickoff_time(NTTIME **kickoff_time, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!kickoff_time) + return NT_STATUS_INVALID_PARAMETER; + + *kickoff_time = ((GUMS_USER *)(obj->data))->kickoff_time; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_pass_last_set_time(NTTIME **pass_last_set_time, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!pass_last_set_time) + return NT_STATUS_INVALID_PARAMETER; + + *pass_last_set_time = ((GUMS_USER *)(obj->data))->pass_last_set_time; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_pass_can_change_time(NTTIME **pass_can_change_time, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!pass_can_change_time) + return NT_STATUS_INVALID_PARAMETER; + + *pass_can_change_time = ((GUMS_USER *)(obj->data))->pass_can_change_time; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_pass_must_change_time(NTTIME **pass_must_change_time, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!pass_must_change_time) + return NT_STATUS_INVALID_PARAMETER; + + *pass_must_change_time = ((GUMS_USER *)(obj->data))->pass_must_change_time; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_logon_divs(uint16 *logon_divs, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!logon_divs) + return NT_STATUS_INVALID_PARAMETER; + + *logon_divs = ((GUMS_USER *)(obj->data))->logon_divs; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_hours_len(uint32 *hours_len, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!hours_len) + return NT_STATUS_INVALID_PARAMETER; + + *hours_len = ((GUMS_USER *)(obj->data))->hours_len; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_hours(uint8 **hours, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!hours) + return NT_STATUS_INVALID_PARAMETER; + + *hours = ((GUMS_USER *)(obj->data))->hours; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_unknown_3(uint32 *unknown3, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!unknown3) + return NT_STATUS_INVALID_PARAMETER; + + *unknown3 = ((GUMS_USER *)(obj->data))->unknown_3; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_unknown_5(uint32 *unknown5, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!unknown5) + return NT_STATUS_INVALID_PARAMETER; + + *unknown5 = ((GUMS_USER *)(obj->data))->unknown_5; + return NT_STATUS_OK; +} + +NTSTATUS gums_get_user_unknown_6(uint32 *unknown6, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!unknown6) + return NT_STATUS_INVALID_PARAMETER; + + *unknown6 = ((GUMS_USER *)(obj->data))->unknown_6; + return NT_STATUS_OK; +} + +/* Group specific functions */ + +NTSTATUS gums_get_group_members(uint32 *count, DOM_SID **members, const GUMS_OBJECT *obj) +{ + if (obj->type != GUMS_OBJ_GROUP && + obj->type != GUMS_OBJ_ALIAS) + return NT_STATUS_OBJECT_TYPE_MISMATCH; + if (!members) + return NT_STATUS_INVALID_PARAMETER; + + *count = ((GUMS_GROUP *)(obj->data))->count; + *members = ((GUMS_GROUP *)(obj->data))->members; + return NT_STATUS_OK; +} + +/* set functions */ + +NTSTATUS gums_create_data_set(GUMS_COMMIT_SET **com_set, TALLOC_CTX *ctx, DOM_SID *sid, uint32 type) +{ + TALLOC_CTX *mem_ctx; + GUMS_COMMIT_SET *set; + + mem_ctx = talloc_init_named("commit_set"); + if (mem_ctx == NULL) + return NT_STATUS_NO_MEMORY; + set = (GUMS_COMMIT_SET *)talloc(mem_ctx, sizeof(GUMS_COMMIT_SET)); + if (set == NULL) { + talloc_destroy(mem_ctx); + return NT_STATUS_NO_MEMORY; + } + + set->mem_ctx = mem_ctx; + set->type = type; + sid_copy(&(set->sid), sid); + set->count = 0; + set->data = NULL; + *com_set = set; + + return NT_STATUS_OK; +} + +NTSTATUS gums_set_sec_desc(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, SEC_DESC *sec_desc) +{ + GUMS_DATA_SET *data_set; + SEC_DESC *new_sec_desc; + + if (!mem_ctx || !com_set || !sec_desc) + return NT_STATUS_INVALID_PARAMETER; + + com_set->count = com_set->count + 1; + if (com_set->count == 1) { /* first data set */ + data_set = (GUMS_DATA_SET *)talloc(mem_ctx, sizeof(GUMS_DATA_SET)); + } else { + data_set = (GUMS_DATA_SET *)talloc_realloc(mem_ctx, com_set->data, sizeof(GUMS_DATA_SET) * com_set->count); + } + if (data_set == NULL) + return NT_STATUS_NO_MEMORY; + + com_set->data = data_set; + data_set = &((com_set->data)[com_set->count - 1]); + + data_set->type = GUMS_SET_SEC_DESC; + new_sec_desc = dup_sec_desc(mem_ctx, sec_desc); + if (new_sec_desc == NULL) + return NT_STATUS_NO_MEMORY; + + (SEC_DESC *)(data_set->data) = new_sec_desc; + + return NT_STATUS_OK; +} + +NTSTATUS gums_add_privilege(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, LUID_ATTR priv) +{ + GUMS_DATA_SET *data_set; + LUID_ATTR *new_priv; + + if (!mem_ctx || !com_set) + return NT_STATUS_INVALID_PARAMETER; + + com_set->count = com_set->count + 1; + if (com_set->count == 1) { /* first data set */ + data_set = (GUMS_DATA_SET *)talloc(mem_ctx, sizeof(GUMS_DATA_SET)); + } else { + data_set = (GUMS_DATA_SET *)talloc_realloc(mem_ctx, com_set->data, sizeof(GUMS_DATA_SET) * com_set->count); + } + if (data_set == NULL) + return NT_STATUS_NO_MEMORY; + + com_set->data = data_set; + data_set = &((com_set->data)[com_set->count - 1]); + + data_set->type = GUMS_ADD_PRIVILEGE; + if (NT_STATUS_IS_ERR(dupalloc_luid_attr(mem_ctx, &new_priv, priv))) + return NT_STATUS_NO_MEMORY; + + (SEC_DESC *)(data_set->data) = new_priv; + + return NT_STATUS_OK; +} + +NTSTATUS gums_del_privilege(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, LUID_ATTR priv) +{ + GUMS_DATA_SET *data_set; + LUID_ATTR *new_priv; + + if (!mem_ctx || !com_set) + return NT_STATUS_INVALID_PARAMETER; + + com_set->count = com_set->count + 1; + if (com_set->count == 1) { /* first data set */ + data_set = (GUMS_DATA_SET *)talloc(mem_ctx, sizeof(GUMS_DATA_SET)); + } else { + data_set = (GUMS_DATA_SET *)talloc_realloc(mem_ctx, com_set->data, sizeof(GUMS_DATA_SET) * com_set->count); + } + if (data_set == NULL) + return NT_STATUS_NO_MEMORY; + + com_set->data = data_set; + data_set = &((com_set->data)[com_set->count - 1]); + + data_set->type = GUMS_DEL_PRIVILEGE; + if (NT_STATUS_IS_ERR(dupalloc_luid_attr(mem_ctx, &new_priv, priv))) + return NT_STATUS_NO_MEMORY; + + (SEC_DESC *)(data_set->data) = new_priv; + + return NT_STATUS_OK; +} + +NTSTATUS gums_set_privilege_set(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, PRIVILEGE_SET *priv_set) +{ + GUMS_DATA_SET *data_set; + PRIVILEGE_SET *new_priv_set; + + if (!mem_ctx || !com_set || !priv_set) + return NT_STATUS_INVALID_PARAMETER; + + com_set->count = com_set->count + 1; + if (com_set->count == 1) { /* first data set */ + data_set = (GUMS_DATA_SET *)talloc(mem_ctx, sizeof(GUMS_DATA_SET)); + } else { + data_set = (GUMS_DATA_SET *)talloc_realloc(mem_ctx, com_set->data, sizeof(GUMS_DATA_SET) * com_set->count); + } + if (data_set == NULL) + return NT_STATUS_NO_MEMORY; + + com_set->data = data_set; + data_set = &((com_set->data)[com_set->count - 1]); + + data_set->type = GUMS_SET_SEC_DESC; + if (NT_STATUS_IS_ERR(dup_priv_set(&new_priv_set, mem_ctx, priv_set))) + return NT_STATUS_NO_MEMORY; + + (SEC_DESC *)(data_set->data) = new_priv_set; + + return NT_STATUS_OK; +} + +NTSTATUS gums_set_string(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, uint32 type, char *str) +{ + GUMS_DATA_SET *data_set; + char *new_str; + + if (!mem_ctx || !com_set || !str || type < GUMS_SET_NAME || type > GUMS_SET_MUNGED_DIAL) + return NT_STATUS_INVALID_PARAMETER; + + com_set->count = com_set->count + 1; + if (com_set->count == 1) { /* first data set */ + data_set = (GUMS_DATA_SET *)talloc(mem_ctx, sizeof(GUMS_DATA_SET)); + } else { + data_set = (GUMS_DATA_SET *)talloc_realloc(mem_ctx, com_set->data, sizeof(GUMS_DATA_SET) * com_set->count); + } + if (data_set == NULL) + return NT_STATUS_NO_MEMORY; + + com_set->data = data_set; + data_set = &((com_set->data)[com_set->count - 1]); + + data_set->type = type; + new_str = talloc_strdup(mem_ctx, str); + if (new_str == NULL) + return NT_STATUS_NO_MEMORY; + + (char *)(data_set->data) = new_str; + + return NT_STATUS_OK; +} + +NTSTATUS gums_set_name(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, char *name) +{ + return gums_set_string(mem_ctx, com_set, GUMS_SET_NAME, name); +} + +NTSTATUS gums_set_description(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, char *desc) +{ + return gums_set_string(mem_ctx, com_set, GUMS_SET_DESCRIPTION, desc); +} + +NTSTATUS gums_set_full_name(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, char *full_name) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_string(mem_ctx, com_set, GUMS_SET_NAME, full_name); +} + +NTSTATUS gums_set_home_directory(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, char *home_dir) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_string(mem_ctx, com_set, GUMS_SET_NAME, home_dir); +} + +NTSTATUS gums_set_drive(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, char *drive) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_string(mem_ctx, com_set, GUMS_SET_NAME, drive); +} + +NTSTATUS gums_set_logon_script(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, char *logon_script) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_string(mem_ctx, com_set, GUMS_SET_NAME, logon_script); +} + +NTSTATUS gums_set_profile_path(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, char *prof_path) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_string(mem_ctx, com_set, GUMS_SET_NAME, prof_path); +} + +NTSTATUS gums_set_workstations(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, char *wks) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_string(mem_ctx, com_set, GUMS_SET_NAME, wks); +} + +NTSTATUS gums_set_unknown_string(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, char *unkn_str) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_string(mem_ctx, com_set, GUMS_SET_NAME, unkn_str); +} + +NTSTATUS gums_set_munged_dial(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, char *munged_dial) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_string(mem_ctx, com_set, GUMS_SET_NAME, munged_dial); +} + +NTSTATUS gums_set_nttime(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, uint32 type, NTTIME *time) +{ + GUMS_DATA_SET *data_set; + NTTIME *new_time; + + if (!mem_ctx || !com_set || !time || type < GUMS_SET_LOGON_TIME || type > GUMS_SET_PASS_MUST_CHANGE_TIME) + return NT_STATUS_INVALID_PARAMETER; + + com_set->count = com_set->count + 1; + if (com_set->count == 1) { /* first data set */ + data_set = (GUMS_DATA_SET *)talloc(mem_ctx, sizeof(GUMS_DATA_SET)); + } else { + data_set = (GUMS_DATA_SET *)talloc_realloc(mem_ctx, com_set->data, sizeof(GUMS_DATA_SET) * com_set->count); + } + if (data_set == NULL) + return NT_STATUS_NO_MEMORY; + + com_set->data = data_set; + data_set = &((com_set->data)[com_set->count - 1]); + + data_set->type = type; + new_time = talloc(mem_ctx, sizeof(NTTIME)); + if (new_time == NULL) + return NT_STATUS_NO_MEMORY; + + new_time->low = time->low; + new_time->high = time->high; + (char *)(data_set->data) = new_time; + + return NT_STATUS_OK; +} + +NTSTATUS gums_set_logon_time(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, NTTIME *logon_time) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_nttime(mem_ctx, com_set, GUMS_SET_LOGON_TIME, logon_time); +} + +NTSTATUS gums_set_logoff_time(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, NTTIME *logoff_time) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_nttime(mem_ctx, com_set, GUMS_SET_LOGOFF_TIME, logoff_time); +} + +NTSTATUS gums_set_kickoff_time(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, NTTIME *kickoff_time) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_nttime(mem_ctx, com_set, GUMS_SET_KICKOFF_TIME, kickoff_time); +} + +NTSTATUS gums_set_pass_last_set_time(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, NTTIME *pls_time) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_nttime(mem_ctx, com_set, GUMS_SET_LOGON_TIME, pls_time); +} + +NTSTATUS gums_set_pass_can_change_time(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, NTTIME *pcc_time) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_nttime(mem_ctx, com_set, GUMS_SET_LOGON_TIME, pcc_time); +} + +NTSTATUS gums_set_pass_must_change_time(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, NTTIME *pmc_time) +{ + if (com_set->type != GUMS_OBJ_NORMAL_USER) + return NT_STATUS_INVALID_PARAMETER; + + return gums_set_nttime(mem_ctx, com_set, GUMS_SET_LOGON_TIME, pmc_time); +} + +NTSTATUS gums_add_sids_to_group(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, const DOM_SID **sids, const uint32 count) +{ + GUMS_DATA_SET *data_set; + DOM_SID **new_sids; + int i; + + if (!mem_ctx || !com_set || !sids) + return NT_STATUS_INVALID_PARAMETER; + + com_set->count = com_set->count + 1; + if (com_set->count == 1) { /* first data set */ + data_set = (GUMS_DATA_SET *)talloc(mem_ctx, sizeof(GUMS_DATA_SET)); + } else { + data_set = (GUMS_DATA_SET *)talloc_realloc(mem_ctx, com_set->data, sizeof(GUMS_DATA_SET) * com_set->count); + } + if (data_set == NULL) + return NT_STATUS_NO_MEMORY; + + com_set->data = data_set; + data_set = &((com_set->data)[com_set->count - 1]); + + data_set->type = GUMS_ADD_SID_LIST; + new_sids = (DOM_SID **)talloc(mem_ctx, (sizeof(void *) * count)); + if (new_sids == NULL) + return NT_STATUS_NO_MEMORY; + for (i = 0; i < count; i++) { + new_sids[i] = sid_dup_talloc(mem_ctx, sids[i]); + if (new_sids[i] == NULL) + return NT_STATUS_NO_MEMORY; + } + + (SEC_DESC *)(data_set->data) = new_sids; + + return NT_STATUS_OK; +} + +NTSTATUS gums_add_users_to_group(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, const DOM_SID **sids, const uint32 count) +{ + if (!mem_ctx || !com_set || !sids) + return NT_STATUS_INVALID_PARAMETER; + if (com_set->type != GUMS_OBJ_GROUP || com_set->type != GUMS_OBJ_ALIAS) + return NT_STATUS_INVALID_PARAMETER; + + return gums_add_sids_to_group(mem_ctx, com_set, sids, count); +} + +NTSTATUS gums_add_groups_to_group(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, const DOM_SID **sids, const uint32 count) +{ + if (!mem_ctx || !com_set || !sids) + return NT_STATUS_INVALID_PARAMETER; + if (com_set->type != GUMS_OBJ_ALIAS) + return NT_STATUS_INVALID_PARAMETER; + + return gums_add_sids_to_group(mem_ctx, com_set, sids, count); +} + +NTSTATUS gums_del_sids_from_group(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, const DOM_SID **sids, const uint32 count) +{ + GUMS_DATA_SET *data_set; + DOM_SID **new_sids; + int i; + + if (!mem_ctx || !com_set || !sids) + return NT_STATUS_INVALID_PARAMETER; + if (com_set->type != GUMS_OBJ_GROUP || com_set->type != GUMS_OBJ_ALIAS) + return NT_STATUS_INVALID_PARAMETER; + + com_set->count = com_set->count + 1; + if (com_set->count == 1) { /* first data set */ + data_set = (GUMS_DATA_SET *)talloc(mem_ctx, sizeof(GUMS_DATA_SET)); + } else { + data_set = (GUMS_DATA_SET *)talloc_realloc(mem_ctx, com_set->data, sizeof(GUMS_DATA_SET) * com_set->count); + } + if (data_set == NULL) + return NT_STATUS_NO_MEMORY; + + com_set->data = data_set; + data_set = &((com_set->data)[com_set->count - 1]); + + data_set->type = GUMS_DEL_SID_LIST; + new_sids = (DOM_SID **)talloc(mem_ctx, (sizeof(void *) * count)); + if (new_sids == NULL) + return NT_STATUS_NO_MEMORY; + for (i = 0; i < count; i++) { + new_sids[i] = sid_dup_talloc(mem_ctx, sids[i]); + if (new_sids[i] == NULL) + return NT_STATUS_NO_MEMORY; + } + + (SEC_DESC *)(data_set->data) = new_sids; + + return NT_STATUS_OK; +} + +NTSTATUS gums_set_sids_in_group(TALLOC_CTX *mem_ctx, GUMS_COMMIT_SET *com_set, const DOM_SID **sids, const uint32 count) +{ + GUMS_DATA_SET *data_set; + DOM_SID **new_sids; + int i; + + if (!mem_ctx || !com_set || !sids) + return NT_STATUS_INVALID_PARAMETER; + if (com_set->type != GUMS_OBJ_GROUP || com_set->type != GUMS_OBJ_ALIAS) + return NT_STATUS_INVALID_PARAMETER; + + com_set->count = com_set->count + 1; + if (com_set->count == 1) { /* first data set */ + data_set = (GUMS_DATA_SET *)talloc(mem_ctx, sizeof(GUMS_DATA_SET)); + } else { + data_set = (GUMS_DATA_SET *)talloc_realloc(mem_ctx, com_set->data, sizeof(GUMS_DATA_SET) * com_set->count); + } + if (data_set == NULL) + return NT_STATUS_NO_MEMORY; + + com_set->data = data_set; + data_set = &((com_set->data)[com_set->count - 1]); + + data_set->type = GUMS_SET_SID_LIST; + new_sids = (DOM_SID **)talloc(mem_ctx, (sizeof(void *) * count)); + if (new_sids == NULL) + return NT_STATUS_NO_MEMORY; + for (i = 0; i < count; i++) { + new_sids[i] = sid_dup_talloc(mem_ctx, sids[i]); + if (new_sids[i] == NULL) + return NT_STATUS_NO_MEMORY; + } + + (SEC_DESC *)(data_set->data) = new_sids; + + return NT_STATUS_OK; +} + + +NTSTATUS gums_commit_data(GUMS_COMMIT_SET *set) +{ + return gums_storage->set_object_values(set->sid, set->count, set->data); +} + +NTSTATUS gums_destroy_data_set(GUMS_COMMIT_SET **com_set) +{ + talloc_destroy((*com_set)->mem_ctx); + *com_set = NULL; + + return NT_STATUS_OK; +} + diff --git a/source3/sam/gums_helper.c b/source3/sam/gums_helper.c new file mode 100644 index 0000000000..d581d6574e --- /dev/null +++ b/source3/sam/gums_helper.c @@ -0,0 +1,607 @@ +/* + Unix SMB/CIFS implementation. + GUMS backends helper functions + Copyright (C) Simo Sorce 2002 + + 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" + +extern GUMS_FUNCTIONS *gums_storage; + +extern DOM_SID global_sid_World; +extern DOM_SID global_sid_Builtin_Administrators; +extern DOM_SID global_sid_Builtin_Power_Users; +extern DOM_SID global_sid_Builtin_Account_Operators; +extern DOM_SID global_sid_Builtin_Server_Operators; +extern DOM_SID global_sid_Builtin_Print_Operators; +extern DOM_SID global_sid_Builtin_Backup_Operators; +extern DOM_SID global_sid_Builtin_Replicator; +extern DOM_SID global_sid_Builtin_Users; +extern DOM_SID global_sid_Builtin_Guests; + + +/* defines */ + +#define ALLOC_CHECK(str, ptr, err, label) do { if ((ptr) == NULL) { DEBUG(0, ("%s: out of memory!\n", str)); err = NT_STATUS_NO_MEMORY; goto label; } } while(0) +#define NTSTATUS_CHECK(str1, str2, err, label) do { if (NT_STATUS_IS_ERR(err)) { DEBUG(0, ("%s: %s failed!\n", str1, str2)); } } while(0) + +/**************************************************************************** + Check if a user is a mapped group. + + This function will check if the group SID is mapped onto a + system managed gid or onto a winbind manged sid. + In the first case it will be threated like a mapped group + and the backend should take the member list with a getgrgid + and ignore any user that have been possibly set into the group + object. + + In the second case, the group is a fully SAM managed group + served back to the system through winbind. In this case the + members of a Local group are "unrolled" to cope with the fact + that unix cannot contain groups inside groups. + The backend MUST never call any getgr* / getpw* function or + loops with winbind may happen. + ****************************************************************************/ + +/* +NTSTATUS is_mapped_group(BOOL *mapped, const DOM_SID *sid) +{ + NTSTATUS result; + gid_t id; + + /* look if mapping exist, do not make idmap alloc an uid if SID is not found * / + result = idmap_get_gid_from_sid(&id, sid, False); + if (NT_STATUS_IS_OK(result)) { + *mapped = gid_is_in_winbind_range(id); + } else { + *mapped = False; + } + + return result; +} +*/ + +/**************************************************************************** + duplicate alloc luid_attr + ****************************************************************************/ +NTSTATUS dupalloc_luid_attr(TALLOC_CTX *ctx, LUID_ATTR **new_la, LUID_ATTR old_la) +{ + *new_la = (LUID_ATTR *)talloc(ctx, sizeof(LUID_ATTR)); + if (*new_la == NULL) { + DEBUG(0,("dupalloc_luid_attr: could not Alloc memory to duplicate LUID_ATTR\n")); + return NT_STATUS_NO_MEMORY; + } + + (*new_la)->luid.high = old_la.luid.high; + (*new_la)->luid.low = old_la.luid.low; + (*new_la)->attr = old_la.attr; + + return NT_STATUS_OK; +} + +/**************************************************************************** + initialise a privilege list + ****************************************************************************/ +void init_privilege(PRIVILEGE_SET *priv_set) +{ + priv_set->count=0; + priv_set->control=0; + priv_set->set=NULL; +} + +/**************************************************************************** + add a privilege to a privilege array + ****************************************************************************/ +NTSTATUS add_privilege(PRIVILEGE_SET *priv_set, TALLOC_CTX *ctx, LUID_ATTR set) +{ + LUID_ATTR *new_set; + + /* check if the privilege is not already in the list */ + if (check_priv_in_privilege(priv_set, set)) + return NT_STATUS_UNSUCCESSFUL; + + /* we can allocate memory to add the new privilege */ + + new_set=(LUID_ATTR *)talloc_realloc(ctx, priv_set->set, (priv_set->count+1)*(sizeof(LUID_ATTR))); + if (new_set==NULL) { + DEBUG(0,("add_privilege: could not Realloc memory to add a new privilege\n")); + return NT_STATUS_NO_MEMORY; + } + + new_set[priv_set->count].luid.high=set.luid.high; + new_set[priv_set->count].luid.low=set.luid.low; + new_set[priv_set->count].attr=set.attr; + + priv_set->count++; + priv_set->set=new_set; + + return NT_STATUS_OK; +} + +/**************************************************************************** + add all the privileges to a privilege array + ****************************************************************************/ +NTSTATUS add_all_privilege(PRIVILEGE_SET *priv_set, TALLOC_CTX *ctx) +{ + NTSTATUS result = NT_STATUS_OK; + LUID_ATTR set; + + set.attr=0; + set.luid.high=0; + + set.luid.low=SE_PRIV_ADD_USERS; + result = add_privilege(priv_set, ctx, set); + NTSTATUS_CHECK("add_all_privilege", "add_privilege", result, done); + + set.luid.low=SE_PRIV_ADD_MACHINES; + result = add_privilege(priv_set, ctx, set); + NTSTATUS_CHECK("add_all_privilege", "add_privilege", result, done); + + set.luid.low=SE_PRIV_PRINT_OPERATOR; + result = add_privilege(priv_set, ctx, set); + NTSTATUS_CHECK("add_all_privilege", "add_privilege", result, done); + +done: + return result; +} + +/**************************************************************************** + check if the privilege list is empty + ****************************************************************************/ +BOOL check_empty_privilege(PRIVILEGE_SET *priv_set) +{ + return (priv_set->count == 0); +} + +/**************************************************************************** + check if the privilege is in the privilege list + ****************************************************************************/ +BOOL check_priv_in_privilege(PRIVILEGE_SET *priv_set, LUID_ATTR set) +{ + int i; + + /* if the list is empty, obviously we can't have it */ + if (check_empty_privilege(priv_set)) + return False; + + for (i=0; icount; i++) { + LUID_ATTR *cur_set; + + cur_set=&priv_set->set[i]; + /* check only the low and high part. Checking the attr field has no meaning */ + if( (cur_set->luid.low==set.luid.low) && (cur_set->luid.high==set.luid.high) ) + return True; + } + + return False; +} + +/**************************************************************************** + remove a privilege from a privilege array + ****************************************************************************/ +NTSTATUS remove_privilege(PRIVILEGE_SET *priv_set, TALLOC_CTX *ctx, LUID_ATTR set) +{ + LUID_ATTR *new_set; + LUID_ATTR *old_set; + int i,j; + + /* check if the privilege is in the list */ + if (!check_priv_in_privilege(priv_set, set)) + return NT_STATUS_UNSUCCESSFUL; + + /* special case if it's the only privilege in the list */ + if (priv_set->count==1) { + init_privilege(priv_set); + return NT_STATUS_OK; + } + + /* + * the privilege is there, create a new list, + * and copy the other privileges + */ + + old_set = priv_set->set; + + new_set=(LUID_ATTR *)talloc(ctx, (priv_set->count - 1) * (sizeof(LUID_ATTR))); + if (new_set==NULL) { + DEBUG(0,("remove_privilege: could not malloc memory for new privilege list\n")); + return NT_STATUS_NO_MEMORY; + } + + for (i=0, j=0; icount; i++) { + if ((old_set[i].luid.low == set.luid.low) && + (old_set[i].luid.high == set.luid.high)) { + continue; + } + + new_set[j].luid.low = old_set[i].luid.low; + new_set[j].luid.high = old_set[i].luid.high; + new_set[j].attr = old_set[i].attr; + + j++; + } + + if (j != priv_set->count - 1) { + DEBUG(0,("remove_privilege: mismatch ! difference is not -1\n")); + DEBUGADD(0,("old count:%d, new count:%d\n", priv_set->count, j)); + return NT_STATUS_INTERNAL_ERROR; + } + + /* ok everything is fine */ + + priv_set->count--; + priv_set->set=new_set; + + return NT_STATUS_OK; +} + +/**************************************************************************** + duplicates a privilege array + ****************************************************************************/ +NTSTATUS dup_priv_set(PRIVILEGE_SET **new_priv_set, TALLOC_CTX *mem_ctx, PRIVILEGE_SET *priv_set) +{ + LUID_ATTR *new_set; + LUID_ATTR *old_set; + int i; + + *new_priv_set = (PRIVILEGE_SET *)talloc(mem_ctx, sizeof(PRIVILEGE_SET)); + init_privilege(*new_priv_set); + + /* special case if there are no privileges in the list */ + if (priv_set->count == 0) { + return NT_STATUS_OK; + } + + /* + * create a new list, + * and copy the other privileges + */ + + old_set = priv_set->set; + + new_set = (LUID_ATTR *)talloc(mem_ctx, (priv_set->count - 1) * (sizeof(LUID_ATTR))); + if (new_set==NULL) { + DEBUG(0,("remove_privilege: could not malloc memory for new privilege list\n")); + return NT_STATUS_NO_MEMORY; + } + + for (i=0; i < priv_set->count; i++) { + + new_set[i].luid.low = old_set[i].luid.low; + new_set[i].luid.high = old_set[i].luid.high; + new_set[i].attr = old_set[i].attr; + } + + (*new_priv_set)->count = priv_set->count; + (*new_priv_set)->control = priv_set->control; + (*new_priv_set)->set = new_set; + + return NT_STATUS_OK; +} + +#define ALIAS_DEFAULT_SACL_SA_RIGHTS 0x01050013 +#define ALIAS_DEFAULT_DACL_SA_RIGHTS \ + (READ_CONTROL_ACCESS | \ + SA_RIGHT_ALIAS_LOOKUP_INFO | \ + SA_RIGHT_ALIAS_GET_MEMBERS) /* 0x0002000c */ + +#define ALIAS_DEFAULT_SACL_SEC_ACE_FLAG (SEC_ACE_FLAG_FAILED_ACCESS | SEC_ACE_FLAG_SUCCESSFUL_ACCESS) /* 0xc0 */ + +NTSTATUS create_builtin_alias_default_sec_desc(SEC_DESC **sec_desc, TALLOC_CTX *ctx) +{ + DOM_SID *world = &global_sid_World; + DOM_SID *admins = &global_sid_Builtin_Administrators; + SEC_ACCESS sa; + SEC_ACE sacl_ace; + SEC_ACE dacl_aces[2]; + SEC_ACL *sacl = NULL; + SEC_ACL *dacl = NULL; + size_t psize; + + init_sec_access(&sa, ALIAS_DEFAULT_SACL_SA_RIGHTS); + init_sec_ace(&sacl_ace, world, SEC_ACE_TYPE_SYSTEM_AUDIT, sa, ALIAS_DEFAULT_SACL_SEC_ACE_FLAG); + + sacl = make_sec_acl(ctx, NT4_ACL_REVISION, 1, &sacl_ace); + if (!sacl) { + DEBUG(0, ("build_init_sec_desc: Failed to make SEC_ACL.\n")); + return NT_STATUS_NO_MEMORY; + } + + init_sec_access(&sa, ALIAS_DEFAULT_DACL_SA_RIGHTS); + init_sec_ace(&(dacl_aces[0]), world, SEC_ACE_TYPE_ACCESS_ALLOWED, sa, 0); + init_sec_access(&sa, SA_RIGHT_ALIAS_ALL_ACCESS); + init_sec_ace(&(dacl_aces[1]), admins, SEC_ACE_TYPE_ACCESS_ALLOWED, sa, 0); + + dacl = make_sec_acl(ctx, NT4_ACL_REVISION, 2, dacl_aces); + if (!sacl) { + DEBUG(0, ("build_init_sec_desc: Failed to make SEC_ACL.\n")); + return NT_STATUS_NO_MEMORY; + } + + *sec_desc = make_sec_desc(ctx, SEC_DESC_REVISION, admins, admins, sacl, dacl, &psize); + if (!(*sec_desc)) { + DEBUG(0,("get_share_security: Failed to make SEC_DESC.\n")); + return NT_STATUS_NO_MEMORY; + } + + return NT_STATUS_OK; +} + +NTSTATUS sec_desc_add_ace_to_dacl(SEC_DESC *sec_desc, TALLOC_CTX *ctx, DOM_SID *sid, uint32 mask) +{ + NTSTATUS result; + SEC_ACE *new_aces; + unsigned num_aces; + int i; + + num_aces = sec_desc->dacl->num_aces + 1; + result = sec_ace_add_sid(ctx, &new_aces, sec_desc->dacl->ace, &num_aces, sid, mask); + if (NT_STATUS_IS_OK(result)) { + sec_desc->dacl->ace = new_aces; + sec_desc->dacl->num_aces = num_aces; + sec_desc->dacl->size = SEC_ACL_HEADER_SIZE; + for (i = 0; i < num_aces; i++) { + sec_desc->dacl->size += sec_desc->dacl->ace[i].size; + } + } + return result; +} + +NTSTATUS gums_init_builtin_groups(void) +{ + NTSTATUS result; + GUMS_OBJECT g_obj; + GUMS_GROUP *g_grp; + GUMS_PRIVILEGE g_priv; + + /* Build the well known Builtin Local Groups */ + g_obj.type = GUMS_OBJ_GROUP; + g_obj.version = 1; + g_obj.seq_num = 0; + g_obj.mem_ctx = talloc_init_named("gums_init_backend_acct"); + if (g_obj.mem_ctx == NULL) { + DEBUG(0, ("gums_init_backend: Out of Memory!\n")); + return NT_STATUS_NO_MEMORY; + } + + /* Administrators */ + + /* alloc group structure */ + g_obj.data = (void *)talloc(g_obj.mem_ctx, sizeof(GUMS_OBJ_GROUP)); + ALLOC_CHECK("gums_init_backend", g_obj.data, result, done); + + /* make admins sid */ + g_grp = (GUMS_GROUP *)g_obj.data; + sid_copy(g_obj.sid, &global_sid_Builtin_Administrators); + + /* make security descriptor */ + result = create_builtin_alias_default_sec_desc(&(g_obj.sec_desc), g_obj.mem_ctx); + NTSTATUS_CHECK("gums_init_backend", "create_builtin_alias_default_sec_desc", result, done); + + /* make privilege set */ + /* From BDC join trace: + SeSecurityPrivilege + SeBackupPrivilege + SeRestorePrivilege + SeSystemtimePrivilege + SeShutdownPrivilege + SeRemoteShutdownPrivilege + SeTakeOwnershipPrivilege + SeDebugPrivilege + SeSystemEnvironmentPrivilege + SeSystemProfilePrivilege + SeProfileSingleProcessPrivilege + SeIncreaseBasePriorityPrivilege + SeLocalDriverPrivilege + SeCreatePagefilePrivilege + SeIncreaseQuotaPrivilege + */ + + /* set name */ + g_obj.name = talloc_strdup(g_obj.mem_ctx, "Administrators"); + ALLOC_CHECK("gums_init_backend", g_obj.name, result, done); + + /* set description */ + g_obj.description = talloc_strdup(g_obj.mem_ctx, "Members can fully administer the computer/domain"); + ALLOC_CHECK("gums_init_backend", g_obj.description, result, done); + + /* numebr of group members */ + g_grp->count = 0; + g_grp->members = NULL; + + /* store Administrators group */ + result = gums_storage->set_object(&g_obj); + + /* Power Users */ + /* Domain Controllers Does NOT have power Users */ + + sid_copy(g_obj.sid, &global_sid_Builtin_Power_Users); + + /* make privilege set */ + /* SE_PRIV_??? */ + + /* set name */ + g_obj.name = talloc_strdup(g_obj.mem_ctx, "Power Users"); + ALLOC_CHECK("gums_init_backend", g_obj.name, result, done); + + /* set description */ +/* > */ g_obj.description = talloc_strdup(g_obj.mem_ctx, "Power Users"); + ALLOC_CHECK("gums_init_backend", g_obj.description, result, done); + + /* store Power Users group */ + result = gums_storage->set_object(&g_obj); + + /* Account Operators */ + + sid_copy(g_obj.sid, &global_sid_Builtin_Account_Operators); + + /* make privilege set */ + /* From BDC join trace: + SeShutdownPrivilege + */ + + /* set name */ + g_obj.name = talloc_strdup(g_obj.mem_ctx, "Account Operators"); + ALLOC_CHECK("gums_init_backend", g_obj.name, result, done); + + /* set description */ + g_obj.description = talloc_strdup(g_obj.mem_ctx, "Members can administer domain user and group accounts"); + ALLOC_CHECK("gums_init_backend", g_obj.description, result, done); + + /* store Account Operators group */ + result = gums_storage->set_object(&g_obj); + + /* Server Operators */ + + sid_copy(g_obj.sid, &global_sid_Builtin_Server_Operators); + + /* make privilege set */ + /* From BDC join trace: + SeBackupPrivilege + SeRestorePrivilege + SeSystemtimePrivilege + SeShutdownPrivilege + SeRemoteShutdownPrivilege + */ + + /* set name */ + g_obj.name = talloc_strdup(g_obj.mem_ctx, "Server Operators"); + ALLOC_CHECK("gums_init_backend", g_obj.name, result, done); + + /* set description */ + g_obj.description = talloc_strdup(g_obj.mem_ctx, "Members can administer domain servers"); + ALLOC_CHECK("gums_init_backend", g_obj.description, result, done); + + /* store Server Operators group */ + result = gums_storage->set_object(&g_obj); + + /* Print Operators */ + + sid_copy(g_obj.sid, &global_sid_Builtin_Print_Operators); + + /* make privilege set */ + /* From BDC join trace: + SeShutdownPrivilege + */ + + /* set name */ + g_obj.name = talloc_strdup(g_obj.mem_ctx, "Print Operators"); + ALLOC_CHECK("gums_init_backend", g_obj.name, result, done); + + /* set description */ + g_obj.description = talloc_strdup(g_obj.mem_ctx, "Members can administer domain printers"); + ALLOC_CHECK("gums_init_backend", g_obj.description, result, done); + + /* store Print Operators group */ + result = gums_storage->set_object(&g_obj); + + /* Backup Operators */ + + sid_copy(g_obj.sid, &global_sid_Builtin_Backup_Operators); + + /* make privilege set */ + /* From BDC join trace: + SeBackupPrivilege + SeRestorePrivilege + SeShutdownPrivilege + */ + + /* set name */ + g_obj.name = talloc_strdup(g_obj.mem_ctx, "Backup Operators"); + ALLOC_CHECK("gums_init_backend", g_obj.name, result, done); + + /* set description */ + g_obj.description = talloc_strdup(g_obj.mem_ctx, "Members can bypass file security to backup files"); + ALLOC_CHECK("gums_init_backend", g_obj.description, result, done); + + /* store Backup Operators group */ + result = gums_storage->set_object(&g_obj); + + /* Replicator */ + + sid_copy(g_obj.sid, &global_sid_Builtin_Replicator); + + /* make privilege set */ + /* From BDC join trace: + SeBackupPrivilege + SeRestorePrivilege + SeShutdownPrivilege + */ + + /* set name */ + g_obj.name = talloc_strdup(g_obj.mem_ctx, "Replicator"); + ALLOC_CHECK("gums_init_backend", g_obj.name, result, done); + + /* set description */ + g_obj.description = talloc_strdup(g_obj.mem_ctx, "Supports file replication in a domain"); + ALLOC_CHECK("gums_init_backend", g_obj.description, result, done); + + /* store Replicator group */ + result = gums_storage->set_object(&g_obj); + + /* Users */ + + sid_copy(g_obj.sid, &global_sid_Builtin_Users); + + /* add ACE to sec dsec dacl */ + sec_desc_add_ace_to_dacl(g_obj.sec_desc, g_obj.mem_ctx, &global_sid_Builtin_Account_Operators, ALIAS_DEFAULT_DACL_SA_RIGHTS); + sec_desc_add_ace_to_dacl(g_obj.sec_desc, g_obj.mem_ctx, &global_sid_Builtin_Power_Users, ALIAS_DEFAULT_DACL_SA_RIGHTS); + + /* set name */ + g_obj.name = talloc_strdup(g_obj.mem_ctx, "Users"); + ALLOC_CHECK("gums_init_backend", g_obj.name, result, done); + + /* set description */ + g_obj.description = talloc_strdup(g_obj.mem_ctx, "Ordinary users"); + ALLOC_CHECK("gums_init_backend", g_obj.description, result, done); + + /* store Users group */ + result = gums_storage->set_object(&g_obj); + + /* Guests */ + + sid_copy(g_obj.sid, &global_sid_Builtin_Guests); + + /* set name */ + g_obj.name = talloc_strdup(g_obj.mem_ctx, "Guests"); + ALLOC_CHECK("gums_init_backend", g_obj.name, result, done); + + /* set description */ + g_obj.description = talloc_strdup(g_obj.mem_ctx, "Users granted guest access to the computer/domain"); + ALLOC_CHECK("gums_init_backend", g_obj.description, result, done); + + /* store Guests group */ + result = gums_storage->set_object(&g_obj); + + /* set default privileges */ + g_priv.type = GUMS_OBJ_GROUP; + g_priv.version = 1; + g_priv.seq_num = 0; + g_priv.mem_ctx = talloc_init_named("gums_init_backend_priv"); + if (g_priv.mem_ctx == NULL) { + DEBUG(0, ("gums_init_backend: Out of Memory!\n")); + return NT_STATUS_NO_MEMORY; + } + + + +done: + talloc_destroy(g_obj.mem_ctx); + talloc_destroy(g_priv.mem_ctx); + return result; +} + -- cgit From 9b323a3c0deb73cea3c39e5b7323bdf17e199c5c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 22 Oct 2002 22:17:06 +0000 Subject: Fix for systems that allow more than 65536 open files per process. Jeremy. (This used to be commit ff537f10a0c0b6b1d9055eb776d1e8a9864e8363) --- source3/include/local.h | 3 +++ source3/rpc_server/srv_pipe_hnd.c | 4 ---- source3/smbd/files.c | 9 ++++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/source3/include/local.h b/source3/include/local.h index 2be9c1e101..20fa5ff52a 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -213,4 +213,7 @@ /* Max number of jobs per print queue. */ #define PRINT_MAX_JOBID 10000 +/* Max number of open RPC pipes. */ +#define MAX_OPEN_PIPES 2048 + #endif diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index cc6e4b95f9..1695419687 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -31,10 +31,6 @@ static smb_np_struct *chain_p; static int pipes_open; -#ifndef MAX_OPEN_PIPES -#define MAX_OPEN_PIPES 2048 -#endif - /* * Sometimes I can't decide if I hate Windows printer driver * writers more than I hate the Windows spooler service driver diff --git a/source3/smbd/files.c b/source3/smbd/files.c index c055fb54eb..d926718c5d 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -112,6 +112,8 @@ files_struct *file_new(connection_struct *conn) files_used++; fsp->fnum = i + FILE_HANDLE_OFFSET; + SMB_ASSERT(fsp->fnum < 65536); + string_set(&fsp->fsp_name,""); DLIST_ADD(Files, fsp); @@ -144,7 +146,7 @@ void file_close_conn(connection_struct *conn) Initialise file structures. ****************************************************************************/ -#define MAX_OPEN_FUDGEFACTOR 10 +#define MAX_OPEN_FUDGEFACTOR 20 void file_init(void) { @@ -160,11 +162,16 @@ void file_init(void) real_max_open_files = real_lim - MAX_OPEN_FUDGEFACTOR; + if (real_max_open_files + FILE_HANDLE_OFFSET + MAX_OPEN_PIPES > 65536) + real_max_open_files = 65536 - FILE_HANDLE_OFFSET - MAX_OPEN_PIPES; + if(real_max_open_files != request_max_open_files) { DEBUG(1,("file_init: Information only: requested %d \ open files, %d are available.\n", request_max_open_files, real_max_open_files)); } + SMB_ASSERT(real_max_open_files > 100); + file_bmap = bitmap_allocate(real_max_open_files); if (!file_bmap) { -- cgit From 306e4cbead22e2bb12f699d0072eb8d5b1bc6733 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 23 Oct 2002 00:02:26 +0000 Subject: fixed a possible segv when dealing with a blank password (This used to be commit d5d0d0de50482ed16c594b1cc4cc113e2526a915) --- source3/libads/kerberos.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index b586d84226..bef2febaef 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -40,8 +40,12 @@ kerb_prompter(krb5_context ctx, void *data, memset(prompts[0].reply->data, 0, prompts[0].reply->length); if (prompts[0].reply->length > 0) { - strncpy(prompts[0].reply->data, data, prompts[0].reply->length-1); - prompts[0].reply->length = strlen(prompts[0].reply->data); + if (data) { + strncpy(prompts[0].reply->data, data, prompts[0].reply->length-1); + prompts[0].reply->length = strlen(prompts[0].reply->data); + } else { + prompts[0].reply->length = 0; + } } return 0; } -- cgit From ef372e36f08c8cd370c1a8a70c60b045c4e736c3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 23 Oct 2002 00:23:30 +0000 Subject: if trusted domains are disabled then we should not try to connect to them in winbindd (This used to be commit 6c7748b001836e4aa3e23dedfe28db3c8acc197a) --- source3/nsswitch/winbindd_util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source3/nsswitch/winbindd_util.c b/source3/nsswitch/winbindd_util.c index c8afea2f72..fd3e547afb 100644 --- a/source3/nsswitch/winbindd_util.c +++ b/source3/nsswitch/winbindd_util.c @@ -153,12 +153,17 @@ void rescan_trusted_domains(void) static time_t last_scan; time_t t = time(NULL); + /* trusted domains might be disabled */ + if (!lp_allow_trusted_domains()) { + return; + } + /* ony rescan every few minutes */ if ((unsigned)(t - last_scan) < WINBINDD_RESCAN_FREQ) { return; } last_scan = t; - + DEBUG(1, ("scanning trusted domain list\n")); if (!(mem_ctx = talloc_init_named("init_domain_list"))) -- cgit From 7689a9c96932a41ccde73b3df0ce358e62a38a15 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 23 Oct 2002 01:22:45 +0000 Subject: First cut of new ACL mapping code from Andreas Gruenbacher . This is not 100% the same as what SuSE shipped in their Samba, there is a crash bug fix, a race condition fix, and a few logic changes I'd like to discuss with Andreas. Added Andreas to (C) notices for posix_acls.c Jeremy. (This used to be commit a81d700ae9c82d4b7ea631ab7862162a2ed3d512) --- source3/lib/util_sid.c | 200 ++++++++------- source3/param/loadparm.c | 21 +- source3/rpc_server/srv_samr_nt.c | 2 +- source3/smbd/open.c | 6 +- source3/smbd/posix_acls.c | 525 +++++++++++++++++++++++++++++++-------- source3/smbd/trans2.c | 2 + source3/smbd/uid.c | 2 +- source3/smbd/vfs.c | 3 + 8 files changed, 559 insertions(+), 202 deletions(-) diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index f01479f1cc..f0daf9787e 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -40,9 +40,9 @@ DOM_SID global_sid_NULL; /* NULL sid */ DOM_SID global_sid_Authenticated_Users; /* All authenticated rids */ DOM_SID global_sid_Network; /* Network rids */ -static DOM_SID global_sid_Creator_Owner; /* Creator Owner */ -static DOM_SID global_sid_Creator_Group; /* Creator Group */ -static DOM_SID global_sid_Anonymous; /* Anonymous login */ +DOM_SID global_sid_Creator_Owner; /* Creator Owner */ +DOM_SID global_sid_Creator_Group; /* Creator Group */ +DOM_SID global_sid_Anonymous; /* Anonymous login */ DOM_SID global_sid_Builtin; /* Local well-known domain */ DOM_SID global_sid_Builtin_Administrators; /* Builtin administrators */ @@ -166,6 +166,10 @@ void generate_wellknown_sids(void) initialised = True; } +/************************************************************************** + Create the SYSTEM token. +***************************************************************************/ + NT_USER_TOKEN *get_system_token(void) { generate_wellknown_sids(); /* The token is initialised here */ @@ -239,7 +243,10 @@ char *sid_to_string(fstring sidstr_out, const DOM_SID *sid) return sidstr_out; } - /* BIG NOTE: this function only does SIDS where the identauth is not >= 2^32 */ + /* + * BIG NOTE: this function only does SIDS where the identauth is not >= 2^32 + * in a range of 2^48. + */ ia = (sid->id_auth[5]) + (sid->id_auth[4] << 8 ) + (sid->id_auth[3] << 16) + @@ -272,63 +279,63 @@ const char *sid_string_static(const DOM_SID *sid) BOOL string_to_sid(DOM_SID *sidout, const char *sidstr) { - pstring tok; - char *p, *q; - /* BIG NOTE: this function only does SIDS where the identauth is not >= 2^32 */ - uint32 ia; + pstring tok; + char *p, *q; + /* BIG NOTE: this function only does SIDS where the identauth is not >= 2^32 */ + uint32 ia; - if (StrnCaseCmp( sidstr, "S-", 2)) { - DEBUG(0,("string_to_sid: Sid %s does not start with 'S-'.\n", sidstr)); - return False; - } - - memset((char *)sidout, '\0', sizeof(DOM_SID)); - - q = p = strdup(sidstr + 2); - if (p == NULL) { - DEBUG(0, ("string_to_sid: out of memory!\n")); - return False; - } - - if (!next_token(&p, tok, "-", sizeof(tok))) { - DEBUG(0,("string_to_sid: Sid %s is not in a valid format.\n", sidstr)); - SAFE_FREE(q); - return False; - } - - /* Get the revision number. */ - sidout->sid_rev_num = (uint8)strtoul(tok, NULL, 10); - - if (!next_token(&p, tok, "-", sizeof(tok))) { - DEBUG(0,("string_to_sid: Sid %s is not in a valid format.\n", sidstr)); - SAFE_FREE(q); - return False; - } - - /* identauth in decimal should be < 2^32 */ - ia = (uint32)strtoul(tok, NULL, 10); - - /* NOTE - the ia value is in big-endian format. */ - sidout->id_auth[0] = 0; - sidout->id_auth[1] = 0; - sidout->id_auth[2] = (ia & 0xff000000) >> 24; - sidout->id_auth[3] = (ia & 0x00ff0000) >> 16; - sidout->id_auth[4] = (ia & 0x0000ff00) >> 8; - sidout->id_auth[5] = (ia & 0x000000ff); - - sidout->num_auths = 0; - - while(next_token(&p, tok, "-", sizeof(tok)) && - sidout->num_auths < MAXSUBAUTHS) { - /* - * NOTE - the subauths are in native machine-endian format. They - * are converted to little-endian when linearized onto the wire. - */ - sid_append_rid(sidout, (uint32)strtoul(tok, NULL, 10)); - } - - SAFE_FREE(q); - return True; + if (StrnCaseCmp( sidstr, "S-", 2)) { + DEBUG(0,("string_to_sid: Sid %s does not start with 'S-'.\n", sidstr)); + return False; + } + + memset((char *)sidout, '\0', sizeof(DOM_SID)); + + q = p = strdup(sidstr + 2); + if (p == NULL) { + DEBUG(0, ("string_to_sid: out of memory!\n")); + return False; + } + + if (!next_token(&p, tok, "-", sizeof(tok))) { + DEBUG(0,("string_to_sid: Sid %s is not in a valid format.\n", sidstr)); + SAFE_FREE(q); + return False; + } + + /* Get the revision number. */ + sidout->sid_rev_num = (uint8)strtoul(tok, NULL, 10); + + if (!next_token(&p, tok, "-", sizeof(tok))) { + DEBUG(0,("string_to_sid: Sid %s is not in a valid format.\n", sidstr)); + SAFE_FREE(q); + return False; + } + + /* identauth in decimal should be < 2^32 */ + ia = (uint32)strtoul(tok, NULL, 10); + + /* NOTE - the ia value is in big-endian format. */ + sidout->id_auth[0] = 0; + sidout->id_auth[1] = 0; + sidout->id_auth[2] = (ia & 0xff000000) >> 24; + sidout->id_auth[3] = (ia & 0x00ff0000) >> 16; + sidout->id_auth[4] = (ia & 0x0000ff00) >> 8; + sidout->id_auth[5] = (ia & 0x000000ff); + + sidout->num_auths = 0; + + while(next_token(&p, tok, "-", sizeof(tok)) && + sidout->num_auths < MAXSUBAUTHS) { + /* + * NOTE - the subauths are in native machine-endian format. They + * are converted to little-endian when linearized onto the wire. + */ + sid_append_rid(sidout, (uint32)strtoul(tok, NULL, 10)); + } + + SAFE_FREE(q); + return True; } /***************************************************************** @@ -412,10 +419,10 @@ void sid_copy(DOM_SID *dst, const DOM_SID *src) dst->sub_auths[i] = src->sub_auths[i]; } - /***************************************************************** Write a sid out into on-the-wire format. *****************************************************************/ + BOOL sid_linearize(char *outbuf, size_t len, const DOM_SID *sid) { size_t i; @@ -433,36 +440,41 @@ BOOL sid_linearize(char *outbuf, size_t len, const DOM_SID *sid) } /***************************************************************** - parse a on-the-wire SID to a DOM_SID + Parse a on-the-wire SID to a DOM_SID. *****************************************************************/ + BOOL sid_parse(const char *inbuf, size_t len, DOM_SID *sid) { int i; - if (len < 8) return False; + if (len < 8) + return False; ZERO_STRUCTP(sid); sid->sid_rev_num = CVAL(inbuf, 0); sid->num_auths = CVAL(inbuf, 1); memcpy(sid->id_auth, inbuf+2, 6); - if (len < 8 + sid->num_auths*4) return False; - for (i=0;inum_auths;i++) { + if (len < 8 + sid->num_auths*4) + return False; + for (i=0;inum_auths;i++) sid->sub_auths[i] = IVAL(inbuf, 8+i*4); - } return True; } - /***************************************************************** Compare the auth portion of two sids. *****************************************************************/ + static int sid_compare_auth(const DOM_SID *sid1, const DOM_SID *sid2) { int i; - if (sid1 == sid2) return 0; - if (!sid1) return -1; - if (!sid2) return 1; + if (sid1 == sid2) + return 0; + if (!sid1) + return -1; + if (!sid2) + return 1; if (sid1->sid_rev_num != sid2->sid_rev_num) return sid1->sid_rev_num - sid2->sid_rev_num; @@ -477,15 +489,19 @@ static int sid_compare_auth(const DOM_SID *sid1, const DOM_SID *sid2) /***************************************************************** Compare two sids. *****************************************************************/ + int sid_compare(const DOM_SID *sid1, const DOM_SID *sid2) { int i; - if (sid1 == sid2) return 0; - if (!sid1) return -1; - if (!sid2) return 1; + if (sid1 == sid2) + return 0; + if (!sid1) + return -1; + if (!sid2) + return 1; - /* compare most likely different rids, first: i.e start at end */ + /* Compare most likely different rids, first: i.e start at end */ if (sid1->num_auths != sid2->num_auths) return sid1->num_auths - sid2->num_auths; @@ -497,9 +513,10 @@ int sid_compare(const DOM_SID *sid1, const DOM_SID *sid2) } /***************************************************************** -see if 2 SIDs are in the same domain -this just compares the leading sub-auths + See if 2 SIDs are in the same domain + this just compares the leading sub-auths *****************************************************************/ + int sid_compare_domain(const DOM_SID *sid1, const DOM_SID *sid2) { int n, i; @@ -516,25 +533,25 @@ int sid_compare_domain(const DOM_SID *sid1, const DOM_SID *sid2) /***************************************************************** Compare two sids. *****************************************************************/ + BOOL sid_equal(const DOM_SID *sid1, const DOM_SID *sid2) { return sid_compare(sid1, sid2) == 0; } - - /***************************************************************** Check if the SID is the builtin SID (S-1-5-32). *****************************************************************/ + BOOL sid_check_is_builtin(const DOM_SID *sid) { return sid_equal(sid, &global_sid_Builtin); } - /***************************************************************** - Check if the SID is our domain SID (S-1-5-21-x-y-z). + Check if the SID is one of the builtin SIDs (S-1-5-32-a). *****************************************************************/ + BOOL sid_check_is_in_builtin(const DOM_SID *sid) { DOM_SID dom_sid; @@ -546,7 +563,6 @@ BOOL sid_check_is_in_builtin(const DOM_SID *sid) return sid_equal(&dom_sid, &global_sid_Builtin); } - /***************************************************************** Calculates size of a sid. *****************************************************************/ @@ -574,25 +590,24 @@ BOOL non_mappable_sid(DOM_SID *sid) if (sid_equal(&dom, &global_sid_Builtin)) return True; - if (sid_equal(&dom, &global_sid_Creator_Owner_Domain)) - return True; - if (sid_equal(&dom, &global_sid_NT_Authority)) return True; return False; } -/* - return the binary string representation of a DOM_SID - caller must free -*/ +/***************************************************************** + Return the binary string representation of a DOM_SID. + Caller must free. +*****************************************************************/ + char *sid_binstring(const DOM_SID *sid) { char *buf, *s; int len = sid_size(sid); buf = malloc(len); - if (!buf) return NULL; + if (!buf) + return NULL; sid_linearize(buf, len, sid); s = binary_string(buf, len); free(buf); @@ -600,9 +615,10 @@ char *sid_binstring(const DOM_SID *sid) } -/* - print a GUID structure for debugging -*/ +/***************************************************************** + Print a GUID structure for debugging. +*****************************************************************/ + void print_guid(GUID *guid) { int i; diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index effbb7af68..c54281332b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -216,6 +216,7 @@ typedef struct char *szLdapSuffix; char *szLdapFilter; char *szLdapAdminDn; + char *szAclCompat; int ldap_passwd_sync; BOOL bMsAddPrinterWizard; BOOL bDNSproxy; @@ -536,6 +537,8 @@ static BOOL handle_ldap_machine_suffix ( char *pszParmValue, char **ptr ); static BOOL handle_ldap_user_suffix ( char *pszParmValue, char **ptr ); static BOOL handle_ldap_suffix ( char *pszParmValue, char **ptr ); +static BOOL handle_acl_compatibility(char *pszParmValue, char **ptr); + static void set_server_role(void); static void set_default_server_announce_type(void); @@ -820,8 +823,9 @@ static struct parm_struct parm_table[] = { {"write raw", P_BOOL, P_GLOBAL, &Globals.bWriteRaw, NULL, NULL, FLAG_DEVELOPER}, {"disable netbios", P_BOOL, P_GLOBAL, &Globals.bDisableNetbios, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, + {"acl compatibility", P_STRING, P_GLOBAL, &Globals.szAclCompat, handle_acl_compatibility, NULL, FLAG_SHARE | FLAG_GLOBAL | FLAG_ADVANCED}, + {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED | FLAG_WIZARD}, {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, - {"nt acl support", P_BOOL, P_LOCAL, &sDefault.bNTAclSupport, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED | FLAG_WIZARD}, {"nt status support", P_BOOL, P_GLOBAL, &Globals.bNTStatusSupport, NULL, NULL, FLAG_ADVANCED | FLAG_DEVELOPER}, {"profile acls", P_BOOL, P_LOCAL, &sDefault.bProfileAcls, NULL, NULL, FLAG_GLOBAL | FLAG_SHARE | FLAG_ADVANCED | FLAG_WIZARD}, @@ -1407,6 +1411,7 @@ static void init_globals(void) string_set(&Globals.szTemplateShell, "/bin/false"); string_set(&Globals.szTemplateHomedir, "/home/%D/%U"); string_set(&Globals.szWinbindSeparator, "\\"); + string_set(&Globals.szAclCompat, ""); Globals.winbind_cache_time = 15; Globals.bWinbindEnumUsers = True; @@ -1579,6 +1584,7 @@ FN_GLOBAL_STRING(lp_wins_partners, &Globals.szWINSPartners) FN_GLOBAL_STRING(lp_template_homedir, &Globals.szTemplateHomedir) FN_GLOBAL_STRING(lp_template_shell, &Globals.szTemplateShell) FN_GLOBAL_STRING(lp_winbind_separator, &Globals.szWinbindSeparator) +FN_GLOBAL_STRING(lp_acl_compatibility, &Globals.szAclCompat) FN_GLOBAL_BOOL(lp_winbind_enum_users, &Globals.bWinbindEnumUsers) FN_GLOBAL_BOOL(lp_winbind_enum_groups, &Globals.bWinbindEnumGroups) FN_GLOBAL_BOOL(lp_winbind_use_default_domain, &Globals.bWinbindUseDefaultDomain) @@ -2771,6 +2777,19 @@ static BOOL handle_ldap_suffix( char *pszParmValue, char **ptr) return True; } +static BOOL handle_acl_compatibility(char *pszParmValue, char **ptr) +{ + if (strequal(pszParmValue, "auto")) + string_set(ptr, ""); + else if (strequal(pszParmValue, "winnt")) + string_set(ptr, "winnt"); + else if (strequal(pszParmValue, "win2k")) + string_set(ptr, "win2k"); + else + return False; + + return True; +} /*************************************************************************** initialise a copymap ***************************************************************************/ diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index 1bdfefff65..6ef2fcd67d 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -884,7 +884,7 @@ static NTSTATUS get_group_alias_entries(TALLOC_CTX *ctx, DOMAIN_GRP **d_grp, DOM uint32 num_entries = 0; int i; GROUP_MAP smap; - GROUP_MAP *map; + GROUP_MAP *map = NULL; sid_to_string(sid_str, sid); DEBUG(5, ("get_group_alias_entries: enumerating aliases on SID: %s\n", sid_str)); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index a95793a050..417a9dd039 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -165,9 +165,13 @@ static BOOL open_file(files_struct *fsp,connection_struct *conn, local_flags |= O_NONBLOCK; #endif - /* actually do the open */ + /* Actually do the open */ fsp->fd = fd_open(conn, fname, local_flags, mode); + /* Inherit the ACL if the file was created. */ + if ((local_flags & O_CREAT) && !VALID_STAT(*psbuf)) + inherit_access_acl(conn, fname, mode); + if (fsp->fd == -1) { DEBUG(3,("Error opening file %s (%s) (local_flags=%d) (flags=%d)\n", fname,strerror(errno),local_flags,flags)); diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index 87ebddf35a..22bb7fe76b 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -1,7 +1,8 @@ /* Unix SMB/CIFS implementation. SMB NT Security Descriptor / Unix permission conversion. - Copyright (C) Jeremy Allison 1994-2000 + Copyright (C) Jeremy Allison 1994-2000. + Copyright (C) Andreas Gruenbacher 2002. 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 @@ -329,6 +330,24 @@ static void merge_aces( canon_ace **pp_list_head ) *pp_list_head = list_head; } +/**************************************************************************** + Check if we need to return NT4.x compatible ACL entries. +****************************************************************************/ + +static BOOL nt4_compatible_acls(void) +{ + const char *compat = lp_acl_compatibility(); + + if (*compat == '\0') { + enum remote_arch_types ra_type = get_remote_arch(); + + /* Automatically adapt to client */ + return (ra_type <= RA_WINNT); + } else + return (strequal(compat, "winnt")); +} + + /**************************************************************************** Map canon_ace perms to permission bits NT. The attr element is not used here - we only process deny entries on set, @@ -345,7 +364,19 @@ static SEC_ACCESS map_canon_ace_perms(int *pacl_type, DOM_SID *powner_sid, canon if ((ace->perms & ALL_ACE_PERMS) == ALL_ACE_PERMS) { nt_mask = UNIX_ACCESS_RWX; } else if ((ace->perms & ALL_ACE_PERMS) == (mode_t)0) { - nt_mask = UNIX_ACCESS_NONE; + /* + * Windows NT refuses to display ACEs with no permissions in them (but + * they are perfectly legal with Windows 2000). If the ACE has empty + * permissions we cannot use 0, so we use the otherwise unused + * WRITE_OWNER permission, which we ignore when we set an ACL. + * We abstract this into a #define of UNIX_ACCESS_NONE to allow this + * to be changed in the future. + */ + + if (nt4_compatible_acls()) + nt_mask = UNIX_ACCESS_NONE; + else + nt_mask = 0; } else { nt_mask |= ((ace->perms & S_IRUSR) ? UNIX_ACCESS_R : 0 ); nt_mask |= ((ace->perms & S_IWUSR) ? UNIX_ACCESS_W : 0 ); @@ -621,7 +652,7 @@ static BOOL ensure_canon_entry_valid(canon_ace **pp_ace, else if (got_grp && uid_entry_in_group(pace, pace_group)) pace->perms = pace_group->perms; else - pace->perms = unix_perms_to_acl_perms(pst->st_mode, S_IRUSR, S_IWUSR, S_IXUSR); + pace->perms = 0; apply_default_perms(fsp, pace, S_IRUSR); } else { pace->perms = unix_perms_to_acl_perms(pst->st_mode, S_IRUSR, S_IWUSR, S_IXUSR); @@ -668,7 +699,10 @@ static BOOL ensure_canon_entry_valid(canon_ace **pp_ace, pace->unix_ug.world = -1; pace->trustee = global_sid_World; pace->attr = ALLOW_ACE; - pace->perms = unix_perms_to_acl_perms(pst->st_mode, S_IROTH, S_IWOTH, S_IXOTH); + if (setting_acl) + pace->perms = 0; + else + pace->perms = unix_perms_to_acl_perms(pst->st_mode, S_IROTH, S_IWOTH, S_IXOTH); apply_default_perms(fsp, pace, S_IROTH); DLIST_ADD(*pp_ace, pace); @@ -677,6 +711,51 @@ static BOOL ensure_canon_entry_valid(canon_ace **pp_ace, return True; } +/**************************************************************************** + Check if a POSIX ACL has the required SMB_ACL_USER_OBJ and SMB_ACL_GROUP_OBJ entries. + If it does not have them, check if there are any entries where the trustee is the + file owner or the owning group, and map these to SMB_ACL_USER_OBJ and SMB_ACL_GROUP_OBJ. +****************************************************************************/ + +static void check_owning_objs(canon_ace *ace, DOM_SID *pfile_owner_sid, DOM_SID *pfile_grp_sid) +{ + BOOL got_user_obj, got_group_obj; + canon_ace *current_ace; + int i, entries; + + entries = count_canon_ace_list(ace); + got_user_obj = False; + got_group_obj = False; + + for (i=0, current_ace = ace; i < entries; i++, current_ace = current_ace->next) { + if (current_ace->type == SMB_ACL_USER_OBJ) + got_user_obj = True; + else if (current_ace->type == SMB_ACL_GROUP_OBJ) + got_group_obj = True; + } + if (got_user_obj && got_group_obj) { + DEBUG(10,("check_owning_objs: ACL had owning user/group entries.\n")); + return; + } + + for (i=0, current_ace = ace; i < entries; i++, current_ace = current_ace->next) { + if (!got_user_obj && current_ace->owner_type == UID_ACE && + sid_equal(¤t_ace->trustee, pfile_owner_sid)) { + current_ace->type = SMB_ACL_USER_OBJ; + got_user_obj = True; + } + if (!got_group_obj && current_ace->owner_type == GID_ACE && + sid_equal(¤t_ace->trustee, pfile_grp_sid)) { + current_ace->type = SMB_ACL_GROUP_OBJ; + got_group_obj = True; + } + } + if (!got_user_obj) + DEBUG(10,("check_owning_objs: ACL is missing an owner entry.\n")); + if (!got_group_obj) + DEBUG(10,("check_owning_objs: ACL is missing an owning group entry.\n")); +} + /**************************************************************************** Unpack a SEC_DESC into two canonical ace lists. ****************************************************************************/ @@ -687,6 +766,8 @@ static BOOL create_canon_ace_lists(files_struct *fsp, canon_ace **ppfile_ace, canon_ace **ppdir_ace, SEC_ACL *dacl) { + extern DOM_SID global_sid_Creator_Owner; + extern DOM_SID global_sid_Creator_Group; extern DOM_SID global_sid_World; extern struct generic_mapping file_generic_mapping; BOOL all_aces_are_inherit_only = (fsp->is_directory ? True : False); @@ -713,23 +794,25 @@ static BOOL create_canon_ace_lists(files_struct *fsp, return False; } - /* - * The security mask may be UNIX_ACCESS_NONE which should map into - * no permissions (we overload the WRITE_OWNER bit for this) or it - * should be one of the ALL/EXECUTE/READ/WRITE bits. Arrange for this - * to be so. Any other bits override the UNIX_ACCESS_NONE bit. - */ + if (nt4_compatible_acls()) { + /* + * The security mask may be UNIX_ACCESS_NONE which should map into + * no permissions (we overload the WRITE_OWNER bit for this) or it + * should be one of the ALL/EXECUTE/READ/WRITE bits. Arrange for this + * to be so. Any other bits override the UNIX_ACCESS_NONE bit. + */ - /* - * Convert GENERIC bits to specific bits. - */ + /* + * Convert GENERIC bits to specific bits. + */ - se_map_generic(&psa->info.mask, &file_generic_mapping); + se_map_generic(&psa->info.mask, &file_generic_mapping); - psa->info.mask &= (UNIX_ACCESS_NONE|FILE_ALL_ACCESS); + psa->info.mask &= (UNIX_ACCESS_NONE|FILE_ALL_ACCESS); - if(psa->info.mask != UNIX_ACCESS_NONE) - psa->info.mask &= ~UNIX_ACCESS_NONE; + if(psa->info.mask != UNIX_ACCESS_NONE) + psa->info.mask &= ~UNIX_ACCESS_NONE; + } } /* @@ -804,15 +887,45 @@ static BOOL create_canon_ace_lists(files_struct *fsp, /* * Try and work out if the SID is a user or group * as we need to flag these differently for POSIX. + * Note what kind of a POSIX ACL this should map to. */ if( sid_equal(¤t_ace->trustee, &global_sid_World)) { current_ace->owner_type = WORLD_ACE; current_ace->unix_ug.world = -1; + current_ace->type = SMB_ACL_OTHER; + } else if (sid_equal(¤t_ace->trustee, &global_sid_Creator_Owner)) { + current_ace->owner_type = UID_ACE; + current_ace->unix_ug.world = -1; + current_ace->type = SMB_ACL_USER_OBJ; + + /* + * The Creator Owner entry only specifies inheritable permissions, + * never access permissions. WinNT doesn't always set the ACE to + *INHERIT_ONLY, though. + */ + + if (nt4_compatible_acls()) + psa->flags |= SEC_ACE_FLAG_INHERIT_ONLY; + } else if (sid_equal(¤t_ace->trustee, &global_sid_Creator_Group)) { + current_ace->owner_type = GID_ACE; + current_ace->unix_ug.world = -1; + current_ace->type = SMB_ACL_GROUP_OBJ; + + /* + * The Creator Group entry only specifies inheritable permissions, + * never access permissions. WinNT doesn't always set the ACE to + *INHERIT_ONLY, though. + */ + if (nt4_compatible_acls()) + psa->flags |= SEC_ACE_FLAG_INHERIT_ONLY; + } else if (sid_to_uid( ¤t_ace->trustee, ¤t_ace->unix_ug.uid, &sid_type)) { current_ace->owner_type = UID_ACE; + current_ace->type = SMB_ACL_USER; } else if (sid_to_gid( ¤t_ace->trustee, ¤t_ace->unix_ug.gid, &sid_type)) { current_ace->owner_type = GID_ACE; + current_ace->type = SMB_ACL_GROUP; } else { fstring str; @@ -832,31 +945,6 @@ static BOOL create_canon_ace_lists(files_struct *fsp, current_ace->perms |= map_nt_perms( psa->info, S_IRUSR); current_ace->attr = (psa->type == SEC_ACE_TYPE_ACCESS_ALLOWED) ? ALLOW_ACE : DENY_ACE; - /* - * Now note what kind of a POSIX ACL this should map to. - */ - - if(sid_equal(¤t_ace->trustee, pfile_owner_sid)) { - - current_ace->type = SMB_ACL_USER_OBJ; - - } else if( sid_equal(¤t_ace->trustee, pfile_grp_sid)) { - - current_ace->type = SMB_ACL_GROUP_OBJ; - - } else if( sid_equal(¤t_ace->trustee, &global_sid_World)) { - - current_ace->type = SMB_ACL_OTHER; - - } else { - /* - * Could be a SMB_ACL_USER or SMB_ACL_GROUP. Check by - * looking at owner_type. - */ - - current_ace->type = (current_ace->owner_type == UID_ACE) ? SMB_ACL_USER : SMB_ACL_GROUP; - } - /* * Now add the created ace to either the file list, the directory * list, or both. We *MUST* preserve the order here (hence we use @@ -970,6 +1058,15 @@ Deny entry after Allow entry. Failing to set on file %s.\n", fsp->fsp_name )); free_canon_ace_list(dir_ace); file_ace = NULL; dir_ace = NULL; + } else { + /* + * Check if we have SMB_ACL_USER_OBJ and SMB_ACL_GROUP_OBJ entries in each + * ACL. If we don't have them, check if any SMB_ACL_USER/SMB_ACL_GROUP + * entries can be converted to *_OBJ. Usually we will already have these + * entries in the Default ACL, and the Access ACL will not have them. + */ + check_owning_objs(file_ace, pfile_owner_sid, pfile_grp_sid); + check_owning_objs(dir_ace, pfile_owner_sid, pfile_grp_sid); } *ppfile_ace = file_ace; @@ -1375,7 +1472,7 @@ static BOOL unpack_canon_ace(files_struct *fsp, pst->st_mode = create_default_mode(fsp, True); - if (!ensure_canon_entry_valid(&dir_ace, fsp, pfile_owner_sid, pfile_grp_sid, pst, True)) { + if (dir_ace && !ensure_canon_entry_valid(&dir_ace, fsp, pfile_owner_sid, pfile_grp_sid, pst, True)) { free_canon_ace_list(file_ace); free_canon_ace_list(dir_ace); return False; @@ -1398,14 +1495,13 @@ static BOOL unpack_canon_ace(files_struct *fsp, Note that this doesn't exactly match the NT semantics for an ACL. As POSIX entries are not ordered, and match on the most specific entry rather than walking a list, - then a simple POSIX permission of rw-r--r-- should really map to 6 entries, + then a simple POSIX permission of rw-r--r-- should really map to 5 entries, Entry 0: owner : deny all except read and write. Entry 1: group : deny all except read. - Entry 2: Everyone : deny all except read. - Entry 3: owner : allow read and write. - Entry 4: group : allow read. - Entry 5: Everyone : allow read. + Entry 2: owner : allow read and write. + Entry 3: group : allow read. + Entry 4: Everyone : allow read. But NT cannot display this in their ACL editor ! ********************************************************************************/ @@ -1455,7 +1551,7 @@ static void arrange_posix_perms( char *filename, canon_ace **pp_list_head) ****************************************************************************/ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_STRUCT_STAT *psbuf, - DOM_SID *powner, DOM_SID *pgroup) + DOM_SID *powner, DOM_SID *pgroup, SMB_ACL_TYPE_T acl_type) { extern DOM_SID global_sid_World; connection_struct *conn = fsp->conn; @@ -1489,7 +1585,7 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_ switch(tagtype) { case SMB_ACL_USER_OBJ: /* Get the SID from the owner. */ - uid_to_sid( &sid, psbuf->st_uid ); + sid_copy(&sid, powner); unix_ug.uid = psbuf->st_uid; owner_type = UID_ACE; break; @@ -1500,6 +1596,15 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_ DEBUG(0,("canonicalise_acl: Failed to get uid.\n")); continue; } + /* + * A SMB_ACL_USER entry for the owner is shadowed by the + * SMB_ACL_USER_OBJ entry and Windows also cannot represent + * that entry, so we ignore it. We also don't create such + * entries out of the blue when setting ACLs, so a get/set + * cycle will drop them. + */ + if (acl_type == SMB_ACL_TYPE_ACCESS && *puid == psbuf->st_uid) + continue; uid_to_sid( &sid, *puid); unix_ug.uid = *puid; owner_type = UID_ACE; @@ -1508,7 +1613,7 @@ static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_ } case SMB_ACL_GROUP_OBJ: /* Get the SID from the owning group. */ - gid_to_sid( &sid, psbuf->st_gid ); + sid_copy(&sid, pgroup); unix_ug.gid = psbuf->st_gid; owner_type = GID_ACE; break; @@ -1611,8 +1716,11 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau canon_ace *p_ace; int i; SMB_ACL_ENTRY_T mask_entry; + BOOL got_mask_entry = False; SMB_ACL_PERMSET_T mask_permset; SMB_ACL_TYPE_T the_acl_type = (default_ace ? SMB_ACL_TYPE_DEFAULT : SMB_ACL_TYPE_ACCESS); + BOOL needs_mask = False; + mode_t mask_perms = 0; if (the_acl == NULL) { @@ -1632,6 +1740,20 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau SMB_ACL_ENTRY_T the_entry; SMB_ACL_PERMSET_T the_permset; + /* + * ACLs only "need" an ACL_MASK entry if there are any named user or + * named group entries. But if there is an ACL_MASK entry, it applies + * to ACL_USER, ACL_GROUP, and ACL_GROUP_OBJ entries. Set the mask + * so that it doesn't deny (i.e., mask off) any permissions. + */ + + if (p_ace->type == SMB_ACL_USER || p_ace->type == SMB_ACL_GROUP) { + needs_mask = True; + mask_perms |= p_ace->perms; + } else if (p_ace->type == SMB_ACL_GROUP_OBJ) { + mask_perms |= p_ace->perms; + } + /* * Get the entry for this ACE. */ @@ -1642,6 +1764,11 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau goto done; } + if (p_ace->type == SMB_ACL_MASK) { + mask_entry = the_entry; + got_mask_entry = True; + } + /* * Ok - we now know the ACL calls should be working, don't * allow fallback to chmod. @@ -1706,33 +1833,31 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau print_canon_ace( p_ace, i); } - /* - * Add in a mask of rwx. - */ - - if (conn->vfs_ops.sys_acl_create_entry( conn, &the_acl, &mask_entry) == -1) { - DEBUG(0,("set_canon_ace_list: Failed to create mask entry. (%s)\n", strerror(errno) )); - goto done; - } + if (needs_mask && !got_mask_entry) { + if (conn->vfs_ops.sys_acl_create_entry(conn, &the_acl, &mask_entry) == -1) { + DEBUG(0,("set_canon_ace_list: Failed to create mask entry. (%s)\n", strerror(errno) )); + goto done; + } - if (conn->vfs_ops.sys_acl_set_tag_type(conn, mask_entry, SMB_ACL_MASK) == -1) { - DEBUG(0,("set_canon_ace_list: Failed to set tag type on mask entry. (%s)\n",strerror(errno) )); - goto done; - } + if (conn->vfs_ops.sys_acl_set_tag_type(conn, mask_entry, SMB_ACL_MASK) == -1) { + DEBUG(0,("set_canon_ace_list: Failed to set tag type on mask entry. (%s)\n",strerror(errno) )); + goto done; + } - if (conn->vfs_ops.sys_acl_get_permset(conn, mask_entry, &mask_permset) == -1) { - DEBUG(0,("set_canon_ace_list: Failed to get mask permset. (%s)\n", strerror(errno) )); - goto done; - } + if (conn->vfs_ops.sys_acl_get_permset(conn, mask_entry, &mask_permset) == -1) { + DEBUG(0,("set_canon_ace_list: Failed to get mask permset. (%s)\n", strerror(errno) )); + goto done; + } - if (map_acl_perms_to_permset(conn, S_IRUSR|S_IWUSR|S_IXUSR, &mask_permset) == -1) { - DEBUG(0,("set_canon_ace_list: Failed to create mask permset. (%s)\n", strerror(errno) )); - goto done; - } + if (map_acl_perms_to_permset(conn, S_IRUSR|S_IWUSR|S_IXUSR, &mask_permset) == -1) { + DEBUG(0,("set_canon_ace_list: Failed to create mask permset. (%s)\n", strerror(errno) )); + goto done; + } - if (conn->vfs_ops.sys_acl_set_permset(conn, mask_entry, mask_permset) == -1) { - DEBUG(0,("set_canon_ace_list: Failed to add mask permset. (%s)\n", strerror(errno) )); - goto done; + if (conn->vfs_ops.sys_acl_set_permset(conn, mask_entry, mask_permset) == -1) { + DEBUG(0,("set_canon_ace_list: Failed to add mask permset. (%s)\n", strerror(errno) )); + goto done; + } } /* @@ -1758,6 +1883,12 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau */ if (errno == ENOSYS) *pacl_set_support = False; + +#ifdef ENOTSUP + if (errno == ENOTSUP) + *pacl_set_support = False; +#endif + DEBUG(2,("set_canon_ace_list: sys_acl_set_file type %s failed for file %s (%s).\n", the_acl_type == SMB_ACL_TYPE_DEFAULT ? "directory default" : "file", fsp->fsp_name, strerror(errno) )); @@ -1771,6 +1902,12 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau */ if (errno == ENOSYS) *pacl_set_support = False; + +#ifdef ENOTSUP + if (errno == ENOTSUP) + *pacl_set_support = False; +#endif + DEBUG(2,("set_canon_ace_list: sys_acl_set_file failed for file %s (%s).\n", fsp->fsp_name, strerror(errno) )); goto done; @@ -1787,6 +1924,39 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau return ret; } +/**************************************************************************** + Find a particular canon_ace entry. +****************************************************************************/ + +static struct canon_ace *canon_ace_entry_for(struct canon_ace *list, SMB_ACL_TAG_T type, posix_id *id) +{ + while (list) { + if (list->type == type && ((type != SMB_ACL_USER && type != SMB_ACL_GROUP) || + (type == SMB_ACL_USER && id && id->uid == list->unix_ug.uid) || + (type == SMB_ACL_GROUP && id && id->gid == list->unix_ug.gid))) + break; + list = list->next; + } + return list; +} + +/**************************************************************************** + +****************************************************************************/ + +SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T acl) +{ + SMB_ACL_ENTRY_T entry; + + if (!acl) + return NULL; + if (conn->vfs_ops.sys_acl_get_entry(conn, acl, SMB_ACL_FIRST_ENTRY, &entry) != 1) { + conn->vfs_ops.sys_acl_free_acl(conn, acl); + return NULL; + } + return acl; +} + /**************************************************************************** Convert a canon_ace to a generic 3 element permission - if possible. ****************************************************************************/ @@ -1922,6 +2092,8 @@ size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc) { extern DOM_SID global_sid_Builtin_Administrators; extern DOM_SID global_sid_Builtin_Users; + extern DOM_SID global_sid_Creator_Owner; + extern DOM_SID global_sid_Creator_Group; connection_struct *conn = fsp->conn; SMB_STRUCT_STAT sbuf; SEC_ACE *nt_ace_list = NULL; @@ -1958,8 +2130,10 @@ size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc) * If it's a directory get the default POSIX ACL. */ - if(fsp->is_directory) + if(fsp->is_directory) { dir_acl = conn->vfs_ops.sys_acl_get_file(conn, fsp->fsp_name, SMB_ACL_TYPE_DEFAULT); + dir_acl = free_empty_sys_acl(conn, dir_acl); + } } else { @@ -1990,35 +2164,31 @@ size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc) create_file_sids(&sbuf, &owner_sid, &group_sid); } + /* + * In the optimum case Creator Owner and Creator Group would be used for + * the ACL_USER_OBJ and ACL_GROUP_OBJ entries, respectively, but this + * would lead to usability problems under Windows: The Creator entries + * are only available in browse lists of directories and not for files; + * additionally the identity of the owning group couldn't be determined. + * We therefore use those identities only for Default ACLs. + */ + /* Create the canon_ace lists. */ - file_ace = canonicalise_acl( fsp, posix_acl, &sbuf, &owner_sid, &group_sid); - num_acls = count_canon_ace_list(file_ace); + file_ace = canonicalise_acl( fsp, posix_acl, &sbuf, &owner_sid, &group_sid, SMB_ACL_TYPE_ACCESS ); /* We must have *some* ACLS. */ - if (num_acls == 0) { + if (count_canon_ace_list(file_ace) == 0) { DEBUG(0,("get_nt_acl : No ACLs on file (%s) !\n", fsp->fsp_name )); return 0; } - if (fsp->is_directory) { - /* - * If we have to fake a default ACL then this is the mode to use. - */ - sbuf.st_mode = unix_mode( fsp->conn, FILE_ATTRIBUTE_ARCHIVE, fsp->fsp_name); - - dir_ace = canonicalise_acl(fsp, dir_acl, &sbuf, &owner_sid, &group_sid); - num_dir_acls = count_canon_ace_list(dir_ace); - } - - /* Allocate the ace list. */ - if ((nt_ace_list = (SEC_ACE *)malloc((num_acls + num_profile_acls + num_dir_acls)* sizeof(SEC_ACE))) == NULL) { - DEBUG(0,("get_nt_acl: Unable to malloc space for nt_ace_list.\n")); - goto done; + if (fsp->is_directory && dir_acl) { + dir_ace = canonicalise_acl(fsp, dir_acl, &sbuf, + &global_sid_Creator_Owner, + &global_sid_Creator_Group, SMB_ACL_TYPE_DEFAULT ); } - memset(nt_ace_list, '\0', (num_acls + num_profile_acls + num_dir_acls) * sizeof(SEC_ACE) ); - /* * Create the NT ACE list from the canonical ace lists. */ @@ -2028,16 +2198,112 @@ size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc) int nt_acl_type; int i; + if (nt4_compatible_acls()) { + /* + * NT 4 chokes if an ACL contains an INHERIT_ONLY entry + * but no non-INHERIT_ONLY entry for one SID. So we only + * remove entries from the Access ACL if the + * corresponding Default ACL entries have also been + * removed. ACEs for CREATOR-OWNER and CREATOR-GROUP + * are exceptions. We can do nothing + * intelligent if the Default ACL contains entries that + * are not also contained in the Access ACL, so this + * case will still fail under NT 4. + */ + + if (!dir_ace) + goto simplify_file_ace_only; + + ace = canon_ace_entry_for(dir_ace, SMB_ACL_OTHER, NULL); + if (ace && !ace->perms) { + DLIST_REMOVE(dir_ace, ace); + SAFE_FREE(ace); + + ace = canon_ace_entry_for(file_ace, SMB_ACL_OTHER, NULL); + if (ace && !ace->perms) { + DLIST_REMOVE(file_ace, ace); + SAFE_FREE(ace); + } + } + + /* + * WinNT doesn't usually have Creator Group + * in browse lists, so we send this entry to + * WinNT even if it contains no relevant + * permissions. Once we can add + * Creator Group to browse lists we can + * re-enable this. + */ + +#if 0 + ace = canon_ace_entry_for(dir_ace, SMB_ACL_GROUP_OBJ, NULL); + if (ace && !ace->perms) { + DLIST_REMOVE(dir_ace, ace); + SAFE_FREE(ace); + } +#endif + + ace = canon_ace_entry_for(file_ace, SMB_ACL_GROUP_OBJ, NULL); + if (ace && !ace->perms) { + DLIST_REMOVE(file_ace, ace); + SAFE_FREE(ace); + } + } else { + + ace = canon_ace_entry_for(dir_ace, SMB_ACL_OTHER, NULL); + if (ace && !ace->perms) { + DLIST_REMOVE(dir_ace, ace); + SAFE_FREE(ace); + } + ace = canon_ace_entry_for(dir_ace, SMB_ACL_GROUP_OBJ, NULL); + if (ace && !ace->perms) { + DLIST_REMOVE(dir_ace, ace); + SAFE_FREE(ace); + } + + simplify_file_ace_only: + + ace = canon_ace_entry_for(file_ace, SMB_ACL_OTHER, NULL); + if (ace && !ace->perms) { + DLIST_REMOVE(file_ace, ace); + SAFE_FREE(ace); + } + + ace = canon_ace_entry_for(file_ace, SMB_ACL_GROUP_OBJ, NULL); + if (ace && !ace->perms) { + DLIST_REMOVE(file_ace, ace); + SAFE_FREE(ace); + } + } + + num_acls = count_canon_ace_list(file_ace); + num_dir_acls = count_canon_ace_list(dir_ace); + + /* Allocate the ace list. */ + if ((nt_ace_list = (SEC_ACE *)malloc((num_acls + num_profile_acls + num_dir_acls)* sizeof(SEC_ACE))) == NULL) { + DEBUG(0,("get_nt_acl: Unable to malloc space for nt_ace_list.\n")); + goto done; + } + + memset(nt_ace_list, '\0', (num_acls + num_dir_acls) * sizeof(SEC_ACE) ); + + /* + * Create the NT ACE list from the canonical ace lists. + */ + ace = file_ace; for (i = 0; i < num_acls; i++, ace = ace->next) { - SEC_ACCESS acc = map_canon_ace_perms(&nt_acl_type, &owner_sid, ace ); + SEC_ACCESS acc; + + acc = map_canon_ace_perms(&nt_acl_type, &owner_sid, ace ); init_sec_ace(&nt_ace_list[num_aces++], &ace->trustee, nt_acl_type, acc, 0); } /* The User must have access to a profile share - even if we can't map the SID. */ if (lp_profile_acls(SNUM(fsp->conn))) { SEC_ACCESS acc; + init_sec_access(&acc,FILE_GENERIC_ALL); init_sec_ace(&nt_ace_list[num_aces++], &global_sid_Builtin_Users, SEC_ACE_TYPE_ACCESS_ALLOWED, acc, 0); } @@ -2045,14 +2311,17 @@ size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc) ace = dir_ace; for (i = 0; i < num_dir_acls; i++, ace = ace->next) { - SEC_ACCESS acc = map_canon_ace_perms(&nt_acl_type, &owner_sid, ace ); - init_sec_ace(&nt_ace_list[num_aces++], &ace->trustee, nt_acl_type, acc, + SEC_ACCESS acc; + + acc = map_canon_ace_perms(&nt_acl_type, &owner_sid, ace ); + init_sec_ace(&nt_ace_list[num_aces++], &ace->trustee, nt_acl_type, acc, SEC_ACE_FLAG_OBJECT_INHERIT|SEC_ACE_FLAG_CONTAINER_INHERIT|SEC_ACE_FLAG_INHERIT_ONLY); } /* The User must have access to a profile share - even if we can't map the SID. */ if (lp_profile_acls(SNUM(fsp->conn))) { SEC_ACCESS acc; + init_sec_access(&acc,FILE_GENERIC_ALL); init_sec_ace(&nt_ace_list[num_aces++], &global_sid_Builtin_Users, SEC_ACE_TYPE_ACCESS_ALLOWED, acc, SEC_ACE_FLAG_OBJECT_INHERIT|SEC_ACE_FLAG_CONTAINER_INHERIT| @@ -2087,11 +2356,22 @@ size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc) if(!*ppdesc) { DEBUG(0,("get_nt_acl: Unable to malloc space for security descriptor.\n")); sd_size = 0; + } else { + /* + * Windows 2000: The DACL_PROTECTED flag in the security + * descriptor marks the ACL as non-inheriting, i.e., no + * ACEs from higher level directories propagate to this + * ACL. In the POSIX ACL model permissions are only + * inherited at file create time, so ACLs never contain + * any ACEs that are inherited dynamically. The DACL_PROTECTED + * flag doesn't seem to bother Windows NT. + */ + (*ppdesc)->type |= SE_DESC_DACL_PROTECTED; } - done: + done: - if (posix_acl) + if (posix_acl) conn->vfs_ops.sys_acl_free_acl(conn, posix_acl); if (dir_acl) conn->vfs_ops.sys_acl_free_acl(conn, dir_acl); @@ -2379,6 +2659,12 @@ static int chmod_acl_internals( connection_struct *conn, SMB_ACL_T posix_acl, mo perms = unix_perms_to_acl_perms(mode, S_IRGRP, S_IWGRP, S_IXGRP); break; case SMB_ACL_MASK: + /* + * FIXME: The ACL_MASK entry permissions should really be set to + * the union of the permissions of all ACL_USER, + * ACL_GROUP_OBJ, and ACL_GROUP entries. That's what + * acl_calc_mask() does, but Samba ACLs doesn't provide it. + */ perms = S_IRUSR|S_IWUSR|S_IXUSR; break; case SMB_ACL_OTHER: @@ -2407,30 +2693,57 @@ static int chmod_acl_internals( connection_struct *conn, SMB_ACL_T posix_acl, mo } /**************************************************************************** - Do a chmod by setting the ACL USER_OBJ, GROUP_OBJ and OTHER bits in an ACL - and set the mask to rwx. Needed to preserve complex ACLs set by NT. - Note that name is in UNIX character set. + Get the access ACL of FROM, do a chmod by setting the ACL USER_OBJ, + GROUP_OBJ and OTHER bits in an ACL and set the mask to rwx. Set the + resulting ACL on TO. Note that name is in UNIX character set. ****************************************************************************/ -int chmod_acl(connection_struct *conn, const char *name, mode_t mode) +static int copy_access_acl(connection_struct *conn, const char *from, const char *to, mode_t mode) { SMB_ACL_T posix_acl = NULL; int ret = -1; - if ((posix_acl = conn->vfs_ops.sys_acl_get_file(conn, name, SMB_ACL_TYPE_ACCESS)) == NULL) + if ((posix_acl = conn->vfs_ops.sys_acl_get_file(conn, from, SMB_ACL_TYPE_ACCESS)) == NULL) return -1; if ((ret = chmod_acl_internals(conn, posix_acl, mode)) == -1) goto done; - ret = conn->vfs_ops.sys_acl_set_file(conn, name, SMB_ACL_TYPE_ACCESS, posix_acl); + ret = conn->vfs_ops.sys_acl_set_file(conn, to, SMB_ACL_TYPE_ACCESS, posix_acl); - done: + done: conn->vfs_ops.sys_acl_free_acl(conn, posix_acl); return ret; } +/**************************************************************************** + Do a chmod by setting the ACL USER_OBJ, GROUP_OBJ and OTHER bits in an ACL + and set the mask to rwx. Needed to preserve complex ACLs set by NT. + Note that name is in UNIX character set. +****************************************************************************/ + +int chmod_acl(connection_struct *conn, const char *name, mode_t mode) +{ + return copy_access_acl(conn, name, name, mode); +} + +/**************************************************************************** + If "inherit permissions" is set and the parent directory has no default + ACL but it does have an Access ACL, inherit this Access ACL to file name. +****************************************************************************/ + +int inherit_access_acl(connection_struct *conn, const char *name, mode_t mode) +{ + pstring dirname; + pstrcpy(dirname, parent_dirname(name)); + + if (!lp_inherit_perms(SNUM(conn)) || directory_has_default_acl(conn, dirname)) + return 0; + + return copy_access_acl(conn, dirname, name, mode); +} + /**************************************************************************** Do an fchmod by setting the ACL USER_OBJ, GROUP_OBJ and OTHER bits in an ACL and set the mask to rwx. Needed to preserve complex ACLs set by NT. diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index de65cda2d0..8b9728d513 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -2622,6 +2622,8 @@ size = %.0f, uid = %u, gid = %u, raw perms = 0%o\n", if (conn->vfs_ops.mknod(conn,dos_to_unix_static(fname), unixmode, dev) != 0) return(UNIXERROR(ERRDOS,ERRnoaccess)); + inherit_access_acl(conn, fname, unixmode); + SSVAL(params,0,0); send_trans2_replies(outbuf, bufsize, params, 2, *ppdata, 0); return(-1); diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 2bda26aa51..9a38d6e9e2 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -456,7 +456,7 @@ BOOL lookup_name(const char *domain, const char *name, DOM_SID *psid, enum SID_N if (strequal(global_myname, domain)) { local_lookup = True; } else if (lp_server_role() == ROLE_DOMAIN_PDC || - lp_server_role() == ROLE_DOMAIN_PDC) { + lp_server_role() == ROLE_DOMAIN_BDC) { if (strequal(domain, global_myworkgroup)) { local_lookup = True; } diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index a0a7b920b8..f6dad7b6e7 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -319,6 +319,9 @@ int vfs_mkdir(connection_struct *conn, const char *name, mode_t mode) SMB_STRUCT_STAT sbuf; if(!(ret=conn->vfs_ops.mkdir(conn,name,mode))) { + + inherit_access_acl(conn, name, mode); + /* * Check if high bits should have been set, * then (if bits are missing): add them. -- cgit From b064077145e61ed4bdf2ccb9b91c94b8c2acb27a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 23 Oct 2002 01:55:40 +0000 Subject: Debug level 12 is a typo. Jeremy. (This used to be commit 4d9b205362997f897be4739efd52ee2cfde4c6cb) --- source3/rpc_server/srv_samr_nt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index 6ef2fcd67d..0718af016f 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -281,7 +281,7 @@ static NTSTATUS load_sampwd_entries(struct samr_info *info, uint16 acb_mask, BOO info->all_machines = all_machines; info->disp_info.user_dbloaded=True; - DEBUG(12,("load_sampwd_entries: done\n")); + DEBUG(10,("load_sampwd_entries: done\n")); return nt_status; } @@ -333,7 +333,7 @@ static NTSTATUS load_group_domain_entries(struct samr_info *info, DOM_SID *sid) info->disp_info.group_dbloaded=True; - DEBUG(12,("load_group_domain_entries: done\n")); + DEBUG(10,("load_group_domain_entries: done\n")); return NT_STATUS_OK; } -- cgit From e53b7d6496957ed4d80c82120df81c13abb8e298 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 23 Oct 2002 03:37:51 +0000 Subject: much simpler code to choose a DC to contact in winbindd. We now always choose the server that has the most bits in common in its IP with one of our interfaces. (This used to be commit 31774dce67844b67cb405e65f307a20354f2cedb) --- source3/nsswitch/winbindd_cm.c | 61 +++++------------------------------------- 1 file changed, 6 insertions(+), 55 deletions(-) diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c index 5f477c78f7..3b83fde95b 100644 --- a/source3/nsswitch/winbindd_cm.c +++ b/source3/nsswitch/winbindd_cm.c @@ -140,70 +140,20 @@ static BOOL cm_ads_find_dc(const char *domain, struct in_addr *dc_ip, fstring sr */ static BOOL cm_rpc_find_dc(const char *domain, struct in_addr *dc_ip, fstring srv_name) { - struct in_addr *ip_list = NULL, exclude_ip; + struct in_addr *ip_list = NULL; int count, i; - zero_ip(&exclude_ip); - - /* Lookup domain controller name. Try the real PDC first to avoid - SAM sync delays */ - - if (get_dc_list(True, domain, &ip_list, &count)) { - if (name_status_find(domain, 0x1c, 0x20, ip_list[0], srv_name)) { - *dc_ip = ip_list[0]; - SAFE_FREE(ip_list); - return True; - } - /* Didn't get name, remember not to talk to this DC. */ - exclude_ip = ip_list[0]; - SAFE_FREE(ip_list); - } - - if (!get_dc_list(False, domain, &ip_list, &count)) { + if (!get_dc_list(False, domain, &ip_list, &count) && + !get_dc_list(True, domain, &ip_list, &count)) { DEBUG(3, ("Could not look up dc's for domain %s\n", domain)); return False; } - /* Remove the entry we've already failed with (should be the PDC). */ - for (i = 0; i < count; i++) { - if (ip_equal( exclude_ip, ip_list[i])) - zero_ip(&ip_list[i]); - } - /* Pick a nice close server */ - /* Look for DC on local net */ - for (i = 0; i < count; i++) { - if (is_zero_ip(ip_list[i])) - continue; - - if (!is_local_net(ip_list[i])) - continue; - - if (name_status_find(domain, 0x1c, 0x20, ip_list[i], srv_name)) { - *dc_ip = ip_list[i]; - SAFE_FREE(ip_list); - return True; - } - zero_ip(&ip_list[i]); - } - - /* - * Secondly try and contact a random PDC/BDC. - */ - - i = (sys_random() % count); - - if (!is_zero_ip(ip_list[i]) && - name_status_find(domain, 0x1c, 0x20, - ip_list[i], srv_name)) { - *dc_ip = ip_list[i]; - SAFE_FREE(ip_list); - return True; + if (count > 1) { + qsort(ip_list, count, sizeof(struct in_addr), QSORT_CAST ip_compare); } - zero_ip(&ip_list[i]); /* Tried and failed. */ - /* Finally return first DC that we can contact using a node - status */ for (i = 0; i < count; i++) { if (is_zero_ip(ip_list[i])) continue; @@ -215,6 +165,7 @@ static BOOL cm_rpc_find_dc(const char *domain, struct in_addr *dc_ip, fstring sr } } + SAFE_FREE(ip_list); return False; -- cgit From d63afcf97a9c4224fda7c8b656e544d7f95c87bf Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 23 Oct 2002 15:29:35 +0000 Subject: Move OID documents to web module (This used to be commit 3de1a8296266615528d52895766c295b430518cb) --- docs/OID/allocated-arcs.txt | 19 ------------------- docs/OID/samba-oid.mail | 27 --------------------------- 2 files changed, 46 deletions(-) delete mode 100644 docs/OID/allocated-arcs.txt delete mode 100644 docs/OID/samba-oid.mail diff --git a/docs/OID/allocated-arcs.txt b/docs/OID/allocated-arcs.txt deleted file mode 100644 index acef4930ea..0000000000 --- a/docs/OID/allocated-arcs.txt +++ /dev/null @@ -1,19 +0,0 @@ -!=========================================================================================== -!== -!== Allocated Arcs from the Samba Team Private Enterprise Number -!== ISO(1) org(3) dod(6) internet(1) private(4) enterprise(1) Samba(7165) -!== -!== Arc allocation is maintained by jerry carter . Please notify -!== me if you need an OID and update this file. -!== -!== File Created : Tue May 8 09:33:31 CDT 2001 -!== -!=========================================================================================== - -ARC Owner Contact Purpose ---- ----- ------- ------- -.1 Plainjoe.org Jerry Carter Use for Plainjoe.org domain - and examples in O'Reilly LDAP book -.2 Samba 2.2. Release jerry@samba.org schema for representing smbpasswd -.3 Jean-Francois.Micouleau@dalalu.fr Experiemental SNMP fun - diff --git a/docs/OID/samba-oid.mail b/docs/OID/samba-oid.mail deleted file mode 100644 index d1ad668f88..0000000000 --- a/docs/OID/samba-oid.mail +++ /dev/null @@ -1,27 +0,0 @@ -From gruiz@icann.org Tue May 8 04:27:07 2001 -Date: Tue, 26 Sep 2000 15:29:02 -0700 -From: GIGI RUIZ -To: jerry@samba.org -Cc: "Iana-Mib (E-mail)" -Subject: PEN 7165 RE: Application for Enterprise-number - - [ The following text is in the "iso-8859-1" character set. ] - [ Your display is set for the "US-ASCII" character set. ] - [ Some characters may be displayed incorrectly. ] - -Gerald, - -We have assigned Private Enterprise Number 7165 to SAMBA Team, with you as -the point of contact. Please confirm the information listed below. - -7165 SAMBA Team Gerald Carter jerry@samba.org - -Sincerely, - -Gigi Ruiz -Internet Assigned Numbers Authority - MIB - -Voice: (310) 823-9358 -Fax: (310) 823-8649 -EMAIL: iana-mib@iana.org - -- cgit From 158ae87aa9e530c3dc784ebfb3715c2ae254fd31 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 23 Oct 2002 22:23:39 +0000 Subject: Reverted a fix from Volker (sorry). We need to move this fix to the correct place. Jeremy. (This used to be commit e46e38beabe8ae5b1ba1941dcffecbc89165ce2a) --- source3/rpc_server/srv_samr_nt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index 0718af016f..b039d92d9c 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -1188,7 +1188,10 @@ NTSTATUS _samr_query_dispinfo(pipes_struct *p, SAMR_Q_QUERY_DISPINFO *q_u, user handle. Where else does this hurt? -- Volker */ +#if 0 + /* We cannot do this here - it kills performace. JRA. */ free_samr_users(info); +#endif case 0x2: case 0x4: become_root(); -- cgit From af09297cbc1f8aa046847728077b34f9a5186872 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 24 Oct 2002 13:30:45 +0000 Subject: Document -P and -V (patch from Guenther Deschner ) (This used to be commit 5845f17c927a84ba502c834b3a38499959b7ae40) --- docs/docbook/manpages/pdbedit.8.sgml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/docbook/manpages/pdbedit.8.sgml b/docs/docbook/manpages/pdbedit.8.sgml index 45ccbaee64..fd8ce375e5 100644 --- a/docs/docbook/manpages/pdbedit.8.sgml +++ b/docs/docbook/manpages/pdbedit.8.sgml @@ -31,6 +31,8 @@ -e passdb-backend -b passdb-backend -D debuglevel + -P account-policy + -V value @@ -268,6 +270,36 @@ Example: pdbedit -b xml:/root/pdb-backup.xml -l + + + -P account-policy + Display an account policy + Valid policies are: minimum password age, reset count minutes, disconnect time, + user must logon to change password, password history, lockout duration, min password length, + maximum password age and bad lockout attempt. + + Example: pdbedit -P "bad lockout attempt" + + account policy value for bad lockout attempt is 0 + + + + + + + -V account-policy-value + Sets an account policy to a specified value. + This option may only be used in conjunction + with the -P option. + + Example: pdbedit -P "bad lockout attempt" -V 3 + + account policy value for bad lockout attempt was 0 + account policy value for bad lockout attempt is now 3 + + + + -- cgit From 5b90fdc6bbe230cd676712c4de11b6dd78d8cb25 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 25 Oct 2002 00:36:28 +0000 Subject: Only run free_private_data when it's specified (reported by Steve Langasek aka vorlon) (This used to be commit 9efa98b4a65a38df922ce3b83f5fde631cb70844) --- source3/passdb/pdb_interface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index 7200150e37..ca199f8ea6 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -354,7 +354,8 @@ static void free_pdb_context(struct pdb_context **context) struct pdb_methods *pdb_selected = (*context)->pdb_methods; while (pdb_selected){ - pdb_selected->free_private_data(&(pdb_selected->private_data)); + if(pdb_selected->free_private_data) + pdb_selected->free_private_data(&(pdb_selected->private_data)); pdb_selected = pdb_selected->next; } -- cgit From bea0b200c8e5b5adf1e7e28a6998b4c4fa7a22c4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 25 Oct 2002 02:37:11 +0000 Subject: Fix memory leak (patch by Steve Langasek) (This used to be commit 06362586cb754bd6bc89b50b966737958286ca2e) --- source3/passdb/pdb_nisplus.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source3/passdb/pdb_nisplus.c b/source3/passdb/pdb_nisplus.c index 80e55454ef..0a42c36ea0 100644 --- a/source3/passdb/pdb_nisplus.c +++ b/source3/passdb/pdb_nisplus.c @@ -1508,6 +1508,19 @@ static nis_result *nisp_get_nis_list (const char *nisname, unsigned int flags) return result; } +static void free_private_data(void **vp) +{ + struct nisplus_private_info **private = (struct nisplus_private_info **)vp; + + if ((*private)->result) { + nis_freeresult ((*private)->result); + } + + free(*private); + + /* No need to free any further, as it is talloc()ed */ +} + NTSTATUS pdb_init_nisplussam (PDB_CONTEXT * pdb_context, PDB_METHODS ** pdb_method, const char *location) { @@ -1536,6 +1549,7 @@ NTSTATUS pdb_init_nisplussam (PDB_CONTEXT * pdb_context, (*pdb_method)->add_sam_account = nisplussam_add_sam_account; (*pdb_method)->update_sam_account = nisplussam_update_sam_account; (*pdb_method)->delete_sam_account = nisplussam_delete_sam_account; + (*pdb_method)->free_private_data = free_private_data; (*pdb_method)->private_data = private; return NT_STATUS_OK; -- cgit From 71f34ddabd80f3d65d6332e734ce6e20fef31de5 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 25 Oct 2002 22:17:29 +0000 Subject: PURGE_PRINTER fix from APP_HEAD (This used to be commit 8af12875b0608b83187e4156843e37097de4cd13) --- source3/rpc_server/srv_spoolss_nt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 3e6d5d6594..a5e464f73b 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -5441,13 +5441,11 @@ static WERROR control_printer(POLICY_HND *handle, uint32 command, errcode = WERR_OK; } break; -#if 0 /* JERRY - Never called */ case PRINTER_CONTROL_PURGE: if (print_queue_purge(&user, snum, &errcode)) { errcode = WERR_OK; } break; -#endif default: return WERR_UNKNOWN_LEVEL; } -- cgit From 3103303d2a78ef2d530083502280c1bba551c4bb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 26 Oct 2002 00:29:21 +0000 Subject: Fix problem where an fd would be left open for every printer queue. Jeremy. (This used to be commit 997c234e15a5f8d742320359a53e15a27661d456) --- source3/printing/printing.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/source3/printing/printing.c b/source3/printing/printing.c index afcf0ee720..2d75699ac5 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -225,12 +225,35 @@ static struct tdb_print_db *get_print_db_byname(const char *printername) return p; } +/*************************************************************************** + Remove a reference count. +****************************************************************************/ + static void release_print_db( struct tdb_print_db *pdb) { pdb->ref_count--; SMB_ASSERT(pdb->ref_count >= 0); } +/*************************************************************************** + Close all open print db entries. +****************************************************************************/ + +static void close_all_print_db(void) +{ + struct tdb_print_db *p = NULL, *next_p = NULL; + + for (p = print_db_head; p; p = next_p) { + next_p = p->next; + + if (p->tdb) + tdb_close(p->tdb); + DLIST_REMOVE(print_db_head, p); + ZERO_STRUCTP(p); + SAFE_FREE(p); + } +} + /**************************************************************************** Initialise the printing backend. Called once at startup. Does not survive a fork @@ -264,6 +287,7 @@ BOOL print_backend_init(void) continue; if (tdb_lock_bystring(pdb->tdb, sversion, 0) == -1) { DEBUG(0,("print_backend_init: Failed to open printer %s database\n", lp_const_servicename(snum) )); + release_print_db(pdb); return False; } if (tdb_fetch_int32(pdb->tdb, sversion) != PRINT_DATABASE_VERSION) { @@ -271,8 +295,11 @@ BOOL print_backend_init(void) tdb_store_int32(pdb->tdb, sversion, PRINT_DATABASE_VERSION); } tdb_unlock_bystring(pdb->tdb, sversion); + release_print_db(pdb); } + close_all_print_db(); /* Don't leave any open. */ + /* select the appropriate printing interface... */ #ifdef HAVE_CUPS if (strcmp(lp_printcapname(), "cups") == 0) -- cgit From 185a232ae0e8e9d459cbaa74fee96f7357cf5e6c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 26 Oct 2002 00:55:14 +0000 Subject: Updates to winbind's PAM client and server - make the debug logs work a bit better for password changing. Andrew Bartlett (This used to be commit 425782ba32554b90d592493a1928a926e492bb2a) --- source3/nsswitch/pam_winbind.c | 56 +++++++++++++++++++++++++++-------------- source3/nsswitch/winbindd_pam.c | 7 ++++++ 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c index f95caefb4c..7d0353664f 100644 --- a/source3/nsswitch/pam_winbind.c +++ b/source3/nsswitch/pam_winbind.c @@ -134,22 +134,15 @@ static int pam_winbind_request(enum winbindd_cmd req_type, return PAM_SUCCESS; } -/* talk to winbindd */ -static int winbind_auth_request(const char *user, const char *pass, int ctrl) +static int pam_winbind_request_log(enum winbindd_cmd req_type, + struct winbindd_request *request, + struct winbindd_response *response, + int ctrl, + const char *user) { - struct winbindd_request request; - struct winbindd_response response; int retval; - ZERO_STRUCT(request); - - strncpy(request.data.auth.user, user, - sizeof(request.data.auth.user)-1); - - strncpy(request.data.auth.pass, pass, - sizeof(request.data.auth.pass)-1); - - retval = pam_winbind_request(WINBINDD_PAM_AUTH, &request, &response); + retval = pam_winbind_request(req_type, request, response); switch (retval) { case PAM_AUTH_ERR: @@ -178,8 +171,16 @@ static int winbind_auth_request(const char *user, const char *pass, int ctrl) } return retval; case PAM_SUCCESS: - /* Otherwise, the authentication looked good */ - _pam_log(LOG_NOTICE, "user '%s' granted acces", user); + if (req_type == WINBINDD_PAM_AUTH) { + /* Otherwise, the authentication looked good */ + _pam_log(LOG_NOTICE, "user '%s' granted acces", user); + } else if (req_type == WINBINDD_PAM_CHAUTHTOK) { + /* Otherwise, the authentication looked good */ + _pam_log(LOG_NOTICE, "user '%s' password changed", user); + } else { + /* Otherwise, the authentication looked good */ + _pam_log(LOG_NOTICE, "user '%s' OK", user); + } return retval; default: /* we don't know anything about this return value */ @@ -187,12 +188,29 @@ static int winbind_auth_request(const char *user, const char *pass, int ctrl) retval, user); return retval; } - /* should not be reached */ +} + +/* talk to winbindd */ +static int winbind_auth_request(const char *user, const char *pass, int ctrl) +{ + struct winbindd_request request; + struct winbindd_response response; + + ZERO_STRUCT(request); + + strncpy(request.data.auth.user, user, + sizeof(request.data.auth.user)-1); + + strncpy(request.data.auth.pass, pass, + sizeof(request.data.auth.pass)-1); + + + return pam_winbind_request_log(WINBINDD_PAM_AUTH, &request, &response, ctrl, user); } /* talk to winbindd */ static int winbind_chauthtok_request(const char *user, const char *oldpass, - const char *newpass) + const char *newpass, int ctrl) { struct winbindd_request request; struct winbindd_response response; @@ -218,7 +236,7 @@ static int winbind_chauthtok_request(const char *user, const char *oldpass, request.data.chauthtok.newpass[0] = '\0'; } - return pam_winbind_request(WINBINDD_PAM_CHAUTHTOK, &request, &response); + return pam_winbind_request_log(WINBINDD_PAM_CHAUTHTOK, &request, &response, ctrl, user); } /* @@ -665,7 +683,7 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t * pamh, int flags, * rebuild the password database file. */ - retval = winbind_chauthtok_request(user, pass_old, pass_new); + retval = winbind_chauthtok_request(user, pass_old, pass_new, ctrl); _pam_overwrite(pass_new); _pam_overwrite(pass_old); pass_old = pass_new = NULL; diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c index 3e7a8ad971..969cf272a3 100644 --- a/source3/nsswitch/winbindd_pam.c +++ b/source3/nsswitch/winbindd_pam.c @@ -354,5 +354,12 @@ done: fstrcpy(state->response.data.auth.error_string, nt_errstr(result)); state->response.data.auth.pam_error = nt_status_to_pam(result); + DEBUG(NT_STATUS_IS_OK(result) ? 5 : 2, + ("Password change for user [%s]\\[%s] returned %s (PAM: %d)\n", + domain, + user, + state->response.data.auth.nt_status_string, + state->response.data.auth.pam_error)); + return NT_STATUS_IS_OK(result) ? WINBINDD_OK : WINBINDD_ERROR; } -- cgit From dbfc2f42a2c4711f539364d3954b9b9c10dbddf5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 26 Oct 2002 00:59:21 +0000 Subject: Make sure that we always return False if the password change never returns. (A stuck 'unix passowrd sync' was gettting reported as 'success', causing all sorts of fun) Andrew Bartlett (This used to be commit b0d5745bb53b16e92160a6bdd2b984afb0e982ee) --- source3/libsmb/clirap.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index 2064e14954..b4924fd773 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -343,13 +343,17 @@ BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char return False; } - if (cli_receive_trans(cli,SMBtrans, + if (!cli_receive_trans(cli,SMBtrans, &rparam, &rprcnt, &rdata, &rdrcnt)) { - if (rparam) - cli->rap_error = SVAL(rparam,0); + DEBUG(0,("cli_oem_change_password: Failed to recieve reply to password change for user %s\n", + user )); + return False; } - + + if (rparam) + cli->rap_error = SVAL(rparam,0); + SAFE_FREE(rparam); SAFE_FREE(rdata); -- cgit From 991f6ddac6fb358098cb4a751144b31d2ec4d60f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 26 Oct 2002 01:47:38 +0000 Subject: One more step towards to better PDC. This patch, from "Stefan (metze) Metzmacher" implements an LDAP connection cache. This removes the quite silly situation where every single passdb operation involved a new LDAP connection. The hope is that this will give us a decent performance boost in some usrmgr related activities, and in the sid->name/sid->uid code. The remaining things I think are 'todo' for pdb_ldap (in the near term) are: - intergrate volker's next_rid patch for NUA accounts, - add a 'trust ldap ids' option (remove Get_Pwnam() hit on enumerations). - put the group mapping actually into ldap - Schema fixes and do utf8 conversion - server failover (try a second server for the rebind on fail) - ensure we block between an 'add' and the ldap master replicating to our local slave (mezte found this issue, kills domain joins) Andrew Bartlett (This used to be commit 3418da16456511490beb0d1045fff24576b48273) --- source3/passdb/pdb_ldap.c | 538 ++++++++++++++++++++++++++++------------------ 1 file changed, 330 insertions(+), 208 deletions(-) diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 63c422abea..7be05d63b6 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -64,6 +64,7 @@ struct ldapsam_privates { LDAPMessage *entry; int index; + time_t last_ping; /* retrive-once info */ const char *uri; @@ -76,6 +77,7 @@ struct ldapsam_privates { char *bind_secret; }; +#define LDAPSAM_DONT_PING_TIME 10 /* ping only all 10 seconds */ static struct ldapsam_privates *static_ldap_state; @@ -152,7 +154,7 @@ static const char *attr[] = {"uid", "pwdLastSet", "logonTime", "userWorkstations", "rid", "primaryGroupID", "lmPassword", "ntPassword", "acctFlags", - "domain", "description", NULL }; + "domain", NULL }; /******************************************************************* open a connection to the ldap server. @@ -422,17 +424,220 @@ static BOOL ldapsam_connect_system(struct ldapsam_privates *ldap_state, LDAP * l return True; } +/********************************************************************** +Connect to LDAP server +*********************************************************************/ +static NTSTATUS ldapsam_open(struct ldapsam_privates *ldap_state) +{ + if (!ldap_state) + return NT_STATUS_INVALID_PARAMETER; + + if ((ldap_state->ldap_struct != NULL) && ((ldap_state->last_ping + LDAPSAM_DONT_PING_TIME) < time(NULL))) { + struct sockaddr_un addr; + socklen_t len; + int sd; + if (ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_DESC, &sd) == 0 && + getpeername(sd, (struct sockaddr *) &addr, &len) < 0) { + /* the other end has died. reopen. */ + ldap_unbind_ext(ldap_state->ldap_struct, NULL, NULL); + ldap_state->ldap_struct = NULL; + ldap_state->last_ping = (time_t)0; + } else { + ldap_state->last_ping = time(NULL); + } + } + + if (ldap_state->ldap_struct != NULL) { + DEBUG(5,("ldapsam_open: allready connected to the LDAP server\n")); + return NT_STATUS_OK; + } + + if (!ldapsam_open_connection(ldap_state, &ldap_state->ldap_struct)) { + return NT_STATUS_UNSUCCESSFUL; + } + if (!ldapsam_connect_system(ldap_state, ldap_state->ldap_struct)) { + ldap_unbind_ext(ldap_state->ldap_struct, NULL, NULL); + ldap_state->ldap_struct = NULL; + return NT_STATUS_UNSUCCESSFUL; + } + + + ldap_state->last_ping = time(NULL); + DEBUG(4,("The LDAP server is succesful connected\n")); + + return NT_STATUS_OK; +} + +/********************************************************************** +Disconnect from LDAP server +*********************************************************************/ +static NTSTATUS ldapsam_close(struct ldapsam_privates *ldap_state) +{ + if (!ldap_state) + return NT_STATUS_INVALID_PARAMETER; + + if (ldap_state->ldap_struct != NULL) { + ldap_unbind_ext(ldap_state->ldap_struct, NULL, NULL); + ldap_state->ldap_struct = NULL; + } + + DEBUG(5,("The connection to the LDAP server was closed\n")); + /* maybe free the results here --metze */ + + return NT_STATUS_OK; +} + +static int ldapsam_retry_open(struct ldapsam_privates *ldap_state, int *attempts) +{ + if (!ldap_state || !attempts) + return (-1); + + if (*attempts != 0) { + /* we retry after 0.5, 2, 4.5, 8, 12.5, 18, 24.5 seconds */ + msleep((((*attempts)*(*attempts))/2)*1000); + } + (*attempts)++; + + if (!NT_STATUS_IS_OK(ldapsam_open(ldap_state))){ + DEBUG(0,("Connection to LDAP Server failed for the %d try!\n",*attempts)); + return LDAP_SERVER_DOWN; + } + + return LDAP_SUCCESS; +} + + +static int ldapsam_search(struct ldapsam_privates *ldap_state, char *base, int scope, char *filter, char *attrs[], int attrsonly, LDAPMessage **res) +{ + int rc = LDAP_SERVER_DOWN; + int attempts = 0; + + if (!ldap_state) + return (-1); + + while ((rc == LDAP_SERVER_DOWN) && (attempts < 8)) { + + if ((rc = ldapsam_retry_open(ldap_state,&attempts)) != LDAP_SUCCESS) + continue; + + rc = ldap_search_s(ldap_state->ldap_struct, base, scope, filter, attrs, attrsonly, res); + } + + if (rc == LDAP_SERVER_DOWN) { + DEBUG(0,("%s: LDAP server is down!\n",__FUNCTION__)); + ldapsam_close(ldap_state); + } + + return rc; +} + +static int ldapsam_modify(struct ldapsam_privates *ldap_state, char *dn, LDAPMod *attrs[]) +{ + int rc = LDAP_SERVER_DOWN; + int attempts = 0; + + if (!ldap_state) + return (-1); + + while ((rc == LDAP_SERVER_DOWN) && (attempts < 8)) { + + if ((rc = ldapsam_retry_open(ldap_state,&attempts)) != LDAP_SUCCESS) + continue; + + rc = ldap_modify_s(ldap_state->ldap_struct, dn, attrs); + } + + if (rc == LDAP_SERVER_DOWN) { + DEBUG(0,("%s: LDAP server is down!\n",__FUNCTION__)); + ldapsam_close(ldap_state); + } + + return rc; +} + +static int ldapsam_add(struct ldapsam_privates *ldap_state, const char *dn, LDAPMod *attrs[]) +{ + int rc = LDAP_SERVER_DOWN; + int attempts = 0; + + if (!ldap_state) + return (-1); + + while ((rc == LDAP_SERVER_DOWN) && (attempts < 8)) { + + if ((rc = ldapsam_retry_open(ldap_state,&attempts)) != LDAP_SUCCESS) + continue; + + rc = ldap_add_s(ldap_state->ldap_struct, dn, attrs); + } + + if (rc == LDAP_SERVER_DOWN) { + DEBUG(0,("%s: LDAP server is down!\n",__FUNCTION__)); + ldapsam_close(ldap_state); + } + + return rc; +} + +static int ldapsam_delete(struct ldapsam_privates *ldap_state, char *dn) +{ + int rc = LDAP_SERVER_DOWN; + int attempts = 0; + + if (!ldap_state) + return (-1); + + while ((rc == LDAP_SERVER_DOWN) && (attempts < 8)) { + + if ((rc = ldapsam_retry_open(ldap_state,&attempts)) != LDAP_SUCCESS) + continue; + + rc = ldap_delete_s(ldap_state->ldap_struct, dn); + } + + if (rc == LDAP_SERVER_DOWN) { + DEBUG(0,("%s: LDAP server is down!\n",__FUNCTION__)); + ldapsam_close(ldap_state); + } + + return rc; +} + +static int ldapsam_extended_operation(struct ldapsam_privates *ldap_state, LDAP_CONST char *reqoid, struct berval *reqdata, LDAPControl **serverctrls, LDAPControl **clientctrls, char **retoidp, struct berval **retdatap) +{ + int rc = LDAP_SERVER_DOWN; + int attempts = 0; + + if (!ldap_state) + return (-1); + + while ((rc == LDAP_SERVER_DOWN) && (attempts < 8)) { + + if ((rc = ldapsam_retry_open(ldap_state,&attempts)) != LDAP_SUCCESS) + continue; + + rc = ldap_extended_operation_s(ldap_state->ldap_struct, reqoid, reqdata, serverctrls, clientctrls, retoidp, retdatap); + } + + if (rc == LDAP_SERVER_DOWN) { + DEBUG(0,("%s: LDAP server is down!\n",__FUNCTION__)); + ldapsam_close(ldap_state); + } + + return rc; +} + /******************************************************************* run the search by name. ******************************************************************/ -static int ldapsam_search_one_user (struct ldapsam_privates *ldap_state, LDAP * ldap_struct, const char *filter, LDAPMessage ** result) +static int ldapsam_search_one_user (struct ldapsam_privates *ldap_state, const char *filter, LDAPMessage ** result) { int scope = LDAP_SCOPE_SUBTREE; int rc; DEBUG(2, ("ldapsam_search_one_user: searching for:[%s]\n", filter)); - rc = ldap_search_s(ldap_struct, lp_ldap_suffix (), scope, filter, (char **)attr, 0, result); + rc = ldapsam_search(ldap_state, lp_ldap_suffix (), scope, (char *)filter, (char **)attr, 0, result); if (rc != LDAP_SUCCESS) { DEBUG(0,("ldapsam_search_one_user: Problem during the LDAP search: %s\n", @@ -447,7 +652,7 @@ static int ldapsam_search_one_user (struct ldapsam_privates *ldap_state, LDAP * /******************************************************************* run the search by name. ******************************************************************/ -static int ldapsam_search_one_user_by_name (struct ldapsam_privates *ldap_state, LDAP * ldap_struct, const char *user, +static int ldapsam_search_one_user_by_name (struct ldapsam_privates *ldap_state, const char *user, LDAPMessage ** result) { pstring filter; @@ -464,14 +669,14 @@ static int ldapsam_search_one_user_by_name (struct ldapsam_privates *ldap_state, */ all_string_sub(filter, "%u", user, sizeof(pstring)); - return ldapsam_search_one_user(ldap_state, ldap_struct, filter, result); + return ldapsam_search_one_user(ldap_state, filter, result); } /******************************************************************* run the search by uid. ******************************************************************/ static int ldapsam_search_one_user_by_uid(struct ldapsam_privates *ldap_state, - LDAP * ldap_struct, int uid, + int uid, LDAPMessage ** result) { struct passwd *user; @@ -490,14 +695,14 @@ static int ldapsam_search_one_user_by_uid(struct ldapsam_privates *ldap_state, passwd_free(&user); - return ldapsam_search_one_user(ldap_state, ldap_struct, filter, result); + return ldapsam_search_one_user(ldap_state, filter, result); } /******************************************************************* run the search by rid. ******************************************************************/ static int ldapsam_search_one_user_by_rid (struct ldapsam_privates *ldap_state, - LDAP * ldap_struct, uint32 rid, + uint32 rid, LDAPMessage ** result) { pstring filter; @@ -506,10 +711,10 @@ static int ldapsam_search_one_user_by_rid (struct ldapsam_privates *ldap_state, /* check if the user rid exsists, if not, try searching on the uid */ snprintf(filter, sizeof(filter) - 1, "rid=%i", rid); - rc = ldapsam_search_one_user(ldap_state, ldap_struct, filter, result); + rc = ldapsam_search_one_user(ldap_state, filter, result); if (rc != LDAP_SUCCESS) - rc = ldapsam_search_one_user_by_uid(ldap_state, ldap_struct, + rc = ldapsam_search_one_user_by_uid(ldap_state, fallback_pdb_user_rid_to_uid(rid), result); @@ -621,7 +826,7 @@ Initialize SAM_ACCOUNT from an LDAP query *********************************************************************/ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, SAM_ACCOUNT * sampass, - LDAP * ldap_struct, LDAPMessage * entry) + LDAPMessage * entry) { time_t logon_time, logoff_time, @@ -643,8 +848,8 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, struct passwd *pw; uint32 user_rid, group_rid; - uint8 smblmpwd[16], - smbntpwd[16]; + uint8 smblmpwd[LM_HASH_LEN], + smbntpwd[NT_HASH_LEN]; uint16 acct_ctrl, logon_divs; uint32 hours_len; @@ -670,24 +875,34 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, workstations[0] = '\0'; - if (sampass == NULL || ldap_struct == NULL || entry == NULL) { + if (sampass == NULL || ldap_state == NULL || entry == NULL) { DEBUG(0, ("init_sam_from_ldap: NULL parameters found!\n")); return False; } - get_single_attribute(ldap_struct, entry, "uid", username); + if (ldap_state->ldap_struct == NULL) { + DEBUG(0, ("init_sam_from_ldap: ldap_state->ldap_struct is NULL!\n")); + return False; + } + + get_single_attribute(ldap_state->ldap_struct, entry, "uid", username); DEBUG(2, ("Entry found for user: %s\n", username)); pstrcpy(nt_username, username); pstrcpy(domain, lp_workgroup()); + + pdb_set_username(sampass, username, PDB_SET); + + pdb_set_domain(sampass, domain, PDB_DEFAULT); + pdb_set_nt_username(sampass, nt_username, PDB_SET); - get_single_attribute(ldap_struct, entry, "rid", temp); + get_single_attribute(ldap_state->ldap_struct, entry, "rid", temp); user_rid = (uint32)atol(temp); pdb_set_user_sid_from_rid(sampass, user_rid, PDB_SET); - if (!get_single_attribute(ldap_struct, entry, "primaryGroupID", temp)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "primaryGroupID", temp)) { group_rid = 0; } else { group_rid = (uint32)atol(temp); @@ -731,42 +946,42 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, } } - if (!get_single_attribute(ldap_struct, entry, "pwdLastSet", temp)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "pwdLastSet", temp)) { /* leave as default */ } else { pass_last_set_time = (time_t) atol(temp); pdb_set_pass_last_set_time(sampass, pass_last_set_time, PDB_SET); } - if (!get_single_attribute(ldap_struct, entry, "logonTime", temp)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "logonTime", temp)) { /* leave as default */ } else { logon_time = (time_t) atol(temp); pdb_set_logon_time(sampass, logon_time, PDB_SET); } - if (!get_single_attribute(ldap_struct, entry, "logoffTime", temp)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "logoffTime", temp)) { /* leave as default */ } else { logoff_time = (time_t) atol(temp); pdb_set_logoff_time(sampass, logoff_time, PDB_SET); } - if (!get_single_attribute(ldap_struct, entry, "kickoffTime", temp)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "kickoffTime", temp)) { /* leave as default */ } else { kickoff_time = (time_t) atol(temp); pdb_set_kickoff_time(sampass, kickoff_time, PDB_SET); } - if (!get_single_attribute(ldap_struct, entry, "pwdCanChange", temp)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "pwdCanChange", temp)) { /* leave as default */ } else { pass_can_change_time = (time_t) atol(temp); pdb_set_pass_can_change_time(sampass, pass_can_change_time, PDB_SET); } - if (!get_single_attribute(ldap_struct, entry, "pwdMustChange", temp)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "pwdMustChange", temp)) { /* leave as default */ } else { pass_must_change_time = (time_t) atol(temp); @@ -779,8 +994,8 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, * that fits your needs; using cn then displayName rather than 'userFullName' */ - if (!get_single_attribute(ldap_struct, entry, "cn", fullname)) { - if (!get_single_attribute(ldap_struct, entry, "displayName", fullname)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "cn", fullname)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "displayName", fullname)) { /* leave as default */ } else { pdb_set_fullname(sampass, fullname, PDB_SET); @@ -789,7 +1004,7 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, pdb_set_fullname(sampass, fullname, PDB_SET); } - if (!get_single_attribute(ldap_struct, entry, "homeDrive", dir_drive)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "homeDrive", dir_drive)) { pdb_set_dir_drive(sampass, talloc_sub_specified(sampass->mem_ctx, lp_logon_drive(), username, domain, @@ -799,7 +1014,7 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, pdb_set_dir_drive(sampass, dir_drive, PDB_SET); } - if (!get_single_attribute(ldap_struct, entry, "smbHome", homedir)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "smbHome", homedir)) { pdb_set_homedir(sampass, talloc_sub_specified(sampass->mem_ctx, lp_logon_home(), username, domain, @@ -809,7 +1024,7 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, pdb_set_homedir(sampass, homedir, PDB_SET); } - if (!get_single_attribute(ldap_struct, entry, "scriptPath", logon_script)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "scriptPath", logon_script)) { pdb_set_logon_script(sampass, talloc_sub_specified(sampass->mem_ctx, lp_logon_script(), username, domain, @@ -819,7 +1034,7 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, pdb_set_logon_script(sampass, logon_script, PDB_SET); } - if (!get_single_attribute(ldap_struct, entry, "profilePath", profile_path)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "profilePath", profile_path)) { pdb_set_profile_path(sampass, talloc_sub_specified(sampass->mem_ctx, lp_logon_path(), username, domain, @@ -829,13 +1044,13 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, pdb_set_profile_path(sampass, profile_path, PDB_SET); } - if (!get_single_attribute(ldap_struct, entry, "description", acct_desc)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "description", acct_desc)) { /* leave as default */ } else { pdb_set_acct_desc(sampass, acct_desc, PDB_SET); } - if (!get_single_attribute(ldap_struct, entry, "userWorkstations", workstations)) { + if (!get_single_attribute(ldap_state->ldap_struct, entry, "userWorkstations", workstations)) { /* leave as default */; } else { pdb_set_workstations(sampass, workstations, PDB_SET); @@ -847,7 +1062,7 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, hours_len = 21; memset(hours, 0xff, hours_len); - if (!get_single_attribute (ldap_struct, entry, "lmPassword", temp)) { + if (!get_single_attribute (ldap_state->ldap_struct, entry, "lmPassword", temp)) { /* leave as default */ } else { pdb_gethexpwd(temp, smblmpwd); @@ -857,7 +1072,7 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, ZERO_STRUCT(smblmpwd); } - if (!get_single_attribute (ldap_struct, entry, "ntPassword", temp)) { + if (!get_single_attribute (ldap_state->ldap_struct, entry, "ntPassword", temp)) { /* leave as default */ } else { pdb_gethexpwd(temp, smbntpwd); @@ -867,7 +1082,7 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, ZERO_STRUCT(smbntpwd); } - if (!get_single_attribute (ldap_struct, entry, "acctFlags", temp)) { + if (!get_single_attribute (ldap_state->ldap_struct, entry, "acctFlags", temp)) { acct_ctrl |= ACB_NORMAL; } else { acct_ctrl = pdb_decode_acct_ctrl(temp); @@ -881,11 +1096,6 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, pdb_set_hours_len(sampass, hours_len, PDB_SET); pdb_set_logon_divs(sampass, logon_divs, PDB_SET); - pdb_set_username(sampass, username, PDB_SET); - - pdb_set_domain(sampass, domain, PDB_DEFAULT); - pdb_set_nt_username(sampass, nt_username, PDB_SET); - pdb_set_munged_dial(sampass, munged_dial, PDB_SET); /* pdb_set_unknown_3(sampass, unknown3, PDB_SET); */ @@ -1068,7 +1278,7 @@ static BOOL init_ldap_from_sam (struct ldapsam_privates *ldap_state, /********************************************************************** Connect to LDAP server and find the next available RID. *********************************************************************/ -static uint32 check_nua_rid_is_avail(struct ldapsam_privates *ldap_state, uint32 top_rid, LDAP *ldap_struct) +static uint32 check_nua_rid_is_avail(struct ldapsam_privates *ldap_state, uint32 top_rid) { LDAPMessage *result; uint32 final_rid = (top_rid & (~USER_RID_TYPE)) + RID_MULTIPLIER; @@ -1080,13 +1290,13 @@ static uint32 check_nua_rid_is_avail(struct ldapsam_privates *ldap_state, uint32 return 0; } - if (ldapsam_search_one_user_by_rid(ldap_state, ldap_struct, final_rid, &result) != LDAP_SUCCESS) { + if (ldapsam_search_one_user_by_rid(ldap_state, final_rid, &result) != LDAP_SUCCESS) { DEBUG(0, ("Cannot allocate NUA RID %d (0x%x), as the confirmation search failed!\n", final_rid, final_rid)); ldap_msgfree(result); return 0; } - if (ldap_count_entries(ldap_struct, result) != 0) { + if (ldap_count_entries(ldap_state->ldap_struct, result) != 0) { DEBUG(0, ("Cannot allocate NUA RID %d (0x%x), as the RID is already in use!!\n", final_rid, final_rid)); ldap_msgfree(result); return 0; @@ -1100,14 +1310,14 @@ static uint32 check_nua_rid_is_avail(struct ldapsam_privates *ldap_state, uint32 /********************************************************************** Extract the RID from an LDAP entry *********************************************************************/ -static uint32 entry_to_user_rid(struct ldapsam_privates *ldap_state, LDAPMessage *entry, LDAP *ldap_struct) { +static uint32 entry_to_user_rid(struct ldapsam_privates *ldap_state, LDAPMessage *entry) { uint32 rid; SAM_ACCOUNT *user = NULL; if (!NT_STATUS_IS_OK(pdb_init_sam(&user))) { return 0; } - if (init_sam_from_ldap(ldap_state, user, ldap_struct, entry)) { + if (init_sam_from_ldap(ldap_state, user, entry)) { rid = pdb_get_user_rid(user); } else { rid =0; @@ -1123,7 +1333,7 @@ static uint32 entry_to_user_rid(struct ldapsam_privates *ldap_state, LDAPMessage /********************************************************************** Connect to LDAP server and find the next available RID. *********************************************************************/ -static uint32 search_top_nua_rid(struct ldapsam_privates *ldap_state, LDAP *ldap_struct) +static uint32 search_top_nua_rid(struct ldapsam_privates *ldap_state) { int rc; pstring filter; @@ -1144,7 +1354,7 @@ static uint32 search_top_nua_rid(struct ldapsam_privates *ldap_state, LDAP *ldap #endif DEBUG(2, ("ldapsam_get_next_available_nua_rid: searching for:[%s]\n", final_filter)); - rc = ldap_search_s(ldap_struct, lp_ldap_suffix(), + rc = ldapsam_search(ldap_state, lp_ldap_suffix(), LDAP_SCOPE_SUBTREE, final_filter, (char **)attr, 0, &result); @@ -1158,7 +1368,7 @@ static uint32 search_top_nua_rid(struct ldapsam_privates *ldap_state, LDAP *ldap return 0; } - count = ldap_count_entries(ldap_struct, result); + count = ldap_count_entries(ldap_state->ldap_struct, result); DEBUG(2, ("search_top_nua_rid: %d entries in the base!\n", count)); if (count == 0) { @@ -1171,13 +1381,13 @@ static uint32 search_top_nua_rid(struct ldapsam_privates *ldap_state, LDAP *ldap } free(final_filter); - entry = ldap_first_entry(ldap_struct,result); + entry = ldap_first_entry(ldap_state->ldap_struct,result); - top_rid = entry_to_user_rid(ldap_state, entry, ldap_struct); + top_rid = entry_to_user_rid(ldap_state, entry); - while ((entry = ldap_next_entry(ldap_struct, entry))) { + while ((entry = ldap_next_entry(ldap_state->ldap_struct, entry))) { - rid = entry_to_user_rid(ldap_state, entry, ldap_struct); + rid = entry_to_user_rid(ldap_state, entry); if (rid > top_rid) { top_rid = rid; } @@ -1195,24 +1405,14 @@ static uint32 search_top_nua_rid(struct ldapsam_privates *ldap_state, LDAP *ldap Connect to LDAP server and find the next available RID. *********************************************************************/ static uint32 ldapsam_get_next_available_nua_rid(struct ldapsam_privates *ldap_state) { - LDAP *ldap_struct; uint32 next_nua_rid; uint32 top_nua_rid; - if (!ldapsam_open_connection(ldap_state, &ldap_struct)) { - return 0; - } - if (!ldapsam_connect_system(ldap_state, ldap_struct)) { - ldap_unbind(ldap_struct); - return 0; - } - - top_nua_rid = search_top_nua_rid(ldap_state, ldap_struct); + top_nua_rid = search_top_nua_rid(ldap_state); next_nua_rid = check_nua_rid_is_avail(ldap_state, - top_nua_rid, ldap_struct); + top_nua_rid); - ldap_unbind(ldap_struct); return next_nua_rid; } @@ -1221,23 +1421,14 @@ Connect to LDAP server for password enumeration *********************************************************************/ static NTSTATUS ldapsam_setsampwent(struct pdb_methods *my_methods, BOOL update) { - NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; int rc; pstring filter; - if (!ldapsam_open_connection(ldap_state, &ldap_state->ldap_struct)) { - return ret; - } - if (!ldapsam_connect_system(ldap_state, ldap_state->ldap_struct)) { - ldap_unbind(ldap_state->ldap_struct); - return ret; - } - pstrcpy(filter, lp_ldap_filter()); all_string_sub(filter, "%u", "*", sizeof(pstring)); - rc = ldap_search_s(ldap_state->ldap_struct, lp_ldap_suffix(), + rc = ldapsam_search(ldap_state, lp_ldap_suffix(), LDAP_SCOPE_SUBTREE, filter, (char **)attr, 0, &ldap_state->result); @@ -1245,10 +1436,8 @@ static NTSTATUS ldapsam_setsampwent(struct pdb_methods *my_methods, BOOL update) DEBUG(0, ("LDAP search failed: %s\n", ldap_err2string(rc))); DEBUG(3, ("Query was: %s, %s\n", lp_ldap_suffix(), filter)); ldap_msgfree(ldap_state->result); - ldap_unbind(ldap_state->ldap_struct); - ldap_state->ldap_struct = NULL; ldap_state->result = NULL; - return ret; + return NT_STATUS_UNSUCCESSFUL; } DEBUG(2, ("ldapsam_setsampwent: %d entries in the base!\n", @@ -1268,10 +1457,8 @@ End enumeration of the LDAP password list static void ldapsam_endsampwent(struct pdb_methods *my_methods) { struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; - if (ldap_state->ldap_struct && ldap_state->result) { + if (ldap_state->result) { ldap_msgfree(ldap_state->result); - ldap_unbind(ldap_state->ldap_struct); - ldap_state->ldap_struct = NULL; ldap_state->result = NULL; } } @@ -1294,8 +1481,7 @@ static NTSTATUS ldapsam_getsampwent(struct pdb_methods *my_methods, SAM_ACCOUNT return ret; ldap_state->index++; - bret = init_sam_from_ldap(ldap_state, user, ldap_state->ldap_struct, - ldap_state->entry); + bret = init_sam_from_ldap(ldap_state, user, ldap_state->entry); ldap_state->entry = ldap_next_entry(ldap_state->ldap_struct, ldap_state->entry); @@ -1311,41 +1497,29 @@ static NTSTATUS ldapsam_getsampwnam(struct pdb_methods *my_methods, SAM_ACCOUNT { NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; - LDAP *ldap_struct; LDAPMessage *result; LDAPMessage *entry; - if (!ldapsam_open_connection(ldap_state, &ldap_struct)) - return ret; - if (!ldapsam_connect_system(ldap_state, ldap_struct)) { - ldap_unbind(ldap_struct); - return ret; - } - if (ldapsam_search_one_user_by_name(ldap_state, ldap_struct, sname, &result) != LDAP_SUCCESS) { - ldap_unbind(ldap_struct); - return ret; + if (ldapsam_search_one_user_by_name(ldap_state, sname, &result) != LDAP_SUCCESS) { + return NT_STATUS_UNSUCCESSFUL; } - if (ldap_count_entries(ldap_struct, result) < 1) { + if (ldap_count_entries(ldap_state->ldap_struct, result) < 1) { DEBUG(4, ("We don't find this user [%s] count=%d\n", sname, - ldap_count_entries(ldap_struct, result))); - ldap_unbind(ldap_struct); - return ret; + ldap_count_entries(ldap_state->ldap_struct, result))); + return NT_STATUS_UNSUCCESSFUL; } - entry = ldap_first_entry(ldap_struct, result); + entry = ldap_first_entry(ldap_state->ldap_struct, result); if (entry) { - if (!init_sam_from_ldap(ldap_state, user, ldap_struct, entry)) { + if (!init_sam_from_ldap(ldap_state, user, entry)) { DEBUG(1,("ldapsam_getsampwnam: init_sam_from_ldap failed for user '%s'!\n", sname)); ldap_msgfree(result); - ldap_unbind(ldap_struct); - return ret; + return NT_STATUS_UNSUCCESSFUL; } ldap_msgfree(result); - ldap_unbind(ldap_struct); ret = NT_STATUS_OK; } else { ldap_msgfree(result); - ldap_unbind(ldap_struct); } return ret; } @@ -1357,44 +1531,31 @@ static NTSTATUS ldapsam_getsampwrid(struct pdb_methods *my_methods, SAM_ACCOUNT { NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; - LDAP *ldap_struct; LDAPMessage *result; LDAPMessage *entry; - if (!ldapsam_open_connection(ldap_state, &ldap_struct)) - return ret; - - if (!ldapsam_connect_system(ldap_state, ldap_struct)) { - ldap_unbind(ldap_struct); - return ret; - } - if (ldapsam_search_one_user_by_rid(ldap_state, ldap_struct, rid, &result) != LDAP_SUCCESS) { - ldap_unbind(ldap_struct); - return ret; + if (ldapsam_search_one_user_by_rid(ldap_state, rid, &result) != LDAP_SUCCESS) { + return NT_STATUS_UNSUCCESSFUL; } - if (ldap_count_entries(ldap_struct, result) < 1) { + if (ldap_count_entries(ldap_state->ldap_struct, result) < 1) { DEBUG(4, ("We don't find this rid [%i] count=%d\n", rid, - ldap_count_entries(ldap_struct, result))); - ldap_unbind(ldap_struct); - return ret; + ldap_count_entries(ldap_state->ldap_struct, result))); + return NT_STATUS_UNSUCCESSFUL; } - entry = ldap_first_entry(ldap_struct, result); + entry = ldap_first_entry(ldap_state->ldap_struct, result); if (entry) { - if (!init_sam_from_ldap(ldap_state, user, ldap_struct, entry)) { + if (!init_sam_from_ldap(ldap_state, user, entry)) { DEBUG(1,("ldapsam_getsampwrid: init_sam_from_ldap failed!\n")); ldap_msgfree(result); - ldap_unbind(ldap_struct); - return ret; + return NT_STATUS_UNSUCCESSFUL; } ldap_msgfree(result); - ldap_unbind(ldap_struct); ret = NT_STATUS_OK; } else { ldap_msgfree(result); - ldap_unbind(ldap_struct); } return ret; } @@ -1412,12 +1573,12 @@ Do the actual modification - also change a plaittext passord if it it set. **********************************************************************/ -static NTSTATUS ldapsam_modify_entry(LDAP *ldap_struct,SAM_ACCOUNT *newpwd,char *dn,LDAPMod **mods,int ldap_op, BOOL pdb_add) +static NTSTATUS ldapsam_modify_entry(struct pdb_methods *my_methods,SAM_ACCOUNT *newpwd,char *dn,LDAPMod **mods,int ldap_op, BOOL pdb_add) { - NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; + struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; int rc; - if (!ldap_struct || !newpwd || !dn) { + if (!my_methods || !newpwd || !dn) { return NT_STATUS_INVALID_PARAMETER; } @@ -1429,34 +1590,34 @@ static NTSTATUS ldapsam_modify_entry(LDAP *ldap_struct,SAM_ACCOUNT *newpwd,char { case LDAP_MOD_ADD: make_a_mod(&mods, LDAP_MOD_ADD, "objectclass", "account"); - if((rc = ldap_add_s(ldap_struct,dn,mods))!=LDAP_SUCCESS) { + if((rc = ldapsam_add(ldap_state,dn,mods))!=LDAP_SUCCESS) { char *ld_error; - ldap_get_option(ldap_struct, LDAP_OPT_ERROR_STRING, + ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_ERROR_STRING, &ld_error); DEBUG(0, ("failed to add user with uid = %s with: %s\n\t%s\n", pdb_get_username(newpwd), ldap_err2string(rc), ld_error)); free(ld_error); - return ret; + return NT_STATUS_UNSUCCESSFUL; } break; case LDAP_MOD_REPLACE: - if((rc = ldap_modify_s(ldap_struct,dn,mods))!=LDAP_SUCCESS) { + if((rc = ldapsam_modify(ldap_state,dn,mods))!=LDAP_SUCCESS) { char *ld_error; - ldap_get_option(ldap_struct, LDAP_OPT_ERROR_STRING, + ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_ERROR_STRING, &ld_error); DEBUG(0, ("failed to modify user with uid = %s with: %s\n\t%s\n", pdb_get_username(newpwd), ldap_err2string(rc), ld_error)); free(ld_error); - return ret; + return NT_STATUS_UNSUCCESSFUL; } break; default: DEBUG(0,("Wrong LDAP operation type: %d!\n",ldap_op)); - return ret; + return NT_STATUS_UNSUCCESSFUL; } } @@ -1472,7 +1633,7 @@ static NTSTATUS ldapsam_modify_entry(LDAP *ldap_struct,SAM_ACCOUNT *newpwd,char if ((ber = ber_alloc_t(LBER_USE_DER))==NULL) { DEBUG(0,("ber_alloc_t returns NULL\n")); - return ret; + return NT_STATUS_UNSUCCESSFUL; } ber_printf (ber, "{"); ber_printf (ber, "ts", LDAP_TAG_EXOP_X_MODIFY_PASSWD_ID,dn); @@ -1481,12 +1642,12 @@ static NTSTATUS ldapsam_modify_entry(LDAP *ldap_struct,SAM_ACCOUNT *newpwd,char if ((rc = ber_flatten (ber, &bv))<0) { DEBUG(0,("ber_flatten returns a value <0\n")); - return ret; + return NT_STATUS_UNSUCCESSFUL; } ber_free(ber,1); - - if ((rc = ldap_extended_operation_s(ldap_struct, LDAP_EXOP_X_MODIFY_PASSWD, + + if ((rc = ldapsam_extended_operation(ldap_state, LDAP_EXOP_X_MODIFY_PASSWD, bv, NULL, NULL, &retoid, &retdata))!=LDAP_SUCCESS) { DEBUG(0,("LDAP Password could not be changed for user %s: %s\n", pdb_get_username(newpwd),ldap_err2string(rc))); @@ -1509,60 +1670,46 @@ Delete entry from LDAP for username *********************************************************************/ static NTSTATUS ldapsam_delete_sam_account(struct pdb_methods *my_methods, SAM_ACCOUNT * sam_acct) { - NTSTATUS ret = NT_STATUS_UNSUCCESSFUL; struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; const char *sname; int rc; char *dn; - LDAP *ldap_struct; LDAPMessage *entry; LDAPMessage *result; if (!sam_acct) { DEBUG(0, ("sam_acct was NULL!\n")); - return ret; + return NT_STATUS_UNSUCCESSFUL; } sname = pdb_get_username(sam_acct); - if (!ldapsam_open_connection(ldap_state, &ldap_struct)) - return ret; - DEBUG (3, ("Deleting user %s from LDAP.\n", sname)); - - if (!ldapsam_connect_system(ldap_state, ldap_struct)) { - ldap_unbind (ldap_struct); - DEBUG(0, ("Failed to delete user %s from LDAP.\n", sname)); - return ret; - } - rc = ldapsam_search_one_user_by_name(ldap_state, ldap_struct, sname, &result); - if (ldap_count_entries (ldap_struct, result) == 0) { + rc = ldapsam_search_one_user_by_name(ldap_state, sname, &result); + if (ldap_count_entries (ldap_state->ldap_struct, result) == 0) { DEBUG (0, ("User doesn't exit!\n")); ldap_msgfree (result); - ldap_unbind (ldap_struct); - return ret; + return NT_STATUS_UNSUCCESSFUL; } - entry = ldap_first_entry (ldap_struct, result); - dn = ldap_get_dn (ldap_struct, entry); + entry = ldap_first_entry (ldap_state->ldap_struct, result); + dn = ldap_get_dn (ldap_state->ldap_struct, entry); ldap_msgfree(result); - rc = ldap_delete_s (ldap_struct, dn); + rc = ldapsam_delete(ldap_state, dn); ldap_memfree (dn); if (rc != LDAP_SUCCESS) { char *ld_error; - ldap_get_option (ldap_struct, LDAP_OPT_ERROR_STRING, &ld_error); + ldap_get_option (ldap_state->ldap_struct, LDAP_OPT_ERROR_STRING, &ld_error); DEBUG (0,("failed to delete user with uid = %s with: %s\n\t%s\n", sname, ldap_err2string (rc), ld_error)); free (ld_error); - ldap_unbind (ldap_struct); - return ret; + return NT_STATUS_UNSUCCESSFUL; } DEBUG (2,("successfully deleted uid = %s from the LDAP database\n", sname)); - ldap_unbind (ldap_struct); return NT_STATUS_OK; } @@ -1575,7 +1722,6 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, SAM_A struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; int rc; char *dn; - LDAP *ldap_struct; LDAPMessage *result; LDAPMessage *entry; LDAPMod **mods; @@ -1583,8 +1729,7 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, SAM_A if (!init_ldap_from_sam(ldap_state, &mods, LDAP_MOD_REPLACE, False, newpwd)) { DEBUG(0, ("ldapsam_update_sam_account: init_ldap_from_sam failed!\n")); ldap_msgfree(result); - ldap_unbind(ldap_struct); - return ret; + return NT_STATUS_UNSUCCESSFUL; } if (mods == NULL) { @@ -1592,33 +1737,23 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, SAM_A return NT_STATUS_OK; } - if (!ldapsam_open_connection(ldap_state, &ldap_struct)) /* open a connection to the server */ - return ret; - - if (!ldapsam_connect_system(ldap_state, ldap_struct)) { /* connect as system account */ - ldap_unbind(ldap_struct); - return ret; - } + rc = ldapsam_search_one_user_by_name(ldap_state, pdb_get_username(newpwd), &result); - rc = ldapsam_search_one_user_by_name(ldap_state, ldap_struct, - pdb_get_username(newpwd), &result); - - if (ldap_count_entries(ldap_struct, result) == 0) { + if (ldap_count_entries(ldap_state->ldap_struct, result) == 0) { DEBUG(0, ("No user to modify!\n")); ldap_msgfree(result); - ldap_unbind(ldap_struct); - return ret; + return NT_STATUS_UNSUCCESSFUL; } - entry = ldap_first_entry(ldap_struct, result); - dn = ldap_get_dn(ldap_struct, entry); + entry = ldap_first_entry(ldap_state->ldap_struct, result); + dn = ldap_get_dn(ldap_state->ldap_struct, entry); ldap_msgfree(result); - if (NT_STATUS_IS_ERR(ldapsam_modify_entry(ldap_struct,newpwd,dn,mods,LDAP_MOD_REPLACE, False))) { + ret = ldapsam_modify_entry(my_methods,newpwd,dn,mods,LDAP_MOD_REPLACE, False); + if (NT_STATUS_IS_ERR(ret)) { DEBUG(0,("failed to modify user with uid = %s\n", pdb_get_username(newpwd))); ldap_mods_free(mods,1); - ldap_unbind(ldap_struct); return ret; } @@ -1627,7 +1762,6 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, SAM_A ("successfully modified uid = %s in the LDAP database\n", pdb_get_username(newpwd))); ldap_mods_free(mods, 1); - ldap_unbind(ldap_struct); return NT_STATUS_OK; } @@ -1640,7 +1774,6 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data; int rc; pstring filter; - LDAP *ldap_struct = NULL; LDAPMessage *result = NULL; pstring dn; LDAPMod **mods = NULL; @@ -1650,35 +1783,26 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO const char *username = pdb_get_username(newpwd); if (!username || !*username) { DEBUG(0, ("Cannot add user without a username!\n")); - return ret; - } - - if (!ldapsam_open_connection(ldap_state, &ldap_struct)) /* open a connection to the server */ - return ret; - - if (!ldapsam_connect_system(ldap_state, ldap_struct)) { /* connect as system account */ - ldap_unbind(ldap_struct); - return ret; + return NT_STATUS_UNSUCCESSFUL; } - rc = ldapsam_search_one_user_by_name (ldap_state, ldap_struct, username, &result); + rc = ldapsam_search_one_user_by_name (ldap_state, username, &result); - if (ldap_count_entries(ldap_struct, result) != 0) { + if (ldap_count_entries(ldap_state->ldap_struct, result) != 0) { DEBUG(0,("User already in the base, with samba properties\n")); ldap_msgfree(result); - ldap_unbind(ldap_struct); - return ret; + return NT_STATUS_UNSUCCESSFUL; } ldap_msgfree(result); slprintf (filter, sizeof (filter) - 1, "uid=%s", username); - rc = ldapsam_search_one_user(ldap_state, ldap_struct, filter, &result); - num_result = ldap_count_entries(ldap_struct, result); + rc = ldapsam_search_one_user(ldap_state, filter, &result); + num_result = ldap_count_entries(ldap_state->ldap_struct, result); if (num_result > 1) { DEBUG (0, ("More than one user with that uid exists: bailing out!\n")); ldap_msgfree(result); - return ret; + return NT_STATUS_UNSUCCESSFUL; } /* Check if we need to update an existing entry */ @@ -1688,8 +1812,8 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO DEBUG(3,("User exists without samba properties: adding them\n")); ldap_op = LDAP_MOD_REPLACE; - entry = ldap_first_entry (ldap_struct, result); - tmp = ldap_get_dn (ldap_struct, entry); + entry = ldap_first_entry (ldap_state->ldap_struct, result); + tmp = ldap_get_dn (ldap_state->ldap_struct, entry); slprintf (dn, sizeof (dn) - 1, "%s", tmp); ldap_memfree (tmp); } else { @@ -1708,28 +1832,26 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, SAM_ACCO if (!init_ldap_from_sam(ldap_state, &mods, ldap_op, True, newpwd)) { DEBUG(0, ("ldapsam_add_sam_account: init_ldap_from_sam failed!\n")); ldap_mods_free(mods, 1); - ldap_unbind(ldap_struct); - return ret; + return NT_STATUS_UNSUCCESSFUL; } if (mods == NULL) { DEBUG(0,("mods is empty: nothing to add for user: %s\n",pdb_get_username(newpwd))); - return ret; + return NT_STATUS_UNSUCCESSFUL; } make_a_mod(&mods, LDAP_MOD_ADD, "objectclass", "sambaAccount"); - if (NT_STATUS_IS_ERR(ldapsam_modify_entry(ldap_struct,newpwd,dn,mods,ldap_op, True))) { + ret = ldapsam_modify_entry(my_methods,newpwd,dn,mods,ldap_op, True); + if (NT_STATUS_IS_ERR(ret)) { DEBUG(0,("failed to modify/add user with uid = %s (dn = %s)\n", pdb_get_username(newpwd),dn)); ldap_mods_free(mods,1); - ldap_unbind(ldap_struct); return ret; } DEBUG(2,("added: uid = %s in the LDAP database\n", pdb_get_username(newpwd))); ldap_mods_free(mods, 1); - ldap_unbind(ldap_struct); return NT_STATUS_OK; } @@ -1789,14 +1911,14 @@ static void free_private_data(void **vp) { struct ldapsam_privates **ldap_state = (struct ldapsam_privates **)vp; - if ((*ldap_state)->ldap_struct) { - ldap_unbind((*ldap_state)->ldap_struct); - } + ldapsam_close(*ldap_state); if ((*ldap_state)->bind_secret) { memset((*ldap_state)->bind_secret, '\0', strlen((*ldap_state)->bind_secret)); } + ldapsam_close(*ldap_state); + SAFE_FREE((*ldap_state)->bind_dn); SAFE_FREE((*ldap_state)->bind_secret); -- cgit From cca032f1cde42cdcb86c60165afe5b05eda7c470 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 26 Oct 2002 14:49:30 +0000 Subject: Fix bug in '-d' (This used to be commit 8c15db105addbafd822d96d29ff1692566b92267) --- source3/lib/popt_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c index 1a63405b72..21ee94d2e6 100644 --- a/source3/lib/popt_common.c +++ b/source3/lib/popt_common.c @@ -67,7 +67,7 @@ static void popt_common_callback(poptContext con, struct poptOption popt_common_debug[] = { { NULL, 0, POPT_ARG_CALLBACK, popt_common_callback }, - { "debuglevel", 'd', POPT_ARG_STRING, dyn_CONFIGFILE, 'd', "Set debug level", + { "debuglevel", 'd', POPT_ARG_STRING, NULL, 'd', "Set debug level", "DEBUGLEVEL" }, { 0 } }; -- cgit From 106ec982d5447b5f23f0bb125a49cebc9915f3d9 Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Sun, 27 Oct 2002 00:04:13 +0000 Subject: Remove make_printerdef from binary install process. (This used to be commit 73c28c527d1030d1656362474c14d49581efdbeb) --- packaging/Caldera/OpenLinux/samba3.spec.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/Caldera/OpenLinux/samba3.spec.tmpl b/packaging/Caldera/OpenLinux/samba3.spec.tmpl index b572672079..8bdc4eb0d7 100644 --- a/packaging/Caldera/OpenLinux/samba3.spec.tmpl +++ b/packaging/Caldera/OpenLinux/samba3.spec.tmpl @@ -267,7 +267,7 @@ strip $DESTDIR/usr/bin/smb{mount,mnt,umount} ln -s /usr/bin/smbumount umount.smbfs ) # First install /usr/bin progs -for i in smbfilter make_printerdef debug2html +for i in smbfilter debug2html do install -m 755 source/bin/$i $DESTDIR/usr/bin done -- cgit From 68026338e904b76fe58e8ecf046df6b5730ddd1c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 28 Oct 2002 12:55:22 +0000 Subject: Implement 'net maxrid'. Needed to find the maximum current rid to set 'algorithmic rid base' correctly after a 'net rpc vampire'. Volker (This used to be commit 5c0869be321852919dba1566c6bcab02e4657541) --- source3/utils/net.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/source3/utils/net.c b/source3/utils/net.c index d38ca58622..704b886d72 100644 --- a/source3/utils/net.c +++ b/source3/utils/net.c @@ -402,6 +402,84 @@ static int net_getdomainsid(int argc, const char **argv) return 0; } +static uint32 get_maxrid(void) +{ + SAM_ACCOUNT *pwd = NULL; + uint32 max_rid = 0; + GROUP_MAP *map = NULL; + int num_entries = 0; + int i; + + if (!pdb_setsampwent(False)) { + DEBUG(0, ("load_sampwd_entries: Unable to open passdb.\n")); + return 0; + } + + for (; (NT_STATUS_IS_OK(pdb_init_sam(&pwd))) + && pdb_getsampwent(pwd) == True; pwd=NULL) { + uint32 rid; + + if (!sid_peek_rid(pdb_get_user_sid(pwd), &rid)) { + DEBUG(0, ("can't get RID for user '%s'\n", + pdb_get_username(pwd))); + pdb_free_sam(&pwd); + continue; + } + + if (rid > max_rid) + max_rid = rid; + + DEBUG(1,("%d is user '%s'\n", rid, pdb_get_username(pwd))); + pdb_free_sam(&pwd); + } + + pdb_endsampwent(); + pdb_free_sam(&pwd); + + if (!pdb_enum_group_mapping(SID_NAME_UNKNOWN, &map, &num_entries, + ENUM_ONLY_MAPPED, MAPPING_WITHOUT_PRIV)) + return max_rid; + + for (i = 0; i < num_entries; i++) { + uint32 rid; + + if (!sid_peek_check_rid(get_global_sam_sid(), &map[i].sid, + &rid)) { + DEBUG(3, ("skipping map for group '%s', SID %s\n", + map[i].nt_name, + sid_string_static(&map[i].sid))); + continue; + } + DEBUG(1,("%d is group '%s'\n", rid, map[i].nt_name)); + + if (rid > max_rid) + max_rid = rid; + } + + SAFE_FREE(map); + + return max_rid; +} + +static int net_maxrid(int argc, const char **argv) +{ + uint32 rid; + + if (argc != 0) { + DEBUG(0, ("usage: net initrid\n")); + return 1; + } + + if ((rid = get_maxrid()) == 0) { + DEBUG(0, ("can't get current maximum rid\n")); + return 1; + } + + d_printf("Currently used maximum rid: %d\n", rid); + + return 0; +} + /* main function table */ static struct functable net_func[] = { {"RPC", net_rpc}, @@ -429,6 +507,7 @@ static struct functable net_func[] = { {"GETLOCALSID", net_getlocalsid}, {"SETLOCALSID", net_setlocalsid}, {"GETDOMAINSID", net_getdomainsid}, + {"MAXRID", net_maxrid}, {"HELP", net_help}, {NULL, NULL} -- cgit From c00776d0ea0cb9a9af43f52928881a50526e9c79 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 28 Oct 2002 19:24:48 +0000 Subject: document ldap suffix (This used to be commit 85eeb8870f5a1e04c607fbcc18f8da50eb7a694f) --- docs/docbook/manpages/smb.conf.5.sgml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/docbook/manpages/smb.conf.5.sgml b/docs/docbook/manpages/smb.conf.5.sgml index a1f767185c..8078839ad2 100644 --- a/docs/docbook/manpages/smb.conf.5.sgml +++ b/docs/docbook/manpages/smb.conf.5.sgml @@ -3483,6 +3483,8 @@ ldap suffix (G) + Specifies where user and machine accounts are added to the tree. Can be overriden by ldap user suffix and ldap machine suffix. + Default : none -- cgit From d4525fc8f6fe81dd30020212f71cf5ac998eae89 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 28 Oct 2002 19:54:11 +0000 Subject: Update info on ldap suffix (thanks metze) (This used to be commit 257a1ff880d58a262169885336e5090d986e7d3c) --- docs/docbook/manpages/smb.conf.5.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docbook/manpages/smb.conf.5.sgml b/docs/docbook/manpages/smb.conf.5.sgml index 8078839ad2..e4c4587c1f 100644 --- a/docs/docbook/manpages/smb.conf.5.sgml +++ b/docs/docbook/manpages/smb.conf.5.sgml @@ -3483,7 +3483,7 @@ ldap suffix (G) - Specifies where user and machine accounts are added to the tree. Can be overriden by ldap user suffix and ldap machine suffix. + Specifies where user and machine accounts are added to the tree. Can be overriden by ldap user suffix and ldap machine suffix. It also used as the base dn for all ldap searches. Default : none -- cgit From 70e52f29ea4986cfd3bdffa9a366773d897d2189 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 28 Oct 2002 19:57:33 +0000 Subject: Fix typo (-s -> -S) (This used to be commit 522b7470a3dbe61f522f65fa2b1aeac4bc1d36c3) --- docs/docbook/projdoc/winbind.sgml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docbook/projdoc/winbind.sgml b/docs/docbook/projdoc/winbind.sgml index d70c1a3679..d2bfb8ab67 100644 --- a/docs/docbook/projdoc/winbind.sgml +++ b/docs/docbook/projdoc/winbind.sgml @@ -412,7 +412,7 @@ you get frustrated with the way things are going. ;-) -The latest version of SAMBA (version 2.2.2 as of this writing), now +The latest version of SAMBA (version 3.0 as of this writing), now includes a functioning winbindd daemon. Please refer to the main SAMBA web page or, better yet, your closest SAMBA mirror site for instructions on @@ -582,7 +582,7 @@ a domain user who has administrative privileges in the domain. -root# /usr/local/samba/bin/net rpc join -s PDC -U Administrator +root# /usr/local/samba/bin/net rpc join -S PDC -U Administrator -- cgit From 608985f7ea1648142872983631e209443c0e76f6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 28 Oct 2002 22:04:47 +0000 Subject: Fix fd leak with kernel change notify. Jeremy. (This used to be commit 78df2c916ae3940f0124912f99b1e0ca3914fff5) --- source3/smbd/notify_kernel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/smbd/notify_kernel.c b/source3/smbd/notify_kernel.c index 8454917163..df553721ef 100644 --- a/source3/smbd/notify_kernel.c +++ b/source3/smbd/notify_kernel.c @@ -127,7 +127,6 @@ static void kernel_remove_notify(void *datap) BlockSignals(True, RT_SIGNAL_NOTIFY); for (i = 0; i < signals_received; i++) { if (fd == (int)fd_pending_array[i]) { - close(fd); fd_pending_array[i] = (SIG_ATOMIC_T)-1; if (signals_received - i - 1) { memmove((void *)&fd_pending_array[i], (void *)&fd_pending_array[i+1], @@ -138,6 +137,7 @@ static void kernel_remove_notify(void *datap) break; } } + close(fd); BlockSignals(False, RT_SIGNAL_NOTIFY); } SAFE_FREE(data); -- cgit From 64c6fd21c1c176ec3c97a93fdf3d5bdaa2edb711 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 29 Oct 2002 04:39:33 +0000 Subject: Added close and unlink functions. (This used to be commit 3a7f8a568e9d1608c2a065e0b98488e2d068911c) --- source3/python/py_smb.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/source3/python/py_smb.c b/source3/python/py_smb.c index 85f7792047..0936826488 100644 --- a/source3/python/py_smb.c +++ b/source3/python/py_smb.c @@ -179,6 +179,44 @@ static PyObject *py_smb_nt_create_andx(PyObject *self, PyObject *args, return PyInt_FromLong(result); } +static PyObject *py_smb_close(PyObject *self, PyObject *args, + PyObject *kw) +{ + cli_state_object *cli = (cli_state_object *)self; + static char *kwlist[] = { "fnum", NULL }; + BOOL result; + int fnum; + + /* Parse parameters */ + + if (!PyArg_ParseTupleAndKeywords( + args, kw, "i", kwlist, &fnum)) + return NULL; + + result = cli_close(cli->cli, fnum); + + return PyInt_FromLong(result); +} + +static PyObject *py_smb_unlink(PyObject *self, PyObject *args, + PyObject *kw) +{ + cli_state_object *cli = (cli_state_object *)self; + static char *kwlist[] = { "filename", NULL }; + char *filename; + BOOL result; + + /* Parse parameters */ + + if (!PyArg_ParseTupleAndKeywords( + args, kw, "s", kwlist, &filename)) + return NULL; + + result = cli_unlink(cli->cli, filename); + + return PyInt_FromLong(result); +} + static PyObject *py_smb_query_secdesc(PyObject *self, PyObject *args, PyObject *kw) { @@ -279,6 +317,12 @@ static PyMethodDef smb_hnd_methods[] = { { "nt_create_andx", (PyCFunction)py_smb_nt_create_andx, METH_VARARGS | METH_KEYWORDS, "NT Create&X" }, + { "close", (PyCFunction)py_smb_close, + METH_VARARGS | METH_KEYWORDS, "Close" }, + + { "unlink", (PyCFunction)py_smb_unlink, + METH_VARARGS | METH_KEYWORDS, "Unlink" }, + /* Security descriptors */ { "query_secdesc", (PyCFunction)py_smb_query_secdesc, -- cgit From 7c9923c9f6713883b775bf0577464d16a4492716 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 29 Oct 2002 08:21:40 +0000 Subject: Fix a nice little memory leak in our uid changing code. Andrew Bartlett (This used to be commit 5c4967c70dfab78733ef21e3a5eaf252a5958613) --- source3/smbd/uid.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 9a38d6e9e2..48b9768358 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -49,6 +49,8 @@ BOOL change_to_guest(void) current_user.conn = NULL; current_user.vuid = UID_FIELD_INVALID; + passwd_free(&pass); + return True; } -- cgit From 2e88956deb83d5c026f7e1b561bbec7e2150536f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 29 Oct 2002 16:12:57 +0000 Subject: Sync with actual changes (This used to be commit 706a87e774a2a976edb40c07b2a8a22cc9309ca1) --- docs/docs-status | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/docs-status b/docs/docs-status index e6a25c40a2..a3a3075adc 100644 --- a/docs/docs-status +++ b/docs/docs-status @@ -1,10 +1,8 @@ If you'd like to work on any of these, please contact jerry@samba.org or jelmer@samba.org. Outdated docs: -docs/OID/allocated-arcs.txt - does this file really belong here? -docs/OID/samba-oid.mail - does this file really belong here? -docs/announce - out of date (announces 2.2.0) - should it go away? -docs/history - needs updating (is current up to 1998 - merge with 10year.html ?) +docs/announce - needs updating before we release 3.0 +docs/history - needs updating (is current up to 1998 - merge with 10year.html) docs/docbook/devdoc/* - most of these docs are outdated and need updates... docs/docbook/manpages/net.8.sgml - Still not finished docs/docbook/manpages/rpcclient.1.sgml - Command documentation might be outdated -- cgit From 159f2b01f8c482627e8a28dbe8d503a5db26836a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 29 Oct 2002 16:16:37 +0000 Subject: -E doesn't take arguments (This used to be commit 932b364de79407b3996061c0ae66117d39045e4d) --- docs/docbook/manpages/smbclient.1.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docbook/manpages/smbclient.1.sgml b/docs/docbook/manpages/smbclient.1.sgml index 31031dafc4..43994a4529 100644 --- a/docs/docbook/manpages/smbclient.1.sgml +++ b/docs/docbook/manpages/smbclient.1.sgml @@ -30,7 +30,7 @@ -l logfile -L <netbios name> -I destinationIP - -E <terminal code> + -E -c <command string> -i scope -O <socket options> -- cgit From 2b7b29e915a94fe0fb14002157dcc0baf7f0c1a4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 29 Oct 2002 16:18:10 +0000 Subject: Small markup fixes (This used to be commit c11b611bacc51ba57943cfd7988743194facaae2) --- docs/docbook/projdoc/Bugs.sgml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/docbook/projdoc/Bugs.sgml b/docs/docbook/projdoc/Bugs.sgml index 5a24458e08..a9493b07d4 100644 --- a/docs/docbook/projdoc/Bugs.sgml +++ b/docs/docbook/projdoc/Bugs.sgml @@ -15,7 +15,8 @@ Introduction -The email address for bug reports is samba@samba.org +The email address for bug reports for stable releases is samba@samba.org. +Bug reports for alpha releases should go to samba-technical@samba.org. @@ -44,7 +45,7 @@ that list that may be able to help you. You may also like to look though the recent mailing list archives, which are conveniently accessible on the Samba web pages -at http://samba.org/samba/ +at http://samba.org/samba/. -- cgit From f7a98a2fecdf6788099eb2c0cf17ba418d398619 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 29 Oct 2002 16:19:32 +0000 Subject: 2.2 was the previous release - don't talk about it like it's current (This used to be commit 752ef9463dc8b60cb0069344c3e30f65290270a1) --- docs/docbook/projdoc/Integrating-with-Windows.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docbook/projdoc/Integrating-with-Windows.sgml b/docs/docbook/projdoc/Integrating-with-Windows.sgml index 701e48678c..3b0faf81af 100644 --- a/docs/docbook/projdoc/Integrating-with-Windows.sgml +++ b/docs/docbook/projdoc/Integrating-with-Windows.sgml @@ -253,7 +253,7 @@ principal of speaking only when necessary. -Samba version 2.2.0 will add Linux support for extensions to +Starting with version 2.2.0 samba has Linux support for extensions to the name service switch infrastructure so that linux clients will be able to obtain resolution of MS Windows NetBIOS names to IP Addresses. To gain this functionality Samba needs to be compiled -- cgit From 4b493932ec9094a12eef2e1ede843ab8701d8fbc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 29 Oct 2002 16:20:06 +0000 Subject: We also support security = server (This used to be commit 5bd2c390e883ced39ca89d0180d87a35ce396e96) --- docs/docbook/projdoc/security_level.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docbook/projdoc/security_level.sgml b/docs/docbook/projdoc/security_level.sgml index efe2b6eaf3..2f9a92d872 100644 --- a/docs/docbook/projdoc/security_level.sgml +++ b/docs/docbook/projdoc/security_level.sgml @@ -20,7 +20,7 @@ Samba supports the following options to the global smb.conf parameter [global] -security = [share|user(default)|domain|ads] +security = [share|user(default)|server|domain|ads] -- cgit From 0a57b3ef8eb96545b048c1215d87f149d5c8c9a7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 29 Oct 2002 21:46:36 +0000 Subject: Add autom4te.cache (used by newer autoconfs) (This used to be commit 94647051adc223e17997cd6688da0c71b7ea870a) --- source3/.cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/source3/.cvsignore b/source3/.cvsignore index 66eeec17a5..0e0012d7be 100644 --- a/source3/.cvsignore +++ b/source3/.cvsignore @@ -5,6 +5,7 @@ .ix* .proto.check .proto.stamp +autom4te.cache ID ID Makefile -- cgit From 0d929993c8805785389f58605a2b0bc717eca27c Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Wed, 30 Oct 2002 03:29:01 +0000 Subject: Added Buchan Milne's DESTDIR patch. (This used to be commit d134d66f989026821b29b24c8c15a112213b61d6) --- source3/Makefile.in | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/source3/Makefile.in b/source3/Makefile.in index da8990b061..f0cf3864a8 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -827,28 +827,28 @@ bin/tdbbackup: $(TDBBACKUP_OBJ) bin/.dummy install: installbin installman installscripts installdat installswat installdirs: - @$(SHELL) $(srcdir)/script/installdirs.sh $(BASEDIR) $(BINDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(PRIVATEDIR) + @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(PRIVATEDIR) installservers: all installdirs - @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(BASEDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(SPROGS) + @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SPROGS) installbin: all installdirs - @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(BASEDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(SPROGS) - @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(BASEDIR) $(BINDIR) $(LIBDIR) $(VARDIR) $(PROGS) + @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SPROGS) + @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(PROGS) installscripts: installdirs - @$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS) $(BINDIR) $(SCRIPTS) + @$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS) installdat: installdirs - @$(SHELL) $(srcdir)/script/installdat.sh $(LIBDIR) $(srcdir) + @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir) installswat: installdirs - @$(SHELL) $(srcdir)/script/installswat.sh $(SWATDIR) $(srcdir) + @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir) installclientlib: - -$(INSTALLCMD) bin/libsmbclient.@SHLIBEXT@ ${prefix}/lib - -$(INSTALLCMD) -d ${prefix}/include - -$(INSTALLCMD) include/libsmbclient.h ${prefix}/include + -$(INSTALLCMD) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)${prefix}/lib + -$(INSTALLCMD) -d $(DESTDIR)${prefix}/include + -$(INSTALLCMD) include/libsmbclient.h $(DESTDIR)${prefix}/include # Python extensions @@ -903,7 +903,7 @@ revert: @$(SHELL) $(srcdir)/script/revert.sh $(BINDIR) $(PROGS) $(SCRIPTS) installman: - @$(SHELL) $(srcdir)/script/installman.sh $(MANDIR) $(srcdir) $(man_langs) "@ROFF@" + @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(MANDIR) $(srcdir) $(man_langs) "@ROFF@" .PHONY: showlayout @@ -920,14 +920,14 @@ showlayout: uninstall: uninstallman uninstallbin uninstallscripts uninstallman: - @$(SHELL) $(srcdir)/script/uninstallman.sh $(MANDIR) $(srcdir) $(man_langs) + @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(srcdir) $(man_langs) uninstallbin: - @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(BASEDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(SPROGS) - @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(BASEDIR) $(BINDIR) $(LIBDIR) $(VARDIR) $(PROGS) + @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SPROGS) + @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(PROGS) uninstallscripts: - @$(SHELL) $(srcdir)/script/uninstallscripts.sh $(INSTALLPERMS) $(BINDIR) $(SCRIPTS) + @$(SHELL) $(srcdir)/script/uninstallscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS) # Toplevel clean files TOPFILES=dynconfig.o dynconfig.po -- cgit From a207251c2fb3145201e4bbd770bb0d79c7180eb5 Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Wed, 30 Oct 2002 03:50:23 +0000 Subject: Adding Buchan Milne's updates. (This used to be commit d816c35c1d8db343c76a32a6d01952d2c192b092) --- packaging/Mandrake/README | 4 +- packaging/Mandrake/README.mandrake | 117 ++ packaging/Mandrake/makerpms-cvs.sh | 34 + packaging/Mandrake/makerpms.sh.tmpl | 81 +- packaging/Mandrake/samba-2.2.0-buildroot.patch | 15 + packaging/Mandrake/samba-2.2.0-gawk.patch | 11 + packaging/Mandrake/samba-2.2.5-gp-reloc-fix.patch | 12 + packaging/Mandrake/samba-print-pdf.sh | 59 + packaging/Mandrake/samba-slapd-include.conf | 15 + packaging/Mandrake/samba.log | 4 +- packaging/Mandrake/samba.xinetd | 2 +- packaging/Mandrake/samba2.spec.tmpl | 1866 ++++++++++++++++++--- packaging/Mandrake/smb.conf | 236 ++- packaging/Mandrake/smb.init | 9 +- packaging/Mandrake/smbmount-sbin.patch | 15 + packaging/Mandrake/smbw.patch | 10 + packaging/Mandrake/system-auth-winbind.pamd | 17 + packaging/Mandrake/winbind.init | 93 + 18 files changed, 2316 insertions(+), 284 deletions(-) create mode 100644 packaging/Mandrake/README.mandrake create mode 100644 packaging/Mandrake/makerpms-cvs.sh create mode 100644 packaging/Mandrake/samba-2.2.0-buildroot.patch create mode 100644 packaging/Mandrake/samba-2.2.0-gawk.patch create mode 100644 packaging/Mandrake/samba-2.2.5-gp-reloc-fix.patch create mode 100644 packaging/Mandrake/samba-print-pdf.sh create mode 100644 packaging/Mandrake/samba-slapd-include.conf create mode 100644 packaging/Mandrake/smbmount-sbin.patch create mode 100644 packaging/Mandrake/smbw.patch create mode 100644 packaging/Mandrake/system-auth-winbind.pamd create mode 100644 packaging/Mandrake/winbind.init diff --git a/packaging/Mandrake/README b/packaging/Mandrake/README index 1c5bb30edc..5ccfb1d22b 100644 --- a/packaging/Mandrake/README +++ b/packaging/Mandrake/README @@ -1,7 +1,7 @@ Preparation Date: Sat Apr 14 2001 -Preparer: John H Terpstra +Preparer: Gerald Carter -Instructions: Preparing Samba Packages for Mandrake Linux 7.2 +Instructions: Preparing Samba Packages for Mandrake Linux 8.x =============================================================== We provide support only for current versions of Mandrake Linux. diff --git a/packaging/Mandrake/README.mandrake b/packaging/Mandrake/README.mandrake new file mode 100644 index 0000000000..83920f238f --- /dev/null +++ b/packaging/Mandrake/README.mandrake @@ -0,0 +1,117 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +The Mandrake samba spec file used for packaging for Mandrake and cooker +is now also used by the makerpms.sh script, and you can pass any options +that you would normally pass to rpm via the makerpms.sh script. + +Note that only release after 8.1 support passing options using +"--with