diff options
| author | Warner Losh <imp@FreeBSD.org> | 1997-08-27 05:27:53 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 1997-08-27 05:27:53 +0000 |
| commit | 3fa69daee8bd639012dbd9d6b15b9c93b4e1a79b (patch) | |
| tree | 4f4a847960ed2fea31acbd29dec336a16e801bd6 /lib/libc | |
| parent | ed550569a2b346bbaee4ad77847bc63f7f4359ea (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/gen/glob.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c index f58fd8d0a220..0c6fe5ddca04 100644 --- a/lib/libc/gen/glob.c +++ b/lib/libc/gen/glob.c @@ -358,10 +358,11 @@ globtilde(pattern, patbuf, patbuf_len, pglob) if (((char *) patbuf)[0] == EOS) { /* - * handle a plain ~ or ~/ by expanding $HOME - * first and then trying the password file + * handle a plain ~ or ~/ by expanding $HOME first (iff + * we're not running setuid or setgid) 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 |
