"tip" leaves device file exclusively open

David Lai lai at vedge.UUCP
Wed Nov 30 08:33:13 AEST 1988


In article <318 at taux02.UUCP> amos at 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 at 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 at larry.mcrcim.mcgill.edu || ...watmath!onfcanim!vedge!lai)



More information about the Comp.unix.wizards mailing list