summaryrefslogtreecommitdiffstats
path: root/secure/usr.bin
diff options
context:
space:
mode:
authordds <dds@FreeBSD.org>2005-01-17 21:46:13 +0000
committerdds <dds@FreeBSD.org>2005-01-17 21:46:13 +0000
commit99025e3e583fb6d96d99b0df0c5c7eccbc19ce47 (patch)
tree8c1e02c14ea785d23fdaaffabb4e3fea247ed982 /secure/usr.bin
parent0012bc8f92834446c5d4e7779f1d5cf3c89583f2 (diff)
downloadFreeBSD-src-99025e3e583fb6d96d99b0df0c5c7eccbc19ce47.zip
FreeBSD-src-99025e3e583fb6d96d99b0df0c5c7eccbc19ce47.tar.gz
Correctly hide the command arguments.
PR: bin/76374 MFC after: 2 weeks
Diffstat (limited to 'secure/usr.bin')
-rw-r--r--secure/usr.bin/bdes/bdes.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/secure/usr.bin/bdes/bdes.c b/secure/usr.bin/bdes/bdes.c
index 8efa179..4bb1299 100644
--- a/secure/usr.bin/bdes/bdes.c
+++ b/secure/usr.bin/bdes/bdes.c
@@ -164,28 +164,15 @@ static int tobinhex(char, int);
static void usage(void);
int
-main(int ac, char *av[])
+main(int argc, char *argv[])
{
extern char *optarg; /* argument to option if any */
int i; /* counter in a for loop */
char *p; /* used to obtain the key */
DES_cblock msgbuf; /* I/O buffer */
int kflag; /* command-line encryptiooon key */
- int argc; /* the real arg count */
- char **argv; /* the real argument vector */
- /*
- * Hide the arguments from ps(1) by making private copies of them
- * and clobbering the global (visible to ps(1)) ones.
- */
- argc = ac;
- ac = 1;
- argv = malloc((argc + 1) * sizeof(char *));
- for (i = 0; i < argc; ++i) {
- argv[i] = strdup(av[i]);
- MEMZERO(av[i], strlen(av[i]));
- }
- argv[argc] = NULL;
+ setproctitle("-"); /* Hide command-line arguments */
/* initialize the initialization vctor */
MEMZERO(ivec, 8);
OpenPOWER on IntegriCloud