https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227541

            Bug ID: 227541
           Summary: 'pw userdel' probrem with NIS Master
           Product: Base System
           Version: 11.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: b...@freebsd.org
          Reporter: hsak...@tsnr.com

Hello,

I setup a FreeBSD box as NIS master. The 'useradd' and 'usermod' options of the
'pw' command work fine, but there are two problems with the 'userdel' option.

1. 'pw userdel' always fail with error:
pw: pw_copy(): No such file or directory

Because "GETPWNAM(user)" at line 102 of pwdupd.c seems to have destroyed the
'pwd' global variable. 

2. 'pw userdel' does not update "NIS maps" with '-Y' option.


Workaround patch for 11-STABLE:

diff -u pw_user.c.orig pw_user.c
--- pw_user.c.orig      2018-04-16 14:26:59.461462000 +0900
+++ pw_user.c   2018-04-16 14:27:21.843681000 +0900
@@ -963,7 +963,7 @@
        else
                grname[0] = '\0';

-       rc = delpwent(pwd);
+       rc = delpwent(nis ? pw_dup(pwd) : pwd);
        if (rc == -1)
                err(EX_IOERR, "user '%s' does not exist", pwd->pw_name);
        else if (rc != 0)
@@ -1024,6 +1024,9 @@
                     "completely ");
        }

+       if (nis && nis_update() == 0)
+               pw_log(cnf, M_ADD, W_USER, "NIS maps updated");
+
        return (EXIT_SUCCESS);
 }

Thank you.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to