summaryrefslogtreecommitdiffstats
path: root/src/firstboot
diff options
context:
space:
mode:
authorafg <afg984@gmail.com>2020-09-01 23:47:49 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-09-03 09:13:47 +0200
commit67d5d9d5cef9f55a5bd1be4009400f682a6e569b (patch)
treea3b8cbf161ed7db2ef2d011165189f3bc479c357 /src/firstboot
parenthomed: remember the secret even when the for_state is FIXATING_FOR_ACQUIRE (diff)
downloadsystemd-67d5d9d5cef9f55a5bd1be4009400f682a6e569b.tar.xz
systemd-67d5d9d5cef9f55a5bd1be4009400f682a6e569b.zip
firstboot: don't create/modify passwd and shadow if not asked
Diffstat (limited to 'src/firstboot')
-rw-r--r--src/firstboot/firstboot.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
index e3e1f9e2c8..f8499a6ffd 100644
--- a/src/firstboot/firstboot.c
+++ b/src/firstboot/firstboot.c
@@ -815,6 +815,10 @@ static int process_root_args(void) {
* files. */
if ((laccess(etc_passwd, F_OK) >= 0 || laccess(etc_shadow, F_OK) >= 0) && !arg_force)
return 0;
+ /* Don't create/modify passwd and shadow if not asked */
+ if (!(arg_root_password || arg_prompt_root_password || arg_copy_root_password || arg_delete_root_password ||
+ arg_root_shell || arg_prompt_root_shell || arg_copy_root_shell))
+ return 0;
(void) mkdir_parents(etc_passwd, 0755);