1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Fixed SHM_R/SHM_W warnings by moving sys/ipc.h and sys/shm.h into includes.h

and using autoconf tests.
Added "restrict acl with mask" parameter.
Jeremy.
(This used to be commit 7792e32ba7)
This commit is contained in:
Jeremy Allison 2001-05-03 19:47:30 +00:00
parent 1475474425
commit 548d16869a
8 changed files with 28 additions and 8 deletions

4
source3/configure vendored
View File

@ -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

View 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)
#

View File

@ -876,6 +876,9 @@
/* 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
@ -903,6 +906,9 @@
/* 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

View File

@ -357,6 +357,14 @@
#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.
*/

View 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)

View 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))

View 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.

View 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;