From owner-freebsd-chat Fri Feb 14 18:54:39 2003 Delivered-To: freebsd-chat@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F1E237B401 for ; Fri, 14 Feb 2003 18:54:38 -0800 (PST) Received: from HAL9000.homeunix.com (12-233-57-224.client.attbi.com [12.233.57.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF46443FA3 for ; Fri, 14 Feb 2003 18:54:37 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id h1F2sbbL003843; Fri, 14 Feb 2003 18:54:37 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id h1F2sboX003842; Fri, 14 Feb 2003 18:54:37 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Fri, 14 Feb 2003 18:54:37 -0800 From: David Schultz To: pura life CR Cc: freebsd-chat@FreeBSD.ORG Subject: Re: 2 Misc questions Message-ID: <20030215025437.GA3750@HAL9000.homeunix.com> Mail-Followup-To: pura life CR , freebsd-chat@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Thus spake pura life CR : > 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