]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
Fix wrong warning printed after changing or updating NIS users
authorBaptiste Daroussin <bapt@FreeBSD.org>
Tue, 28 Jul 2015 20:52:10 +0000 (20:52 +0000)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Tue, 28 Jul 2015 20:52:10 +0000 (20:52 +0000)
PR: 37672
Submitted by: chris+freebsd@chrullrich.de

pw/pw_user.c

index d6dad3f3c52b7ea121826a2c704633362301c882..aecc90aa174a3ca275df2c8c6b10ee989b16edfc 100644 (file)
@@ -206,7 +206,7 @@ perform_chgpwent(const char *name, struct passwd *pwd)
                rc = chgnispwent(conf.userconf->nispasswd, name, pwd);
                if (rc == -1)
                        warn("User '%s' not found in NIS passwd", pwd->pw_name);
-               else
+               else if (rc != 0)
                        warn("NIS passwd update");
                /* NOTE: NIS-only update errors are not fatal */
        }
@@ -678,7 +678,7 @@ pw_user(int mode, char *name, long id, struct cargs * args)
                        rc = addnispwent(cnf->nispasswd, pwd);
                        if (rc == -1)
                                warnx("User '%s' already exists in NIS passwd", pwd->pw_name);
-                       else
+                       else if (rc != 0)
                                warn("NIS passwd update");
                        /* NOTE: we treat NIS-only update errors as non-fatal */
                }