From: afg Date: Tue, 1 Sep 2020 21:47:49 +0000 (+0800) Subject: firstboot: don't create/modify passwd and shadow if not asked X-Git-Tag: v247-rc1~308 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=67d5d9d5cef9f55a5bd1be4009400f682a6e569b;p=thirdparty%2Fsystemd.git firstboot: don't create/modify passwd and shadow if not asked --- diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index e3e1f9e2c8c..f8499a6ffd0 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);