logo

skeud

Simple and portable utilities to deal with user accounts (su, login)
commit: 3cd0077c12f93c527d13fd2016918c71e48e0e06
parent b4447dcc659626482efa2bdc0109866ac0bc0ee3
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed,  2 Nov 2022 01:37:03 +0100

login.su: Launch shell with `-l` option

Diffstat:

Mlogin.c2+-
Msu.c4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/login.c b/login.c @@ -201,7 +201,7 @@ main(int argc, char *argv[]) errno = 0; /* flawfinder: ignore CWE-78 */ - if(execl(shell, shell, NULL) < 0) + if(execl(shell, shell, "-l", NULL) < 0) { if(errno == ENOENT) { diff --git a/su.c b/su.c @@ -213,12 +213,12 @@ main(int argc, char *argv[]) if(command != NULL) { /* flawfinder: ignore CWE-78 */ - ret = execlp(shell, shell, "-c", command, NULL); + ret = execlp(shell, shell, "-l", "-c", command, NULL); } else { /* flawfinder: ignore CWE-78 */ - ret = execlp(shell, shell, NULL); + ret = execlp(shell, shell, "-l", NULL); } if(ret < 0) {