diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-09-11 19:22:47 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-09-11 19:22:47 +0000 |
commit | 89f6228ea51ab0caeb2f019af7d9a8ed1ef6738b (patch) | |
tree | f0f9051aa356ccc131090aedb2ed5b23eaf5b91b | |
parent | f09f4c6aa02ea4012faa8491d629b9c8c3b77c71 (diff) |
protect $HOME expansion; from das33@cornell.edu
-rw-r--r-- | lib/libc/gen/glob.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c index 9f43dc306c7..057a17343cc 100644 --- a/lib/libc/gen/glob.c +++ b/lib/libc/gen/glob.c @@ -35,7 +35,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: glob.c,v 1.2 1996/08/19 08:24:20 tholo Exp $"; +static char rcsid[] = "$OpenBSD: glob.c,v 1.3 1996/09/11 19:22:46 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -355,7 +355,7 @@ globtilde(pattern, patbuf, pglob) * handle a plain ~ or ~/ by expanding $HOME * first and then trying the password file */ - if ((h = getenv("HOME")) == NULL) { + if (issetugid() != 0 || (h = getenv("HOME")) == NULL) { if ((pwd = getpwuid(getuid())) == NULL) return pattern; else |