Hello. Searching through the source while exploring Samba locking subsystem, I noticed a possible typo: while opening a semaphore in sysv_shm_open(), one of return code checks tests a wrong id variable, instead of sem_id it checks shm_id, which has not been messed with yet. Here is the patch: diff -ur samba-2.0.7.old/source/locking/shmem_sysv.c samba-2.0.7/source/locking/shmem_sysv.c --- samba-2.0.7.old/source/locking/shmem_sysv.c Wed Apr 26 09:06:55 2000 +++ samba-2.0.7/source/locking/shmem_sysv.c Thu Oct 12 14:54:43 2000 @@ -578,7 +578,7 @@ } } } - if (shm_id == -1) { + if (sem_id == -1) { sem_id = semget(SEMAPHORE_KEY, 0, 0); } if (sem_id == -1) { Hope it helps. -- /Awesome Walrus <walrus@amur.ru> [Uriel Zael] [Still Alive] [Evil Vugluskrs]
Thanks Dennis, All the locking code has been rewritten for 2.2 so this file does not exist anymore. Nice catch for 2.0.7 though. :-) Cheers, jerry Dennis Vshivkov wrote:> > Hello. > > Searching through the source while exploring > Samba locking subsystem, I noticed a possible typo: while > opening a semaphore in sysv_shm_open(), one of return > code checks tests a wrong id variable, instead of > sem_id it checks shm_id, which has not been messed with > yet. Here is the patch:---------------------------------------------------------------------- /\ Gerald (Jerry) Carter Professional Services \/ http://www.valinux.com/ VA Linux Systems gcarter@valinux.com http://www.samba.org/ SAMBA Team jerry@samba.org http://www.plainjoe.org/ jerry@plainjoe.org "...a hundred billion castaways looking for a home." - Sting "Message in a Bottle" ( 1979 )