Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site lsuc.UUCP Path: utzoo!utcs!lsuc!dave From: dave@lsuc.UUCP (David Sherman) Newsgroups: net.bugs.uucp Subject: Re: Read permission on /etc/phones Message-ID: <721@lsuc.UUCP> Date: Fri, 19-Jul-85 13:18:06 EDT Article-I.D.: lsuc.721 Posted: Fri Jul 19 13:18:06 1985 Date-Received: Fri, 19-Jul-85 14:53:21 EDT Reply-To: dave@lsuc.UUCP (David Sherman) Organization: Law Society of Upper Canada, Toronto Lines: 38 Keywords: tip, uucp, LCK References:<472@qantel.UUCP> <170@motel6.UUCP> <154@telesoft.UUCP> <696@lsuc.UUCP> <697@lsuc.UUCP> <1953@ukma.UUCP> In article <1953@ukma.UUCP> david@ukma.UUCP (David Herron, NPR Lover) writes: > In article <697@lsuc.UUCP> dave@lsuc.UUCP (David Sherman) writes: > >||Why not just write a simple set-UID program which removes > >||the LCK file and nothing else? You can get fancy with various > >||checks, of course, but in its simplest form it's a one-line > >||C program. > > > >Whoops, I forgot one thing. You want this done automatically > >when tip exits. So move tip to /usr/lib and make tip a shell > >file which reads > > trap '/usr/lib/cleanLCK' 0 1 2 3 9 15 > > /usr/lib/tip $* > > How does this solve anything? I don't see where this removes the > lock file. > > 1) cleanLCK isn't called explicitly, only on a signal, which > won't happen. > 2) cleanLCK *cannot* know which lock file to delete. (1) Notice the trap on 0. That will pick up the case of normal exit, on at least some implementations of UNIX. Of course, you can put another "/usr/lib/cleanLCK" after the call to tip. (2) As I SAID, you can get fancier. This version assumes you have only one dialout line, so the file to delete is LCK..cul0 or whatever. If you have several, just pass $* to cleanLCK and have it parse the args to tip to figure out which line should be unlocked. > Answer me one question, why are we discussing tip problems in net.bugs.uucp? Because that's where the discussion began, because the discussion will be short-lived, and because it's still related to UUCP, since that's where the LCK file goes. Dave Sherman -- { ihnp4!utzoo pesnta utcs hcr decvax!utcsri } !lsuc!dave