From owner-freebsd-questions@freebsd.org Tue Sep 3 11:46:24 2019 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42B5BD7BE4 for ; Tue, 3 Sep 2019 11:46:24 +0000 (UTC) (envelope-from per@hedeland.org) Received: from outbound1f.eu.mailhop.org (outbound1f.eu.mailhop.org [52.28.59.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46N4sq2l3Pz4F1l for ; Tue, 3 Sep 2019 11:46:22 +0000 (UTC) (envelope-from per@hedeland.org) ARC-Seal: i=1; a=rsa-sha256; t=1567511181; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=AGnKGv0ABKgX88vxZALB5QMSL+rxHsZGKRAQ5P3NsETA+Fcu7Pc13fW+Hv1v2kxZnSAmY/VyVJfQC QJMmAd0h1uQ/5LRRSrzripZqKJJWNQjHLCozPowHRMb0BqmrKcdN0pvTI+B+uGwsM71KeMTSeq3wYf bxOPyWCapPSbHWK9ODotfiWBIBWmKacxAZMOZF/b+2BhK4YLkPW0D6YfV9uw2Wx/0MRkNpMQZOlIYG //uf7S+NbDl9BKdbeZC7EzJcQtIwGMxUjn57CrNKitzbsXaSwW+JAgQgq45ezdrQyacBC+dkmrFSsc 5x7l859AQPLqr/lLTXi9XV2paH8LzqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:content-type:in-reply-to:mime-version:date: message-id:from:references:to:subject:dkim-signature:from; bh=VFOuaRaW7MqeEsIWvLM9RFJOlhhBESg5N2YocYDCSbs=; b=RnDTq4MxnCUPygycgGXbn1N1+7LxRbnBn1HyeYK1O0QpHbf1G+w/niP71D0Bg6XqnLry0ew1hZyO4 rLkQWwQsAPUCz8fwyIGzK0GPCaM8Ybt1h8eFl9UcdBQrC8RS3K/Gb8rxJHjXjB/wZ+Q2Xe1OjfD3S7 MMhxuWScripJC9/F7GNbTiirYFfGBw2F5MIwJnzJd0y8xWMSlzPrMo58YHkKhWHGA6HoUQtQ2rY2qm qA0MGsRNM9QAbnEskMfuKRP4KFxKOkZfkmE/v24MC5Fnk+PqzKNG9oHLP46VoXmqH/DRTsSYHfuk0q 5I6LXTXJ+hxMdTO4a7QXCKfIINmqZMQ== ARC-Authentication-Results: i=1; outbound2.eu.mailhop.org; spf=none smtp.mailfrom=hedeland.org smtp.remote-ip=81.228.157.209; dmarc=none header.from=hedeland.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:content-type:in-reply-to:mime-version:date: message-id:from:references:to:subject:from; bh=VFOuaRaW7MqeEsIWvLM9RFJOlhhBESg5N2YocYDCSbs=; b=pv1apVsGVgi3s+gMfM/qvjTXHUftiyvQV/fjgmaPcrREHIbGKNTXFtFOtjOCVvNIRM+75UzF6KsAk nJv/Sgers3lymgVFK5Gu+Cxin6Yqvvcy1OhsH14Cs+6Uw0yg1c6tcXNIDdyQ+sS3RO+fAGVCuj1dWm w39+710P1xKzbEEkDXwoBcIzzQUWFNx4OqX50gi5LTloWRqKDGWitqgyuVHDjxzH66YTdewg0Vn+CH MXlVBKBtO1RcApXhnxlEezY4yZA/c+kJtSjbuMeLo+X3C6W9YktvFa+HxiMqlWooNAdKUytK2zBvFG 7V8dRwGDyhbAzf0QdQarOF3QqSVDw7g== X-MHO-RoutePath: cGVyaGVkZWxhbmQ= X-MHO-User: 70c623d6-ce40-11e9-a205-f5e3bb5d0a28 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 81.228.157.209 X-Mail-Handler: DuoCircle Outbound SMTP Received: from hedeland.org (unknown [81.228.157.209]) by outbound2.eu.mailhop.org (Halon) with ESMTPSA id 70c623d6-ce40-11e9-a205-f5e3bb5d0a28; Tue, 03 Sep 2019 11:46:18 +0000 (UTC) Received: from pluto.hedeland.org (pluto.hedeland.org [10.1.1.5]) by tellus.hedeland.org (8.15.2/8.15.2) with ESMTPS id x83BkHsd063182 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 3 Sep 2019 13:46:17 +0200 (CEST) (envelope-from per@hedeland.org) Subject: Re: master.passwd out of sync To: freebsd-questions@freebsd.org References: <20190903085614.GD3644@io.chezmoi.fr> <152896fe-e1fa-6c4d-b1e4-97d13ea13539@gmail.com> From: Per Hedeland Message-ID: Date: Tue, 3 Sep 2019 13:46:17 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <152896fe-e1fa-6c4d-b1e4-97d13ea13539@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46N4sq2l3Pz4F1l X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=outbound.mailhop.org header.s=dkim-high header.b=pv1apVsG; dmarc=none; spf=none (mx1.freebsd.org: domain of per@hedeland.org has no SPF policy when checking 52.28.59.28) smtp.mailfrom=per@hedeland.org X-Spamd-Result: default: False [-5.54 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[outbound.mailhop.org:s=dkim-high]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[hedeland.org]; DKIM_TRACE(0.00)[outbound.mailhop.org:+]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; RCVD_IN_DNSWL_NONE(0.00)[28.59.28.52.list.dnswl.org : 127.0.20.0]; RECEIVED_SPAMHAUS_PBL(0.00)[209.157.228.81.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-1.26)[ipnet: 52.28.0.0/16(-4.89), asn: 16509(-1.36), country: US(-0.05)]; ASN(0.00)[asn:16509, ipnet:52.28.0.0/16, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; ARC_ALLOW(-1.00)[i=1] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Sep 2019 11:46:24 -0000 On 2019-09-03 12:01, MJ wrote: > Hi Albert, > > On 3/09/2019 6:56 pm, Albert Shih wrote: >> Hi everyone, >> >> I try to understand how the /etc/pwd.db and /etc/spwd.db are updated with /usr/sbin/pwd_mkdb. >> >> Anyone known what going to update those file ? >> >> The reason is I try to create a account with pw and sometime I got the >> message >> >> pw: user '*******' disappeared during update >> >> so I just need to do a >> >> /usr/sbin/pwd_mkdb -p /etc/master.passwd >> >> and everything work fine. >> >> But that's not seem to be normal. So I try to find if they are some cron to >> do that and didn't find anything. > > If I'm understanding you correctly, you want to know what rebuilds the master.passwd under "normal" circumstances? > > That would be vipw(8). > > Of course, you can still do as you state here and run pwd_mkdb(8) but better to use the right tool for the job. Well, the "new" pw(8) that Albert uses is just as much "the right tool" as the traditional vipw(8), and arguably more "user friendly". With vipw(8) you obviously update /etc/master.passwd yourself, while pw(8) does that for you - and both of them update /etc/passwd and the databases /etc/spwd.db and /etc/pwd.db, from /etc/master.passwd, ultimately using pwd_mkdb(8). The other difference is that vipw(8) completely re-generates /etc/passwd and the databases, while pw(8) updates only the specific user entry (the -u option is passed to pwd_mkdb(8)). Apparently it's this single user entry update that is failing - or at least the getpwnam() check for the added user that pw(8) does fails - vipw(8) (or pwdb(8) without -u) doesn't do any such check, since they update "everything". Anyway Albert, you obviously "shouldn't" get that error message from pw(8), and you "shouldn't" need to run pwd_mkdb(8) yourself after using pw(8). Are you running NIS? And if so, do you use the -Y option to pw(8)? Since you say that you only get the problem "sometimes", one *guess* is that NIS may not be updated (yet) at the point when pw(8) does the getpwnam() check. *If* that is the case, running pwd_mkdb(8) surely won't help - but the passing of time may fix it... --Per > Remember to set your EDITOR so vipw can use your preferred one. > >> Regards >> >> -- >> Albert SHIH >> Observatoire de Paris >> xmpp: jas@obspm.fr >> Heure local/Local time: >> Tue 03 Sep 2019 10:51:35 AM CEST >> _______________________________________________ >> freebsd-questions@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-questions >> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >> > > > Regards, > Mark > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"