[Toybox] [PATCH] login: clear environment when -p is absent

William Djupström william at deepztream.com
Sat Mar 23 05:47:08 PDT 2019


---
 toys/other/login.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toys/other/login.c b/toys/other/login.c
index 9bd6cc95..5214b937 100644
--- a/toys/other/login.c
+++ b/toys/other/login.c
@@ -119,7 +119,7 @@ void login_main(void)
   if (fchown(tty, pwd->pw_uid, pwd->pw_gid) || fchmod(tty, 0600))
     printf("can't claim tty");
   xsetuser(pwd);
-  reset_env(pwd, FLAG(p));
+  reset_env(pwd, !FLAG(p));
 
   // Message of the day
   if ((ss = readfile("/etc/motd", 0, 0))) puts(ss);
-- 
2.21.0




More information about the Toybox mailing list