Fixed SHM_R/SHM_W warnings by moving sys/ipc.h and sys/shm.h into includes.h
authorJeremy Allison <jra@samba.org>
Thu, 3 May 2001 19:47:30 +0000 (19:47 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 3 May 2001 19:47:30 +0000 (19:47 +0000)
and using autoconf tests.
Added "restrict acl with mask" parameter.
Jeremy.
(This used to be commit 7792e32ba7fd734cc68b354f31c382ac11521fe8)

source3/configure
source3/configure.in
source3/include/config.h.in
source3/include/includes.h
source3/param/loadparm.c
source3/profile/profile.c
source3/smbd/posix_acls.c
source3/utils/torture.c

index 8f0863d9c9cbb7b78cab572d97c19892eb38ff7e..33cb805bb6d72f7724d7f6ec531d51791699579a 100755 (executable)
@@ -2456,7 +2456,7 @@ else
 fi
 done
 
-for ac_hdr in sys/param.h ctype.h sys/un.h sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h
+for ac_hdr in sys/param.h ctype.h sys/un.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
@@ -2496,7 +2496,7 @@ else
 fi
 done
 
-for ac_hdr in sys/mman.h sys/filio.h sys/priv.h string.h strings.h stdlib.h sys/socket.h
+for ac_hdr in sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
index 3083901f72fa317db3090c437e777806934f837e..82b30b562ae3289b411a42c9ec6348be3193cfe4 100644 (file)
@@ -248,8 +248,8 @@ AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
-AC_CHECK_HEADERS(sys/param.h ctype.h sys/un.h sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
-AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h string.h strings.h stdlib.h sys/socket.h)
+AC_CHECK_HEADERS(sys/param.h ctype.h sys/un.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
+AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
 #
index 5904cece6d7f0f0e78bd855c8b09262d0f9f8db5..ce57f968d240be906f2949c62c7e5859e14f9192 100644 (file)
 /* Define if you have the <sys/ioctl.h> header file.  */
 #undef HAVE_SYS_IOCTL_H
 
+/* Define if you have the <sys/ipc.h> header file.  */
+#undef HAVE_SYS_IPC_H
+
 /* Define if you have the <sys/mman.h> header file.  */
 #undef HAVE_SYS_MMAN_H
 
 /* Define if you have the <sys/select.h> header file.  */
 #undef HAVE_SYS_SELECT_H
 
+/* Define if you have the <sys/shm.h> header file.  */
+#undef HAVE_SYS_SHM_H
+
 /* Define if you have the <sys/socket.h> header file.  */
 #undef HAVE_SYS_SOCKET_H
 
index e2edb512ae5f4c6f8184a391487406e3b44fb337..5988393588296770c6a7586efa409550732d2347 100644 (file)
 #endif
 #endif /* HAVE_NETGROUP */
 
+#if defined(HAVE_SYS_IPC_H)
+#include <sys/ipc.h>
+#endif /* HAVE_SYS_IPC_H */
+
+#if defined(HAVE_SYS_SHM_H)
+#include <sys/shm.h>
+#endif /* HAVE_SYS_SHM_H */
+
 /*
  * Define VOLATILE if needed.
  */
index 75468ab07433ac47642a903ce591d040557f9303..50e2450684e6e30c28f6aa7d2cf488ec5c466772 100644 (file)
@@ -395,6 +395,7 @@ typedef struct
        BOOL bBlockingLocks;
        BOOL bInheritPerms;
        BOOL bMSDfsRoot;
+       BOOL bRestrictAclWithMask;
 
        char dummy[3];          /* for alignment */
 }
@@ -508,6 +509,7 @@ static service sDefault = {
        True,                   /* bBlockingLocks */
        False,                  /* bInheritPerms */
        False,                  /* bMSDfsRoot */
+       False,                  /* bRestrictAclWithMask */
 
        ""                      /* dummy */
 };
@@ -791,6 +793,7 @@ static struct parm_struct parm_table[] = {
        {"nt smb support", P_BOOL, P_GLOBAL, &Globals.bNTSmbSupport, NULL, NULL, 0},
        {"nt pipe support", P_BOOL, P_GLOBAL, &Globals.bNTPipeSupport, NULL, NULL, 0},
        {"nt acl support", P_BOOL, P_GLOBAL, &Globals.bNTAclSupport, NULL, NULL, 0},
+       {"restrict acl with mask", P_BOOL, P_LOCAL, &sDefault.bRestrictAclWithMask, NULL, NULL, FLAG_SHARE},
        {"announce version", P_STRING, P_GLOBAL, &Globals.szAnnounceVersion, NULL, NULL, 0},
        {"announce as", P_ENUM, P_GLOBAL, &Globals.announce_as, NULL, enum_announce_as, 0},
        {"max mux", P_INTEGER, P_GLOBAL, &Globals.max_mux, NULL, NULL, 0},
@@ -1674,6 +1677,7 @@ FN_LOCAL_BOOL(lp_dos_filetime_resolution, bDosFiletimeResolution)
 FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes)
 FN_LOCAL_BOOL(lp_blocking_locks, bBlockingLocks)
 FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms)
+FN_LOCAL_BOOL(lp_restrict_acl_with_mask, bRestrictAclWithMask)
 FN_LOCAL_INTEGER(lp_create_mask, iCreate_mask)
 FN_LOCAL_INTEGER(lp_force_create_mode, iCreate_force_mode)
 FN_LOCAL_INTEGER(_lp_security_mask, iSecurity_mask)
index a00769cb468bee576bd01891da98dc93a9a9fab6..20ad8531d88cd2d6d344fcef9585908bcb96ddad 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "includes.h"
 
-#include <sys/shm.h>
-
 extern int DEBUGLEVEL;
 
 #define IPC_PERMS ((SHM_R | SHM_W) | (SHM_R>>3) | (SHM_R>>6))
index 0c613e8835205c3b746e0c59bf61bec24375ff93..bf8716d713c9ee7b115da645f0c15df8425d87f3 100644 (file)
@@ -468,6 +468,9 @@ static mode_t apply_default_perms(files_struct *fsp, mode_t perms, mode_t type)
        mode_t and_bits = (mode_t)0;
        mode_t or_bits = (mode_t)0;
 
+       if (!lp_restrict_acl_with_mask(snum))
+               return perms;
+
        /* Get the initial bits to apply. */
 
        if (fsp->is_directory) {
@@ -1173,6 +1176,9 @@ static mode_t create_default_mode(files_struct *fsp, BOOL interitable_mode)
        if (fsp->is_directory)
                mode |= (S_IWUSR|S_IXUSR);
 
+       if (!lp_restrict_acl_with_mask(snum))
+               return mode;
+
        /*
         * Now AND with the create mode/directory mode bits then OR with the
         * force create mode/force directory mode bits.
index 871e2adfc342ecc02ef1a9f3a3541c2d1f49647a..fe22b60a89960f74433c3951f55b602c9cbd7af3 100644 (file)
@@ -22,8 +22,6 @@
 #define NO_SYSLOG
 
 #include "includes.h"
-#include <sys/ipc.h>
-#include <sys/shm.h>
 
 static fstring host, workgroup, share, password, username, myname;
 static int max_protocol = PROTOCOL_NT1;