Re: [ILUG] hiding commandline arguments

From: Justin Mason (jm at domain jmason.org)
Date: Tue 17 Sep 2002 - 18:43:03 IST


Colm MacC rthaigh said:

> > 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.

And there'd be a race condition, too, where they'd still be
visible until the app ran its "clean argv" code.

You're better off using

  (a) a temporary file, mode 600, or

  (b) env variables. still not quite safe though, I think
  root or the same user could use a "ps" arg to see these, or

  (c) echo it into the app on STDIN or another inherited
  filehandle.

--j.



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