diff options
author | jhb <jhb@FreeBSD.org> | 1999-11-13 00:11:50 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 1999-11-13 00:11:50 +0000 |
commit | cf1ce520a4c86c0221114f9f58890eca22483603 (patch) | |
tree | 4c38868b37bcd8e833230a888bbc2f7be0583b2e /gnu | |
parent | 8c06f203f55b829fd1a5e49423bb9b1ce9f6a126 (diff) | |
download | FreeBSD-src-cf1ce520a4c86c0221114f9f58890eca22483603.zip FreeBSD-src-cf1ce520a4c86c0221114f9f58890eca22483603.tar.gz |
Fix man so that it does not allow command line arguments to expand when
executing apropos or whatis. This prevents `man -k ';echo foo'` from
executing `echo foo` and causes apropos to print an error message instead.
Add $FreeBSD$ while I am here.
Noticed by: chris
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/man/man/man.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gnu/usr.bin/man/man/man.c b/gnu/usr.bin/man/man/man.c index 800a585..8120134 100644 --- a/gnu/usr.bin/man/man/man.c +++ b/gnu/usr.bin/man/man/man.c @@ -12,6 +12,8 @@ * Department of Chemical Engineering * The University of Texas at Austin * Austin, Texas 78712 + * + * $FreeBSD$ */ #define MAN_MAIN @@ -582,12 +584,12 @@ do_apropos (name) register int len; register char *command; - len = strlen (APROPOS) + strlen (name) + 2; + len = strlen (APROPOS) + strlen (name) + 4; if ((command = (char *) malloc(len)) == NULL) gripe_alloc (len, "command"); - sprintf (command, "%s %s", APROPOS, name); + sprintf (command, "%s \"%s\"", APROPOS, name); (void) do_system_command (command); @@ -604,12 +606,12 @@ do_whatis (name) register int len; register char *command; - len = strlen (WHATIS) + strlen (name) + 2; + len = strlen (WHATIS) + strlen (name) + 4; if ((command = (char *) malloc(len)) == NULL) gripe_alloc (len, "command"); - sprintf (command, "%s %s", WHATIS, name); + sprintf (command, "%s \"%s\"", WHATIS, name); (void) do_system_command (command); |