Bugzilla – Bug 32
visudo always fails to lock sudoers (NEXTSTEP3.3 m68k)
Last modified: 2001-04-04 15:19:44 MDT
With NS3.3 (m68k), sudo-1.6.3p7 compiles cleanly. sudo works, but visudo always complains about the sudoers file being already locked. Reason: sudo finds and uses lockf(), but for some reason the lockf() call in lock_file() always return -1, errno=EINVAL for my system (note that EINVAL isn't even a documented return for my lockf(), and that AFAIK lockf() is generally working on NS.) Workaround: Use flock() instead of lockf() by enabling HAVE_FLOCK instead of HAVE_LOCKF in config.h. (I haven't tried to automate this with configure, so at least a notice in the docs seems useful.) The appended patch also includes the header file for flock() and fixes a possible typo for SUDO_UNLOCK. (This seems to also affect sudo with logging to file and flock() locking.)
Created attachment 4 [details] Patch for file locking on NS3.3/m68k
Thanks for the patch. I've added a special case for NeXTSTEP to avoid lockf() so this should be automatic in 1.6.4.