- added a check for broken RH5 include files. With the standard RH5
authorAndrew Tridgell <tridge@samba.org>
Sun, 22 Mar 1998 01:31:50 +0000 (01:31 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 22 Mar 1998 01:31:50 +0000 (01:31 +0000)
includes (ie. unpatched RH5) Samba gets file corruption because of the
incorrect definition of the shmid_ds structure. Updating your RH5
installation of glibc-devel fixes this.

- don't try to fcntl_lock() a read-only fd in shmem.c

- allow level 0 debug messages to get through in smbstatus
(This used to be commit 45553771f90087a12db0153524146d42155d1d3f)

source3/locking/shmem.c
source3/locking/shmem_sysv.c
source3/utils/status.c

index 63d7ebd3d41db94966f1c0ecbf6f5975fcc38f0f..9f24076171b9f3d7dc2bd9cc28abf2ca17792cde 100644 (file)
@@ -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)
index e415c2ebc5f750e184ee4b3e68fba4edb06ace52..b9d45949479ccd4f8de768adc1bf117042948020 100644 (file)
@@ -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();
index f99fe9e5618ea12a85cacfe357bfaa1acbeeedf8..40bafbe0c275c9ba367e48d2456085f1f66f09b1 100644 (file)
@@ -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");