From 3a45f4af53abd18d92459981aa614258a77787d3 Mon Sep 17 00:00:00 2001 From: apio Date: Tue, 11 Apr 2023 22:15:46 +0200 Subject: [PATCH] su: Change the current directory to the user's home on login --- apps/su.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/su.cpp b/apps/su.cpp index 6d25892c..8f518801 100644 --- a/apps/su.cpp +++ b/apps/su.cpp @@ -89,5 +89,7 @@ int main(int argc, char** argv) setgid(entry->pw_gid); setuid(entry->pw_uid); + chdir(entry->pw_dir); + execl(entry->pw_shell, entry->pw_shell, NULL); }