]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sysusers: fix argument confusion in error message
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 13 Oct 2022 12:51:28 +0000 (14:51 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 23 May 2023 13:09:39 +0000 (15:09 +0200)
Bug introduced in 335f6ab4f13abcd8073fe84f2a3c70c67271126e. pw/sp are totally
wrong in this context, most likely NULL.

src/sysusers/sysusers.c

index c16cff35a26bfa857339fc8271653471841c581c..5aaaf609b2cd2b95f93db265d5916c3291107629 100644 (file)
@@ -511,7 +511,7 @@ static int write_temporary_passwd(const char *passwd_path, FILE **ret_tmpfile, c
                 r = putpwent_sane(&n, passwd);
                 if (r < 0)
                         return log_debug_errno(r, "Failed to add new user \"%s\" to temporary passwd file: %m",
-                                               pw->pw_name);
+                                               i->name);
         }
 
         /* Append the remaining NIS entries if any */
@@ -645,7 +645,7 @@ static int write_temporary_shadow(const char *shadow_path, FILE **ret_tmpfile, c
                 r = putspent_sane(&n, shadow);
                 if (r < 0)
                         return log_debug_errno(r, "Failed to add new user \"%s\" to temporary shadow file: %m",
-                                               sp->sp_namp);
+                                               i->name);
         }
 
         /* Append the remaining NIS entries if any */