No! No! No! Denying LOCK_EX doesn't solve the problem, and isn't correct
BSD semantics either. You only need a LOCK_SH on wtmp to block the current
login/getty implementations indefinitely anyway. login & getty should be
fixed. flock() isn't broken the way it is.
- if login/getty are to lock the wtmp file at all, they should do so
with fcntl()/lockf(), which already have the semantics you're asking
for.
- even this won't help, because a F_RDLCK on wtmp will block login/getty's
F_WRLCK.
- login/getty don't need to lock the wtmp file anyway, they can just open
it with O_WRONLY|O_APPEND. This is what SunOS 4.1.x and BSD do. I'm just
about to check what Solaris does (gotta compile strace first).
-Andy
-- Andy Walker Kvaerner Engineering a.s. Andrew.Walker@lysaker.kvaerner.no P.O. Box 222, N-1324 Lysaker, Norway......if the answer isn't violence, neither is your silence......
(pwei barmy army - oslo "filial")