commit a58934336e70a53249c696953aa272b314f622c6
parent f9de7ffa7bc2e42b98912b06c6bdc98a2e43385a
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date: Tue, 26 Jul 2022 21:54:34 +0200
zsh as a root shell
Diffstat:
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/postinstall.aat b/postinstall.aat
@@ -96,7 +96,8 @@ CN # Managed by /usr/src/core-system
|line_append_file("sshd:x", ":22:", "", "^[^:]*:[^:]*")
/etc/passwd f +
-!f sed -Ee 's|^(root:.*:)[^:]|/bin/zsh|'
+?i grep -q '^root:.*:/bin/zsh$'
+!f sed -Ee 's|^(root:.*:)[^:]*$|\1/bin/zsh|'
|passwd_user("sshd:x:22:22:server privilege separation,,,:/home/sshd:/sbin/nologin")
|shadow_user("sshd:!:10000::::::")
diff --git a/postinstall.fileset b/postinstall.fileset
@@ -45,7 +45,8 @@ CN # Managed by /usr/src/core-system
fi
/etc/passwd f +
-!f sed -Ee 's|^(root:.*:)[^:]|/bin/zsh|'
+?i grep -q '^root:.*:/bin/zsh$'
+!f sed -Ee 's|^(root:.*:)[^:]*$|\1/bin/zsh|'
/etc/passwd f +
!f awk 'BEGIN { FS=OFS=":"; seen=0; line="sshd:x:22:22:server privilege separation,,,:/home/sshd:/sbin/nologin"; split(line, a) }
{ uids[$3] = $0 }