Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mcgill-vision!iros1!vedge!lai From: lai@vedge.UUCP (David Lai) Newsgroups: comp.unix.wizards Subject: Re: "tip" leaves device file exclusively open Message-ID: <2069@vedge.UUCP> Date: 29 Nov 88 22:33:13 GMT References: <137@abekrd.UUCP> <318@taux02.UUCP> Reply-To: lai@vedge.UUCP (David Lai) Organization: Visual Edge Software, St. Laurent, PQ Lines: 53 In article <318@taux02.UUCP> amos@taux02.UUCP (Amos Shapir) writes: >Check permissions to /usr/spool/uucp. tip creates a lock file there >(usually LCK.something) as user uucp, then does a setuid to the user >that runs it. In some versions, it forgets to setuid back to uucp >before removing the lock, so the remove fails and the lock is left >intact. Sometime the only solution is to make the directory writable >(shudder). >-- > Amos Shapir amos@nsc.com >National Semiconductor (Israel) P.O.B. 3007, Herzlia 46104, Israel >Tel. +972 52 522261 TWX: 33691, fax: +972-52-558322 >34 48 E / 32 10 N (My other cpu is a NS32532) I have a small script I use instead of 'tip' on the sun (which creates the LCK file as uucp but cant remove it afterwards, it is in the path before /usr/bin) tip: #!/bin/sh if test "$1" = "fast"; then a=cuad fi if test "$1" = "slow"; then a=cua0 fi if test "$1" = "slow300"; then a=cua0 fi if test "$1" = "fast" -o "$1" = "slow" -o "$1" = "slow300"; then if /usr/lib/uucp/uuchecklock $a; then /usr/bin/tip $* /usr/lib/uucp/uuunlock $a else echo "modem" $a "busy" fi else /usr/bin/tip $* fi /usr/lib/uucp/uuchecklock: (setuid to uucp) if test -f /usr/spool/uucp/LCK..$1; then exit 1 else exit 0 fi /usr/lib/uucp/uuunlock: (setuid to uucp) #!/bin/sh rm -f /usr/spool/uucp/LCK..$1 -- "What is a DJ if he can't scratch?" - Uncle Jamms Army The views expressed are those of the author, and not of Visual Edge, nor Usenet. David Lai (vedge!lai@larry.mcrcim.mcgill.edu || ...watmath!onfcanim!vedge!lai)