blanking out arguments to daemons

Vijay Gurbani vijay at ddsw1.MCS.COM
Thu Dec 27 06:56:55 AEST 1990


Hi Folks:
   I need to hide the command line arguments to a daemon that I am writing.
This daemon logs on to an ORACLE database and runs SQL command scripts. The
command line arguments to it are the database user name and password. You
can obviously see the security leak open (for ORACLE tables) to anybody 
using the "ps -ef" command. 

This is what I have tried so far :

               :
               :
       strcpy(Login, argv[1]);    /* Save the name/password combination  */
       strcpy(Passwd, argv[2]);
       argv[1] = argv[2] = '\0';  /* Erase the arguments on command line */
      
      /** Code for setpgrp() and closing file descriptors is not shown  **/
      /** to conserve space and make the example short and sweet        **/

       switch (fork())  {
          case 0   : break;       /* Child - handle the required task    */
          case -1  : perror("fork");  /* Handle error                    */
                     exit(1);
          default  : exit(0);  /* Parent - die! (UNIX is so bloody :-) ) */
       }
               :    /* Rest of the daemon                                */
               :

The only problem is that on a "ps -ef" the command line arguments still
show. I cannot blank them out. How do I communicate with the external envi-
ronment? Does anybody know how to do this? If so, please drop me a line at 
vijay at ddsw1.mcs.com. If there is enough interest, I will post a summary of the 
results. 

FYI : OS - System V R3.2

Thanks in advance...

-vijay
--
Vijay Gurbani       | "I'm not bad...I'm just drawn that way"- Jessica Rabbitt
vijay at ddsw1.mcs.com | "I'm not a bug...I'm just a feature implemented that 
Chicago, IL         |____   way...!!" 
Occupation: ??????????? |   - Robert T. Morris' Internet Worm on its defense

-- 
--
Vijay Gurbani       | "I'm not bad...I'm just drawn that way"- Jessica Rabbitt
vijay at ddsw1.mcs.com | "I'm not a bug...I'm just a feature implemented that 
Chicago, IL         |____   way...!!" 



More information about the Comp.unix.questions mailing list