diff options
author | Denys Vlasenko | 2022-03-01 10:08:59 +0100 |
---|---|---|
committer | Denys Vlasenko | 2022-03-01 10:10:22 +0100 |
commit | 5fe20cf3212fbada86fb75cf13064caed6a5f3a9 (patch) | |
tree | d19fb9ccf186b4cfa0706abeb177df0a10760a21 | |
parent | 7750b5a25a8cf9081b7c248687c876d0068e85bb (diff) | |
download | busybox-5fe20cf3212fbada86fb75cf13064caed6a5f3a9.zip busybox-5fe20cf3212fbada86fb75cf13064caed6a5f3a9.tar.gz |
ash: do not truncate failed tilde expansion on unknown user names
Do not skip over "*p = c;" statement.
Testcase: echo ~~nouser/qwe
function old new delta
argstr 1396 1406 +10
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/ash.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index 44ec2ea..ef4a47a 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -6532,9 +6532,7 @@ exptilde(char *startp, int flag) home = lookupvar("HOME"); } else { pw = getpwnam(name); - if (pw == NULL) - goto lose; - home = pw->pw_dir; + home = pw ? pw->pw_dir : NULL; } *p = c; if (!home) |