Date: Fri, 14 Feb 2003 18:54:37 -0800 From: David Schultz <dschultz@uclink.Berkeley.EDU> To: pura life CR <puralifecr@hotmail.com> Cc: freebsd-chat@FreeBSD.ORG Subject: Re: 2 Misc questions Message-ID: <20030215025437.GA3750@HAL9000.homeunix.com> In-Reply-To: <F36UzmRf6Ci6nx8dyDd0001948d@hotmail.com> References: <F36UzmRf6Ci6nx8dyDd0001948d@hotmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake pura life CR <puralifecr@hotmail.com>:
> Hi, I have a couple of question that dont allow me to sleep properly.
> here we go:
> 1. is this suid root code exploitable with a buffer overflow technique:
> /* foo.c */
> main(int argc, char *argv[]){
> ...
> setuid(0)
> ...
> if ( ((strcmp(argv[i],"foo")) == 0)
> || ((strcmp(argv[i],"bar")) == 0) )
> ....
> }
No, but write another few thousand lines and we'll see...
> 2. how can I redirect stderr to /dev/null? for example when I am 'finding'
> a file in the whole dir tree I dont want to look at the "permised denied"
> warning.
> ej: find / -name "foo" -print > /dev/null & <--- how to redict stderr
In the C shell, you can't do it in a direct way. You have to say:
( my-command > /dev/tty ) >& /dev/null
In the Bourne shell, you just say:
my-command 2>/dev/null
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030215025437.GA3750>
