summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/build/m4/rewrite.m4624
-rw-r--r--source4/build/tests/summary.c5
-rw-r--r--source4/utils/getntacl.c102
-rw-r--r--source4/utils/setntacl.c90
-rw-r--r--source4/utils/setnttoken.c54
5 files changed, 23 insertions, 852 deletions
diff --git a/source4/build/m4/rewrite.m4 b/source4/build/m4/rewrite.m4
index 8d68c4cc74..c906af8b10 100644
--- a/source4/build/m4/rewrite.m4
+++ b/source4/build/m4/rewrite.m4
@@ -7,223 +7,48 @@ AC_SUBST(SHLIBEXT)
AC_SUBST(LDSHFLAGS)
AC_SUBST(SONAMEFLAG)
AC_SUBST(PICFLAG)
+
+AH_VERBATIM([_GNU_SOURCE],
+[/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE
+#endif])
+
+AC_SYS_LARGEFILE
+
#
# Config CPPFLAG settings for strange OS's that must be set
# before other tests.
#
case "$host_os" in
# Try to work out if this is the native HPUX compiler that uses the -Ae flag.
- *hpux*)
-
+ *hpux*)
AC_PROG_CC_FLAG(Ae)
# mmap on HPUX is completely broken...
AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken])
if test $ac_cv_prog_cc_Ae = yes; then
CPPFLAGS="$CPPFLAGS -Ae"
fi
-#
-# Defines needed for HPUX support.
-# HPUX has bigcrypt but (sometimes?) doesn't use it for
-# password hashing - hence the USE_BOTH_CRYPT_CALLS define.
-#
- case `uname -r` in
- *9*|*10*)
- CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4 -DMAX_POSITIVE_LOCK_OFFSET=0x1ffffffffffLL"
- 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 -DMAX_POSITIVE_LOCK_OFFSET=0x1ffffffffffLL"
- 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"
- ;;
-
-#
-# CRAY Unicos has broken const handling
- *unicos*)
- AC_MSG_RESULT([disabling const])
- CPPFLAGS="$CPPFLAGS -Dconst="
- ;;
-
-#
-# AIX4.x doesn't even admit to having large
-# files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
-#
- *aix4*)
- AC_MSG_RESULT([enabling large file support])
- CPPFLAGS="$CPPFLAGS -D_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
-# to the existance of large files..
-# Note that -D_LARGEFILE64_SOURCE is different from the Sun
-# recommendations on large file support, however it makes the
-# compile work using gcc 2.7 and 2.8, whereas using the Sun
-# recommendation makes the compile fail on gcc2.7. JRA.
-#
- *solaris*)
- case `uname -r` in
- 5.0*|5.1*|5.2*|5.3*|5.5*)
- AC_MSG_RESULT([no large file support])
- ;;
- 5.*)
- AC_MSG_RESULT([enabling large file support])
- if test "$ac_cv_prog_gcc" = yes; then
- ${CC-cc} -v >conftest.c 2>&1
- ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
- rm -fr conftest.c
- 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, 1, [Whether to enable large file support])
- ;;
- *)
- CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_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, 1, [Whether to enable large file support])
- AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
- fi
- ;;
- esac
- ;;
+ ;;
#
# VOS may need to have POSIX support and System V compatibility enabled.
#
*vos*)
- case "$CPPFLAGS" in
- *-D_POSIX_C_SOURCE*)
+ case "$CPPFLAGS" in
+ *-D_POSIX_C_SOURCE*)
;;
*)
CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
AC_DEFINE(_POSIX_C_SOURCE, 200112L, [Whether to enable POSIX support])
;;
- esac
- case "$CPPFLAGS" in
- *-D_SYSV*|*-D_SVID_SOURCE*)
+ esac
+ case "$CPPFLAGS" in
+ *-D_SYSV*|*-D_SVID_SOURCE*)
;;
- *)
+ *)
CPPFLAGS="$CPPFLAGS -D_SYSV"
AC_DEFINE(_SYSV, 1, [Whether to enable System V compatibility])
- esac
- ;;
-#
-# Tests needed for SINIX large file support.
-#
- *sysv4*)
- if test $host = mips-sni-sysv4 ; then
- AC_MSG_CHECKING([for LFS support])
- old_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
- AC_TRY_RUN([
-#include <unistd.h>
-main () {
-#if _LFS64_LARGEFILE == 1
-exit(0);
-#else
-exit(1);
-#endif
-}], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
- CPPFLAGS="$old_CPPFLAGS"
- if test x$SINIX_LFS_SUPPORT = xyes ; then
- CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
- 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"
- fi
- AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
- fi
- ;;
-
-# Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
-#
- *linux*)
- AC_MSG_CHECKING([for LFS support])
- old_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
- AC_TRY_RUN([
-#include <unistd.h>
-#include <sys/utsname.h>
-#include <string.h>
-#include <stdlib.h>
-main() {
-#if _LFS64_LARGEFILE == 1
- struct utsname uts;
- char *release;
- int major, minor;
-
- /* Ensure this is glibc 2.2 or higher */
-#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
- int libc_major = __GLIBC__;
- int libc_minor = __GLIBC_MINOR__;
-
- if (libc_major < 2)
- exit(1);
- if (libc_minor < 2)
- exit(1);
-#endif
-
- /* Ensure this is kernel 2.4 or higher */
-
- uname(&uts);
- release = uts.release;
- major = atoi(strsep(&release, "."));
- minor = atoi(strsep(&release, "."));
-
- if (major > 2 || (major == 2 && minor > 3))
- exit(0);
- exit(1);
-#else
- exit(1);
-#endif
-}
-], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
- 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, 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])
- ;;
-
- *hurd*)
- AC_MSG_CHECKING([for LFS support])
- old_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
- AC_TRY_RUN([
-#include <unistd.h>
-main () {
-#if _LFS64_LARGEFILE == 1
-exit(0);
-#else
-exit(1);
-#endif
-}], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
- CPPFLAGS="$old_CPPFLAGS"
- if test x$GLIBC_LFS_SUPPORT = xyes ; then
- CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
- 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])
+ esac
;;
esac
@@ -242,21 +67,6 @@ AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h s
AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h dlfcn.h)
AC_CHECK_HEADERS(sys/syslog.h syslog.h)
AC_CHECK_HEADERS(stdint.h locale.h)
-
-#
-# HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
-# This causes configure to fail to detect it. Check for shadow separately on HPUX.
-#
-case "$host_os" in
- *hpux*)
- AC_TRY_COMPILE([#include <shadow.h>],[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,1,[Whether we have shadow.h])
- fi
- ;;
-esac
-
AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
AC_CHECK_HEADERS(nss.h nss_common.h ns_api.h sys/security.h security/pam_appl.h security/pam_modules.h)
AC_CHECK_HEADERS(stropts.h)
@@ -344,27 +154,6 @@ AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
AC_HAVE_DECL(snprintf, [#include <stdio.h>])
-# and glibc has setresuid under linux but the function does
-# nothing until kernel 2.1.44! very dumb.
-AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
- AC_TRY_RUN([#include <errno.h>
-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,1,[Whether the system has setresuid])
-fi
-
-# Do the same check for setresguid...
-#
-AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
- AC_TRY_RUN([#include <unistd.h>
-#include <errno.h>
-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,1,[Whether the system has setresgid])
-fi
-
AC_FUNC_MEMCMP
# The following test taken from the cvs sources
@@ -401,17 +190,6 @@ if test x"$ac_cv_func_connect" = x"no"; then
fi
fi
-###############################################
-# test for where we get yp_get_default_domain() from
-AC_SEARCH_LIBS(yp_get_default_domain, [nsl])
-AC_CHECK_FUNCS(yp_get_default_domain)
-
-# Check if we have execl, if not we need to compile smbrun.
-AC_CHECK_FUNCS(execl)
-if test x"$ac_cv_func_execl" = x"no"; then
- EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbrun\$(EXEEXT)"
-fi
-
AC_CHECK_FUNCS(dlopen dlclose dlsym dlerror waitpid getcwd strdup strndup strnlen strtoul strtoull strtouq strerror chown fchown chmod fchmod chroot link mknod mknod64)
AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat setpgid)
AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
@@ -421,11 +199,7 @@ AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate
AC_CHECK_FUNCS(setluid getpwanam setlinebuf)
AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
AC_CHECK_FUNCS(syslog vsyslog getgrouplist timegm backtrace)
-# setbuffer, shmget, shm_open are needed for smbtorture
-AC_CHECK_FUNCS(setbuffer shmget shm_open)
-
-# syscall() is needed for smbwrapper.
-AC_CHECK_FUNCS(syscall)
+AC_CHECK_FUNCS(setbuffer)
AC_CHECK_FUNCS(getdents)
AC_CHECK_FUNCS(pread pwrite)
@@ -433,52 +207,10 @@ AC_CHECK_FUNCS(pread pwrite)
# needed for lib/charcnv.c
AC_CHECK_FUNCS(setlocale)
-#
-# stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
-#
-
-if test x$ac_cv_func_stat64 = xno ; then
- AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
- AC_TRY_LINK([
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <sys/stat.h>
-], [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,1,[Whether stat64() is available])
- fi
-fi
-
#####################################
# we might need the resolv library on some systems
AC_CHECK_LIB(resolv, dn_expand)
-#
-# Check for the functions putprpwnam, set_auth_parameters,
-# getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
-# Needed for OSF1 and HPUX.
-#
-
-AC_LIBTESTFUNC(security, putprpwnam)
-AC_LIBTESTFUNC(sec, putprpwnam)
-
-AC_LIBTESTFUNC(security, set_auth_parameters)
-AC_LIBTESTFUNC(sec, set_auth_parameters)
-
-# UnixWare 7.x has its getspnam in -lgen
-AC_LIBTESTFUNC(gen, getspnam)
-
-AC_LIBTESTFUNC(security, getspnam)
-AC_LIBTESTFUNC(sec, getspnam)
-
-AC_LIBTESTFUNC(security, bigcrypt)
-AC_LIBTESTFUNC(sec, bigcrypt)
-
-AC_LIBTESTFUNC(security, getprpwnam)
-AC_LIBTESTFUNC(sec, getprpwnam)
-
# Assume non-shared by default and override below
BLDSHARED="false"
@@ -670,120 +402,6 @@ if test $ac_cv_shlib_works = no; then
fi
fi
-#
-# Check if the compiler supports the LL prefix on long long integers.
-# AIX needs this.
-
-AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
- AC_TRY_COMPILE([#include <stdio.h>],[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,1,[Whether the compiler supports the LL prefix on long long integers])
-fi
-
-
-AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
-AC_TRY_RUN([#include <stdio.h>
-#include <sys/stat.h>
-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,[The size of the 'off_t' type])
-fi
-
-AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
-AC_TRY_RUN([
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include <sys/stat.h>
-main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
-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,1,[Whether off64_t is available])
-fi
-
-AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
-AC_TRY_RUN([#include <stdio.h>
-#include <sys/stat.h>
-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,[The size of the 'ino_t' type])
-fi
-
-AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
-AC_TRY_RUN([
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include <sys/stat.h>
-main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
-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,1,[Whether the 'ino64_t' type is available])
-fi
-
-AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[
-AC_TRY_RUN([
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include <sys/stat.h>
-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,1,[Whether the 'dev64_t' type is available])
-fi
-
-AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
-AC_TRY_COMPILE([
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <sys/types.h>
-#include <dirent.h>],
-[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,1,[Whether the 'dirent64' struct is available])
-fi
-
-AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[
-AC_TRY_RUN([
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <sys/types.h>
-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,1,[Whether the major macro for dev_t is available])
-fi
-
-AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[
-AC_TRY_RUN([
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <sys/types.h>
-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,1,[Whether the minor macro for dev_t is available])
-fi
-
-AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
-AC_TRY_RUN([#include <stdio.h>
-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,1,[Whether the 'unsigned char' type is available])
-fi
-
AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>
@@ -794,15 +412,6 @@ if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
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,[
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <dirent.h>
-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,1,[Whether seekdir returns void])
-fi
-
AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
@@ -868,17 +477,6 @@ if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
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,[
-AC_TRY_RUN([#include <sys/types.h>
-#include <dirent.h>
-main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
-if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
-di->d_name[0] == 0) exit(0); exit(1);} ],
-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,1,[Whether readdir() is broken])
-fi
-
AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utime.h>],
@@ -1059,15 +657,6 @@ if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
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,1,[Whether current user is root])
-else
- AC_MSG_WARN(running as non-root will disable some tests)
-fi
-
##################
# look for a method of finding the list of network interfaces
iface=no;
@@ -1125,55 +714,6 @@ if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
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-.}/build/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,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-.}/build/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,1,[Whether fcntl64 locks are broken])
-
-else
-
-dnl
-dnl Don't check for 64 bit fcntl locking if we know that the
-dnl glibc2.1 broken check has succeeded.
-dnl
-
- AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
- AC_TRY_RUN([
-#if defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-
-#ifdef HAVE_SYS_FCNTL_H
-#include <sys/fcntl.h>
-#endif
-main() { struct flock64 fl64;
-#if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
-exit(0);
-#else
-exit(1);
-#endif
-}],
- 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,1,[Whether the flock64 struct is available])
- fi
-fi
-
AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>
@@ -1425,28 +965,7 @@ if test $space = no; then
fi
fi
-#
-# As a gating factor for large file support, in order to
-# use <4GB files we must have the following minimal support
-# available.
-# long long, and a 64 bit off_t or off64_t.
-# If we don't have all of these then disable large
-# file support.
-#
-AC_MSG_CHECKING([if large file support can be enabled])
-AC_TRY_COMPILE([
-#if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
-#include <sys/types.h>
-#else
-__COMPILE_ERROR_
-#endif
-],
-[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,1,[Whether large file support can be enabled])
-fi
-AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
+
#######################################
# Check for comparison_fn_t
@@ -1465,106 +984,3 @@ if test x"$samba_cv_HAVE_COMPARISON_FN_T" = x"yes"; then
AC_DEFINE(HAVE_COMPARISON_FN_T,1,[Whether or not we have comparison_fn_t])
fi
-#################################################
-# check for ACL support
-
-AC_MSG_CHECKING(whether to support ACLs)
-AC_ARG_WITH(acl-support,
-[ --with-acl-support Include ACL support (default=no)],
-[ case "$withval" in
- yes)
-
- case "$host_os" in
- *sysv5*)
- AC_MSG_RESULT(Using 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,1,[Whether solaris ACLs are available])
- ;;
- *hpux*)
- AC_MSG_RESULT(Using 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,1,[Whether IRIX ACLs are available])
- ;;
- *aix*)
- AC_MSG_RESULT(Using 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,1,[Whether Tru64 ACLs are available])
- ACL_LIBS="$ACL_LIBS -lpacl"
- ;;
- *freebsd5*)
- AC_MSG_RESULT(Using FreeBSD posix ACLs)
- AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether FreeBSD POSIX ACLs are available])
- AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
- ;;
- *linux*)
- AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
- AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
- AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
- acl_LIBS=$LIBS
- LIBS="$LIBS -lacl"
- AC_TRY_LINK([#include <sys/types.h>
-#include <sys/acl.h>],
-[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
-samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)
- LIBS=$acl_LIBS])
- if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
- AC_MSG_RESULT(Using 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,[
- acl_LIBS=$LIBS
- LIBS="$LIBS -lacl"
- AC_TRY_LINK([#include <sys/types.h>
-#include <sys/acl.h>],
-[ 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)
- LIBS=$acl_LIBS])
- if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
- AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
- fi
- fi
- ;;
- *)
- AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
- AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
- acl_LIBS=$LIBS
- LIBS="$LIBS -lacl"
- AC_TRY_LINK([#include <sys/types.h>
-#include <sys/acl.h>],
-[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
-samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)
- LIBS=$acl_LIBS])
- if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
- AC_MSG_RESULT(Using 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,[
- acl_LIBS=$LIBS
- LIBS="$LIBS -lacl"
- AC_TRY_LINK([#include <sys/types.h>
-#include <sys/acl.h>],
-[ 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)
- LIBS=$acl_LIBS])
- if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
- AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
- fi
- fi
- ;;
- esac
- ;;
- *)
- AC_MSG_RESULT(no)
- AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
- ;;
- esac ],
- AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
- AC_MSG_RESULT(no)
-)
diff --git a/source4/build/tests/summary.c b/source4/build/tests/summary.c
index b6384a4083..6fbe46b87b 100644
--- a/source4/build/tests/summary.c
+++ b/source4/build/tests/summary.c
@@ -4,11 +4,6 @@ void exit(int);
main()
{
-#if !(defined(HAVE_FCNTL_LOCK) || defined(HAVE_STRUCT_FLOCK64))
- printf("ERROR: No locking available. Running Samba would be unsafe\n");
- exit(1);
-#endif
-
#if !(defined(HAVE_IFACE_IFCONF) || defined(HAVE_IFACE_IFREQ) || defined(HAVE_IFACE_AIX))
printf("WARNING: No automated network interface determination\n");
#endif
diff --git a/source4/utils/getntacl.c b/source4/utils/getntacl.c
index 762167a93a..87cc280fcc 100644
--- a/source4/utils/getntacl.c
+++ b/source4/utils/getntacl.c
@@ -23,108 +23,8 @@
#include "includes.h"
#include "system/filesys.h"
-#if (defined(HAVE_NO_ACLS) || !defined(HAVE_XATTR_SUPPORT))
-
int main(int argc, char **argv)
{
- printf("ACL support not compiled in.");
+ printf("This utility disabled until rewritten\n");
return 1;
}
-
-#else
-
-/* Display a security descriptor in "psec" format which is as follows.
-
- The first two lines describe the owner user and owner group of the
- object. If either of these lines are blank then the respective
- owner property is not set. The remaining lines list the individual
- permissions or ACE entries, one per line. Each column describes a
- different property of the ACE:
-
- Column Description
- -------------------------------------------------------------------
- 1 ACE type (allow/deny etc)
- 2 ACE flags
- 3 ACE mask
- 4 SID the ACE applies to
-
- Example:
-
- S-1-5-21-1067277791-1719175008-3000797951-500
-
- 1 9 0x10000000 S-1-5-21-1067277791-1719175008-3000797951-501
- 1 2 0x10000000 S-1-5-21-1067277791-1719175008-3000797951-501
- 0 9 0x10000000 S-1-5-21-1067277791-1719175008-3000797951-500
- 0 2 0x10000000 S-1-5-21-1067277791-1719175008-3000797951-500
- 0 9 0x10000000 S-1-5-21-1067277791-1719175008-3000797951-513
- 0 2 0x00020000 S-1-5-21-1067277791-1719175008-3000797951-513
- 0 2 0xe0000000 S-1-1-0
-*/
-
-static void print_psec(TALLOC_CTX *mem_ctx, struct security_descriptor *sd)
-{
- if (sd->owner_sid)
- printf("%s\n", dom_sid_string(mem_ctx, sd->owner_sid));
- else
- printf("\n");
-
- if (sd->group_sid)
- printf("%s\n", dom_sid_string(mem_ctx, sd->owner_sid));
- else
- printf("\n");
-
- /* Note: SACL not displayed */
-
- if (sd->dacl) {
- int i;
-
- for (i = 0; i < sd->dacl->num_aces; i++) {
- struct security_ace *ace = &sd->dacl->aces[i];
-
- printf("%d %d 0x%08x %s\n", ace->type, ace->flags,
- ace->access_mask,
- dom_sid_string(mem_ctx, &ace->trustee));
- }
-
- }
-}
-
-int main(int argc, char **argv)
-{
- TALLOC_CTX *mem_ctx;
- ssize_t size;
- char *data;
- struct security_descriptor sd;
- DATA_BLOB blob;
- struct ndr_pull *ndr;
- NTSTATUS result;
-
- static_init_getntacl;
-
- mem_ctx = talloc_init("getntacl");
-
- /* Fetch ACL data */
-
- size = getxattr(argv[1], "security.ntacl", NULL, 0);
-
- if (size == -1) {
- fprintf(stderr, "%s: %s\n", argv[1], strerror(errno));
- exit(1);
- }
-
- data = talloc_size(mem_ctx, size);
-
- size = getxattr(argv[1], "security.ntacl", data, size);
-
- blob = data_blob_talloc(mem_ctx, data, size);
-
- ndr = ndr_pull_init_blob(&blob, mem_ctx);
-
- result = ndr_pull_security_descriptor(
- ndr, NDR_SCALARS|NDR_BUFFERS, &sd);
-
- print_psec(data, &sd);
- return 0;
-}
-
-#endif /* HAVE_NO_ACLS */
diff --git a/source4/utils/setntacl.c b/source4/utils/setntacl.c
index 0535c3037e..d7fe2f0a68 100644
--- a/source4/utils/setntacl.c
+++ b/source4/utils/setntacl.c
@@ -23,96 +23,8 @@
#include "includes.h"
#include "system/filesys.h"
-#if (defined(HAVE_NO_ACLS) || !defined(HAVE_XATTR_SUPPORT))
-
int main(int argc, char **argv)
{
- printf("ACL support not compiled in.");
+ printf("This utility disabled until rewritten\n");
return 1;
}
-
-#else
-
-static void setntacl(char *filename, struct security_descriptor *sd)
-{
- NTSTATUS status;
- struct ndr_push *ndr;
- ssize_t result;
-
- ndr = ndr_push_init();
-
- status = ndr_push_security_descriptor(
- ndr, NDR_SCALARS|NDR_BUFFERS, sd);
-
- result = setxattr(
- filename, "security.ntacl", ndr->data, ndr->offset, 0);
-
- if (result == -1) {
- fprintf(stderr, "%s: %s\n", filename, strerror(errno));
- exit(1);
- }
-
-}
-
- int main(int argc, char **argv)
-{
- char line[255];
- struct security_descriptor *sd;
- TALLOC_CTX *mem_ctx;
- struct security_acl *acl;
-
- static_init_ntacl;
-
- setup_logging("setntacl", DEBUG_STDOUT);
-
- mem_ctx = talloc_init("setntacl");
-
- sd = sd_initialise(mem_ctx);
-
- fgets(line, sizeof(line), stdin);
- sd->owner_sid = dom_sid_parse_talloc(mem_ctx, line);
-
- fgets(line, sizeof(line), stdin);
- sd->group_sid = dom_sid_parse_talloc(mem_ctx, line);
-
- acl = talloc_p(mem_ctx, struct security_acl);
-
- acl->revision = 2;
- acl->size = 0;
- acl->num_aces = 0;
- acl->aces = NULL;
-
- while(fgets(line, sizeof(line), stdin)) {
- int ace_type, ace_flags;
- uint32 ace_mask;
- char sidstr[255];
- struct dom_sid *sid;
-
- if (sscanf(line, "%d %d 0x%x %s", &ace_type, &ace_flags,
- &ace_mask, sidstr) != 4) {
- fprintf(stderr, "invalid ACL line\ndr");
- return 1;
- }
-
- acl->aces = talloc_realloc(mem_ctx, acl->aces,
- (acl->num_aces + 1) * sizeof(struct security_ace));
-
- acl->aces[acl->num_aces].type = ace_type;
- acl->aces[acl->num_aces].flags = ace_flags;
- acl->aces[acl->num_aces].access_mask = ace_mask;
-
- sid = dom_sid_parse_talloc(mem_ctx, sidstr);
-
- acl->aces[acl->num_aces].trustee = *sid;
-
- acl->num_aces++;
- }
-
- sd->dacl = acl;
-
- setntacl(argv[1], sd);
-
- return 0;
-}
-
-#endif /* HAVE_NO_ACLS */
diff --git a/source4/utils/setnttoken.c b/source4/utils/setnttoken.c
index ccdd7a5578..d7fe2f0a68 100644
--- a/source4/utils/setnttoken.c
+++ b/source4/utils/setnttoken.c
@@ -23,60 +23,8 @@
#include "includes.h"
#include "system/filesys.h"
-#if (defined(HAVE_NO_ACLS) || !defined(HAVE_XATTR_SUPPORT))
-
int main(int argc, char **argv)
{
- printf("ACL support not compiled in.");
+ printf("This utility disabled until rewritten\n");
return 1;
}
-
-#else
-
-int main(int argc, char **argv)
-{
- char line[255];
- struct ndr_push *ndr;
- struct lsa_SidArray sidarray;
- NTSTATUS status;
- TALLOC_CTX *mem_ctx;
-
- static_init_setnttoken;
-
- setup_logging("setnttoken", DEBUG_STDOUT);
-
- mem_ctx = talloc_init("setnttoken");
-
- ndr = ndr_push_init();
-
- sidarray.num_sids = 0;
- sidarray.sids = NULL;
-
- while(fgets(line, sizeof(line), stdin)) {
- struct dom_sid *sid = dom_sid_parse_talloc(ndr, line);
-
- if (!sid) {
- fprintf(stderr, "Invalid sid: %s", line);
- continue;
- }
-
- sidarray.sids = talloc_realloc(mem_ctx, sidarray.sids,
- (sidarray.num_sids + 1) * sizeof(struct lsa_SidPtr));
-
- sidarray.sids[sidarray.num_sids].sid =
- dom_sid_dup(ndr, sid);
-
- sidarray.num_sids++;
- }
-
-/* NDR_PRINT_DEBUG(lsa_SidArray, &sidarray); */
-
- status = ndr_push_lsa_SidArray(
- ndr, NDR_SCALARS|NDR_BUFFERS, &sidarray);
-
- fwrite(ndr->data, 1, ndr->offset, stdout);
-
- return 0;
-}
-
-#endif /* HAVE_NO_ACLS */