From owner-freebsd-bugs@freebsd.org Thu Apr 19 04:53:47 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03AA8FA8FCF for ; Thu, 19 Apr 2018 04:53:47 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 732CA84D79 for ; Thu, 19 Apr 2018 04:53:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 32B4CFA8FCE; Thu, 19 Apr 2018 04:53:46 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 104E6FA8FCD for ; Thu, 19 Apr 2018 04:53:46 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3CF284D70 for ; Thu, 19 Apr 2018 04:53:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 010CD17600 for ; Thu, 19 Apr 2018 04:53:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w3J4ripQ035942 for ; Thu, 19 Apr 2018 04:53:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w3J4rih5035941 for bugs@FreeBSD.org; Thu, 19 Apr 2018 04:53:44 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 227541] pw(8): fix 'pw userdel' problem with NIS Master Date: Thu, 19 Apr 2018 04:53:45 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.1-STABLE X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: hsakamt@tsnr.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 04:53:47 -0000 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.=