]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
firstboot: don't create/modify passwd and shadow if not asked
authorafg <afg984@gmail.com>
Tue, 1 Sep 2020 21:47:49 +0000 (05:47 +0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 3 Sep 2020 07:13:47 +0000 (09:13 +0200)
src/firstboot/firstboot.c

index e3e1f9e2c8cb3566edd76c5ea07758df7448ae0c..f8499a6ffd0ce42dee8b8c4acd011b7e5107339c 100644 (file)
@@ -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);