[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] running as root



On Wed, 03 May 2000, Al Hudson wrote:
> > Try it 
> > yourself - a script with two lines:
> > 	#!/bin/sh
> > 	id
> > 
> > chown root.root then chmod 4755, and run it.
> 
> Try this: (it's C, obviously)
> 
> #include <stdio.h>
> #include <unistd.h>
> 
> void main(void) { /* I know you don't void(void), just for the record */
> 	printf("User id: %d\nis effectively: %d\n", getuid(), geteuid());	
> 	printf("Group id: %d\nis effectively: %d\n", getgid(), getegid());
> }
> 
> Save as test.c, or something, type 'make test'. Play around with it. EUID:
> root.
> 
> > The best thing to do is to use sudo to run the script, or, if you *know* the 
> > script is secure, create a C wrapper for it along the lines of:
> 
> Sudo is good for accounting ;)
> 
> > 	main()
> 
> You're worse than me ;)
> 
> > 	{
> > 		system ("/usr/bin/myshellscript");
> > 		return 0;
> > 	}
> 
> Although at least you return int .. :)))
> 

ok............. i think i'll forget that one for a while...
think i'll go back to looking for new desktop themes ;-)
-- 
Thanks,
        Ross
               ross.h [at] ntlworld.com
____________________________________________________________________________
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.