Lauren at UCLA-Security's problem

utzoo!decvax!yale-com!mp utzoo!decvax!yale-com!mp
Fri Jan 8 23:00:08 AEST 1982


Here is one suggestion:  Add a system call which allows a process with
effective uid == 0, to change the effective uid of ANOTHER process.  (The
system call will take as one argument, the process id of the process
whose euid is to be changed.)  
Then for the problem, something like this would do:
	pid = fork();
	if ( pid != 0 ) {
		signal( SIGINT, reset_uid );
		for(;;) pause();
		}
	/* child */
	setuid( getuid() );
	/*  ... do whatever needs to be done ...  */
	killpg( 0, SIGINT );
	/*  ...  Now you are back to euid == 0.   */
	/*  ...                                   */

reset_uid() {
	newsetuid( pid, 0 );
	exit( 0 );
	}



More information about the Comp.unix.wizards mailing list