Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Apr 2018 04:53:45 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 227541] pw(8): fix 'pw userdel' problem with NIS Master
Message-ID:  <bug-227541-227-8l2TcMll3H@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-227541-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-227541-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227541

--- Comment #1 from hsakamt@tsnr.com ---
Sorry, my patch was incomplete and failed without '-Y' option. The 'pwd' al=
ways
need to be duplicated.

patch:
--- pw_user.c.orig      2018-04-16 14:26:59.461462000 +0900
+++ pw_user.c   2018-04-19 13:16:14.015451000 +0900
@@ -963,7 +963,7 @@
        else
                grname[0] =3D '\0';

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

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



# grep passwd /etc/nsswitch.conf=20
passwd: compat
passwd_compat: nis

And I add '+:::::::::' line in /etc/master.passwd


original 'pw':
# pw useradd test -Y                          (OK)
NIS Map update started ...
# pw userdel test01 -Y                        (NG)
pw: pw_copy(): No such file or directory
# pw useradd test                             (OK)
# pw userdel test                             (NG)
pw: pw_copy(): No such file or directory

my old patched 'pw':
# ./pw useradd test01 -Y                      (OK)
NIS Map update started ...
# ./pw userdel test01 -Y                      (OK)
NIS Map update started ...
# ./pw useradd test01                         (OK)
# ./pw userdel test01                         (NG)
pw: pw_copy(): No such file or directory

new patched 'pw':
# ./pw.new useradd test01 -Y                  (OK)
NIS Map update started ...
# ./pw.new userdel test01 -Y                  (OK)
NIS Map update started on ...
# ./pw.new useradd test01                     (OK)
# ./pw.new userdel test01                     (OK)

Thank you.

--=20
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-8l2TcMll3H>