summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/locking/shmem.c6
-rw-r--r--source3/locking/shmem_sysv.c9
-rw-r--r--source3/utils/status.c2
3 files changed, 16 insertions, 1 deletions
diff --git a/source3/locking/shmem.c b/source3/locking/shmem.c
index 63d7ebd3d4..9f24076171 100644
--- a/source3/locking/shmem.c
+++ b/source3/locking/shmem.c
@@ -656,6 +656,9 @@ static BOOL smb_shm_lock_hash_entry( unsigned int entry)
return False;
}
+ if (read_only)
+ return True;
+
/* Do an exclusive wait lock on the 4 byte region mapping into this entry */
if (fcntl_lock(smb_shm_fd, F_SETLKW, start, sizeof(int), F_WRLCK) == False)
{
@@ -679,6 +682,9 @@ static BOOL smb_shm_unlock_hash_entry( unsigned int entry )
DEBUG(0,("ERROR smb_shm_unlock_hash_entry : bad smb_shm_fd (%d)\n",smb_shm_fd));
return False;
}
+
+ if (read_only)
+ return True;
/* Do a wait lock on the 4 byte region mapping into this entry */
if (fcntl_lock(smb_shm_fd, F_SETLKW, start, sizeof(int), F_UNLCK) == False)
diff --git a/source3/locking/shmem_sysv.c b/source3/locking/shmem_sysv.c
index e415c2ebc5..b9d4594947 100644
--- a/source3/locking/shmem_sysv.c
+++ b/source3/locking/shmem_sysv.c
@@ -542,6 +542,15 @@ struct shmem_ops *sysv_shm_open(int ronly)
int i;
int pid;
+
+
+#ifdef LINUX
+ if (sizeof(shm_ds) == 52) {
+ DEBUG(0,("WARNING: You probably have a broken set of glibc2 include files - disabling sysv shared memory\n"));
+ return NULL;
+ }
+#endif
+
read_only = ronly;
shm_size = lp_shmem_size();
diff --git a/source3/utils/status.c b/source3/utils/status.c
index f99fe9e561..40bafbe0c2 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -120,7 +120,7 @@ static void print_share_mode(share_mode_entry *e, char *fname)
charset_initialise();
DEBUGLEVEL = 0;
- dbf = fopen("/dev/null","w");
+ dbf = stderr;
if (getuid() != geteuid()) {
printf("smbstatus should not be run setuid\n");