]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/firstboot/firstboot.c
firstboot: don't create/modify passwd and shadow if not asked
[thirdparty/systemd.git] / 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);