Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Apr 2018 06:04:50 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 227541] 'pw userdel' probrem with NIS Master
Message-ID:  <bug-227541-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help

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: bugs@FreeBSD.org
          Reporter: hsakamt@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.


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-227541-227>