The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Grep help flood Shell Programming and Scripting 3 06-05-2008 10:14 PM
Grep Aejaz UNIX for Advanced & Expert Users 3 04-30-2008 04:10 AM
grep dineshr85 Shell Programming and Scripting 1 10-10-2007 01:52 AM
how to exclude the GREP command from GREP yamsin789 UNIX for Advanced & Expert Users 2 10-04-2007 11:59 PM
Make grep -c display like grep -n? Jerrad Shell Programming and Scripting 2 08-24-2006 09:20 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-24-2006
Registered User
 

Join Date: Jan 2006
Posts: 7
ps -ef|grep help !!!!

Hi ,
I m facing a problem like the following ..

I have a script a.sh which is calling an executable B by passing some command line arguments.

During the process if I do a ps -ef|grep of the process , it will display the command line arguments( which includes the passwd ) .
it would be great if some one can help me out in hiding the command line agruments from being displayed by grepping or any shuch commands

Thanks a lot in advace

Binu
Reply With Quote
Forum Sponsor
  #2  
Old 04-24-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,699
I dont think grep or any such tools have that capability to change ps listing format.

I ran into something similiar, sometime back. Here are some possible approaches you could try.

1. Blanking out passwords i.e. argv[n]
http://groups.google.com/group/comp....7044f4b8840dd6

2. A pstat solution available on HPUX

3. setproctitle() system call available only on BSD'ish systems.

4. And the legendary hide.c from Oracle. (Check for this source code on the net. This solution is fool-proof but no hack-proof).

5. Yet another possible one is: assign the password to an env variable. Once the applications starts, exec your self by reading the values from those env variables. Ofcourse, you would need to clear the env variables.

6. Or you could pick up the setproctitle implementation for linux. I dont have the link. But here is the documentation header to that file

Code:
/*
 * setproctitle implementation for linux.
 * Stolen from sendmail 8.7.4 and bashed around by David A. Holland
 */
/*
 * Copyright (c) 1983, 1995 Eric P. Allman
 * Copyright (c) 1988, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
.
.
.
* From: @(#)conf.c	8.243 (Berkeley) 11/20/95
 */
char setproctitle_rcsid[] =
  "$Id: setproctitle.c,v 1.3 1997/05/19 12:58:15 dholland Exp $";
Check it up on the net. It is part of some ftp package.

-vino.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0