From c23e851074558337f0f21f99bcb1263b2a330b75 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Thu, 14 Jul 2011 13:29:48 +0000 Subject: [PATCH] * src/usermod.c (new_pwent): Document that pw_locate will not fail because getpwnam returned successfully. --- ChangeLog | 2 ++ src/usermod.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3f95e7a52..38b0ed30d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,8 @@ * man/usermod.8.xml: Document behavior of an empty EXPIRE_DATE. * man/usermod.8.xml: Document that the mail spool might have to be renamed (as for the homedir) + * src/usermod.c (new_pwent): Document that pw_locate will not fail + because getpwnam returned successfully. 2011-07-08 Nicolas François diff --git a/src/usermod.c b/src/usermod.c index d4bd5b160..1f3ebb76d 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -402,6 +402,10 @@ static void new_pwent (struct passwd *pwent) { if (lflg) { if (pw_locate (user_newname) != NULL) { + /* This should never happen. + * It was already checked that the user doesn't + * exist on the system. + */ fprintf (stderr, _("%s: user '%s' already exists in %s\n"), Prog, user_newname, pw_dbname ()); -- 2.47.3