Bug 32 - visudo always fails to lock sudoers (NEXTSTEP3.3 m68k)
visudo always fails to lock sudoers (NEXTSTEP3.3 m68k)
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Visudo
1.6.3
Other NEXTSTEP
: normal normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2001-04-04 07:10 MDT by twetzel
Modified: 2001-04-04 15:19 MDT (History)
0 users

See Also:


Attachments
Patch for file locking on NS3.3/m68k (1.20 KB, patch)
2001-04-04 07:12 MDT, twetzel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description twetzel 2001-04-04 07:10:50 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.)
Comment 1 twetzel 2001-04-04 07:12:59 MDT
Created attachment 4 [details]
Patch for file locking on NS3.3/m68k
Comment 2 Todd C. Miller 2001-04-04 11:19:59 MDT
Thanks for the patch.  I've added a special case for NeXTSTEP to avoid lockf()
so this should be automatic in 1.6.4.