Re: [ILUG] hiding commandline arguments

From: Colm MacCárthaigh (colmmacc at domain redbrick.dcu.ie)
Date: Tue 17 Sep 2002 - 17:53:03 IST


On Tue, Sep 17, 2002 at 05:30:49PM +0100, Vincent Cunniffe wrote:
> how do you delete/remove commandline arguments from an application
> once it's used them but continues to run where everyone can see it
> and, for example, simply run 'top' to see them?

Under linux you can modify argv directly and the kernel
will pick it up. This is one of the unportable hacks
every though, for something close to portable I think
people just usually steal the sendmail code for
doing it, because they have the hacks for all of the
different OS's out there :)

> I want to execute applications and pass them the credentials they
> need to access a database, but not have that data visible to the
> rest of the world via the process list.

Most DB's do this by implementing a -p option that with no
argument will prompt you for the password, that's a much
better way of doing it and will complete avoid the
race conditions you'll create. I think there's actually a
copy kept , in /proc or something of the initial arguments
anyway.

-- 
colmmacc at domain redbrick.dcu.ie        PubKey: colmmacc+pgp at domain redbrick.dcu.ie  
Web:                                 http://devnull.redbrick.dcu.ie/ 


This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:18:55 GMT