[patch] Re: smbmount problem
Michael H. Warfield
mhw at wittsend.com
Mon Feb 1 00:32:55 GMT 1999
Paul enscribed thusly:
> I have put together a patch that should correct both the autofs race and
> the problem with the kernel getting the wrong pid. This has nothing to do
> with glibc's uid_t being 32 bits and the kernel's being 16.
> This patch changes smbmount's behavior so that it first daemonizes, then
> the child attempts the final ioctl to the kernel to complete the mount.
> The parent does a "waitpid" on the child, and catches SIGTERM. If the
> child finishes the mount without a problem then the parent is killed with
> "SIGTERM" and exits with a return value of 0. If the child has a problem
> with the final ioctl, then it exits, the parent catches this, and returns
> with a return value of 1, signaling an error (consistant with the rest of
> smbmount).
> Result: It works with autofs (tested - no more race), and the kernel gets
> the proper PID of the process handling it. Yay.
The fix is already in the Samba CVS tree main branch. It also fixes
a serious deadly embrace condition with autofs... Much appriciation to
H. Peter Anvin for the final clue to fixing that final problem...
> Paul Laufer
Mike
--
Michael H. Warfield | (770) 985-6132 | mhw at WittsEnd.com
(The Mad Wizard) | (770) 925-8248 | http://www.wittsend.com/mhw/
NIC whois: MHW9 | An optimist believes we live in the best of all
PGP Key: 0xDF1DD471 | possible worlds. A pessimist is sure of it!
More information about the samba-technical
mailing list