03-11-06 01:47 AM
bryce.johnson@ingenix-dot-com.no-spam.invalid (johnsonbryce) writes:
> I need to write a function that will work in sh/ksh shell that will
> test to see if a file has already been opened for writing by another
> user, but i don't have execute permissions on fuser and lsof not on
> system
>
> i think you can also do it using the "test
> -t" but can't seem to figure out the syntax - has
> anyone done this?
No, "test -t" does something different (it tests whether a given file
descriptor (not named file) is opened on a terminal).
If you don't have permissions to run fuser or lsof, you probably can't
do this (if I'm mistaken, I'm sure someone will say so). This is
information about other users that the system deliberately doesn't let
you have. It's possible to install the fuser command SUID root (if
you have root access already), but doing so might open security holes.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
[ Post a follow-up to this message ]
|