diff options
author | Mattias Andrée <maandree@kth.se> | 2021-03-22 07:19:52 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-03-22 07:19:52 +0100 |
commit | b48db8b49ddac1be5d4c84892bec22f5615e03c7 (patch) | |
tree | 1c9f7cc09a98e00b2366fdbbc24c837ff945f756 | |
parent | Fix typo (diff) | |
download | asroot-b48db8b49ddac1be5d4c84892bec22f5615e03c7.tar.gz asroot-b48db8b49ddac1be5d4c84892bec22f5615e03c7.tar.bz2 asroot-b48db8b49ddac1be5d4c84892bec22f5615e03c7.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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |