From owner-freebsd-pkg@freebsd.org Tue Apr 11 09:19:30 2017 Return-Path: Delivered-To: freebsd-pkg@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3037ED390F9 for ; Tue, 11 Apr 2017 09:19:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 1971A6A7 for ; Tue, 11 Apr 2017 09:19:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 15F15D390F8; Tue, 11 Apr 2017 09:19:30 +0000 (UTC) Delivered-To: pkg@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 159A0D390F7 for ; Tue, 11 Apr 2017 09:19:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id EED496A6 for ; Tue, 11 Apr 2017 09:19:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v3B9JTdF001068 for ; Tue, 11 Apr 2017 09:19:29 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: pkg@FreeBSD.org Subject: [Bug 211141] ports-mgmt/pkg: pkg+pw: Doesn't run pwd_mkdb, maybe other problems Date: Tue, 11 Apr 2017 09:19:29 +0000 X-Bugzilla-Reason: CC AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: needs-qa X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: loader@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: pkg@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? merge-quarterly? X-Bugzilla-Changed-Fields: cc 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-pkg@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Apr 2017 09:19:30 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211141 Fukang Chen changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |loader@FreeBSD.org --- Comment #9 from Fukang Chen --- Short answer: /etc/master.passwd contains a new user _ypldap which wasn't added into /etc/pwd.db during the upgrade to 11.0. How to repeat: # svnlite cat svn://svn.freebsd.org/base/release/10.3.0/etc/master.passwd > /etc/master.passwd # pwd_mkdb -p master.passwd # svnlite cat svn://svn.freebsd.org/base/release/11.0.1/etc/master.passwd > /etc/master.passwd # pw useradd _tss -u 601 -g 601 -L daemon -c "TrouSerS user" -d /var/empty = -s /usr/sbin/nologin pw: user '_tss' disappeared during update Why getpwnam(3) can't find the user '_tss' in /etc/pwd.db? There are three copies of the original data in /etc/pwd.db, - key pw_name field prepended by the _PW_KEYBYNAME - key pw_uid field prepended by the _PW_KEYBYUID - key line number in the original file prepended by the _PW_KEYBYNUM and getpwnam(3) searches the database using the thrid key: line number https://svnweb.freebsd.org/base/release/11.0.1/lib/libc/gen/getpwent.c?view= =3Dmarkup#l1842 10.3 /etc/master.passwd 23 hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin 24 nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nolo= gin 10.3 /etc/pwd.db B htonl(23) =3D> hast B htonl(24) =3D> nobody when running "pw useradd _tss -u" on 11.0, pwd_mkdb(8) inserts the '_tss' user with the current line number as the key 11.0 /etc/master.passwd: 23 _ypldap:*:160:160::0:0:YP LDAP unprivileged user:/var/empty:/usr/sbin/nologin 24 hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin 25 nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nolo= gin 26 _tss:*:601:601:daemon:0:0:TrouSerS user:/var/empty:/usr/sbin/nologin 11.0 /etc/pwd.db B htonl(23) =3D> hast B htonl(24) =3D> nobody B htonl(26) =3D> _tss getpwnam(3) stopped after it tried to fetch the key 'B htonl(25)' :P https://svnweb.freebsd.org/base/release/11.0.1/lib/libc/gen/getpwent.c?view= =3Dmarkup#l1858 --=20 You are receiving this mail because: You are on the CC list for the bug. You are the assignee for the bug.=