Author: bapt
Date: Tue Jul 28 20:52:10 2015
New Revision: 285984
URL: https://svnweb.freebsd.org/changeset/base/285984

Log:
  Fix wrong warning printed after changing or updating NIS users
  
  PR:           37672
  Submitted by: chris+free...@chrullrich.de

Modified:
  head/usr.sbin/pw/pw_user.c

Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c  Tue Jul 28 20:42:36 2015        (r285983)
+++ head/usr.sbin/pw/pw_user.c  Tue Jul 28 20:52:10 2015        (r285984)
@@ -206,7 +206,7 @@ perform_chgpwent(const char *name, struc
                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, s
                        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 */
                }
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to