SUID and Shell scripts

John E Van Deusen III jiii at visdc.UUCP
Fri May 19 09:40:29 AEST 1989


Consider the situation where you have a C program with the setuid bit
set, and you have execed a shell script as follows:

	(void) execl("/bin/sh", "sh", "-c", "myprog.sh", 0);

In writing myprog.sh, certain things may not work as expected.
One of the most important could be test.  A construct like

	test -r $FILE || exit 1

might have to be replaced with something more cumbersome.

	test "`find . -name $FILE -user $EUID -perm -400 -print | \
		fgrep -x ./$FILE`" || exit 1
--
John E Van Deusen III, PO Box 9283, Boise, ID  83707, (208) 343-1865

uunet!visdc!jiii



More information about the Comp.unix.questions mailing list