Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!elroy.jpl.nasa.gov!ncar!midway!gargoyle!ddsw1!vijay From: vijay@ddsw1.MCS.COM (Vijay Gurbani) Newsgroups: comp.unix.questions Subject: blanking out arguments to daemons Summary: How do you blank out arguments to daemons Keywords: argc, argv, fork, daemon, ORACLE Message-ID: <1990Dec26.195655.14647@ddsw1.MCS.COM> Date: 26 Dec 90 19:56:55 GMT Reply-To: vijay@ddsw1.MCS.COM (Vijay Gurbani) Distribution: usa Organization: ddsw1.MCS.COM Contributor, Wheeling, IL Lines: 49 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@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@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@ddsw1.mcs.com | "I'm not a bug...I'm just a feature implemented that Chicago, IL |____ way...!!"