From b48db8b49ddac1be5d4c84892bec22f5615e03c7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 22 Mar 2021 07:19:52 +0100 Subject: Correction: set value of SHELL to pw_shell, rather than pw_dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you to Jonathan Frech for catching this mistake Signed-off-by: Mattias Andrée --- asroot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'asroot.c') 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; -- cgit v1.2.3-70-g09d2