aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-03-22 07:19:52 +0100
committerMattias Andrée <maandree@kth.se>2021-03-22 07:19:52 +0100
commitb48db8b49ddac1be5d4c84892bec22f5615e03c7 (patch)
tree1c9f7cc09a98e00b2366fdbbc24c837ff945f756
parentFix typo (diff)
downloadasroot-1.1.2.tar.gz
asroot-1.1.2.tar.bz2
asroot-1.1.2.tar.xz
Correction: set value of SHELL to pw_shell, rather than pw_dir1.1.2
Thank you to Jonathan Frech for catching this mistake Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--asroot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/asroot.c b/asroot.c
index a07e2b1..be28d13 100644
--- a/asroot.c
+++ b/asroot.c
@@ -161,12 +161,12 @@ set_environ(void)
stpcpy(stpcpy(new_environ[n++], "MAIL=/var/spool/mail/"), pw->pw_name);
}
if (pw->pw_shell && *pw->pw_shell) {
- len = strlen(pw->pw_dir);
+ len = strlen(pw->pw_shell);
len += sizeof("SHELL=");
new_environ[n] = malloc(len);
if (!new_environ[n])
fprintf(stderr, "%s: malloc %zu: %s\n", argv0, len, strerror(errno));
- stpcpy(stpcpy(new_environ[n++], "SHELL="), pw->pw_dir);
+ stpcpy(stpcpy(new_environ[n++], "SHELL="), pw->pw_shell);
}
new_environ[n] = NULL;