Solaris 7 5/99 and samba-2.0.5a (PR#19508)
Jeremy Allison
jallison at cthulhu.engr.sgi.com
Fri Aug 6 20:22:40 GMT 1999
bob at hobbes.dtcc.edu wrote:
>
> this samba was built on a solaris 2.5 system and was running fine on a
> solaris 7 3/99 system. when i installed the solaris 7 5/99 maintenance
> update something broke.
>
> log.smb:
>
> [1999/08/06 11:04:41, 1] smbd/server.c:main(628)
> smbd version 2.0.5a started.
> Copyright Andrew Tridgell 1992-1998
> [1999/08/06 11:36:49, 0] locking/shmem_sysv.c:sysv_shm_open(597)
> ERROR: root did not create the semaphore
> [1999/08/06 11:36:49, 0] locking/locking.c:locking_init(174)
> ERROR: Failed to initialise share modes
Try this fix (it causes Samba to do a lookup on root
and check the correct gid_t rather than just assuming 0).
Regards,
Jeremy Allison,
Samba Team.
--- /usr/people/jallison/src/samba-2/samba/source/locking/shmem_sysv.c Wed Jul
14 09:40:38 1999
+++ locking/shmem_sysv.c Thu Jul 29 10:41:15 1999
@@ -528,6 +528,7 @@
/*******************************************************************
open the shared memory
******************************************************************/
+
struct shmem_ops *sysv_shm_open(int ronly)
{
BOOL other_processes;
@@ -536,6 +537,8 @@
union semun su;
int i;
pid_t pid;
+ struct passwd *root_pwd = sys_getpwuid((uid_t)0);
+ gid_t root_gid = root_pwd ? root_pwd->pw_gid : (gid_t)0;
read_only = ronly;
@@ -593,7 +596,7 @@
hash_size = sem_ds.sem_nsems-1;
if (!read_only) {
- if (sem_ds.sem_perm.cuid != 0 || sem_ds.sem_perm.cgid != 0) {
+ if (sem_ds.sem_perm.cuid != 0 || sem_ds.sem_perm.cgid !=
root_gid) {
DEBUG(0,("ERROR: root did not create the semaphore\n"));
return NULL;
}
@@ -684,7 +687,7 @@
}
if (!read_only) {
- if (shm_ds.shm_perm.cuid != 0 || shm_ds.shm_perm.cgid != 0) {
+ if (shm_ds.shm_perm.cuid != 0 || shm_ds.shm_perm.cgid !=
root_gid) {
DEBUG(0,("ERROR: root did not create the shmem\n"));
global_unlock();
return NULL;
--
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------
More information about the samba
mailing list