From owner-freebsd-stable@freebsd.org Thu Aug 22 01:22:53 2019 Return-Path: Delivered-To: freebsd-stable@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 9DF01D9DE1 for ; Thu, 22 Aug 2019 01:22:53 +0000 (UTC) (envelope-from tom@samplonius.org) Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DRbv3Z9cz3M2Q for ; Thu, 22 Aug 2019 01:22:51 +0000 (UTC) (envelope-from tom@samplonius.org) Received: by mail-pl1-x634.google.com with SMTP id m9so2367446pls.8 for ; Wed, 21 Aug 2019 18:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samplonius-org.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=az8O0oJYr0RySAKKm7Q29w7iGzYQwuuRipzKgffS4Mk=; b=JBZ0x8k74/VmIdlKKS7RrTnqsFP3/EZ/M59d3yY6jfbV9sSpLX7TAfM830aFoj2Bdo pAAjPN+NsJNqgRWI2YTf9C7rvC/7gmSlo9EAPhJ9ALJpZkHRjbXfWN6jOL6D6vsdyIt6 cmS4UXkWlSX5JDEdY2YSaMlR8mZItCeHiX3ck7tpuODH/o95R3zkuukkO8aYCVTZCFW5 m6VzwtKYpsfCRGPmULmjVDkpADqn5BGU/srL5iBoYRGP4hIEaOlXm7lC7yfvXW1b8im0 7OOOR5wcaMJqeGwTxr2QcnSNVG+DN8RYlpJ5C1FxQxektZb0usdqHOKdtzaBheE+HrAW AMWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=az8O0oJYr0RySAKKm7Q29w7iGzYQwuuRipzKgffS4Mk=; b=fzL75jNcBbA4eEJLCdLyBiRxeyfDwexmey9iKBSiVdD166G+IrapQV+6jIAQDl9QT1 807kWOsFCr/mdJtJ5pS0rKsGTScp3988x2BjNWlm0CftZQcfnK2WmZ/vNkM0ysU+T2/A SSUWLtCvfV3a6Jl/gIDvgND4kFuJfmtKLz8wJFCHRVgpKAfgBWt9tGjgmJ94jgUPFhxK +9/yHcsdqFIESIAB3q5CwDZUWMCQQwGIZlMsbyFXttSYdD3MlUp7jthrBphmyGQTCs7F XPHL97wXIDtEYpjIWRBLY9Qd38OFaet14tIR9HQelShJHu/7qqzTmLiySvI+VqYj0Kin LMhA== X-Gm-Message-State: APjAAAXW9fH6p4D78RutJLPBsz6T5cOTrQIoz/bETuesQLNAeYO8PlWN 8FE37ErLMunf0Dp2qk0o4crYR4xOls0= X-Google-Smtp-Source: APXvYqyuGaJJSbkqt3AALEeQtzJjMIcssMIwy/KauIpz9Dqmh0oL5v6xbaZCCtmaCzXdn6HQvWeEbQ== X-Received: by 2002:a17:902:aa93:: with SMTP id d19mr37370751plr.148.1566436969387; Wed, 21 Aug 2019 18:22:49 -0700 (PDT) Received: from [10.226.61.252] ([24.244.23.25]) by smtp.gmail.com with ESMTPSA id i9sm35766201pgo.46.2019.08.21.18.22.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Aug 2019 18:22:48 -0700 (PDT) From: Tom Samplonius Message-Id: <208B5647-9D41-4F0E-9111-32CBFF8491D1@samplonius.org> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: chsh corrupts /etc/pwd.db Date: Wed, 21 Aug 2019 18:22:46 -0700 In-Reply-To: Cc: FreeBSD To: Alan Somers References: X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 46DRbv3Z9cz3M2Q X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=samplonius-org.20150623.gappssmtp.com header.s=20150623 header.b=JBZ0x8k7; dmarc=none; spf=none (mx1.freebsd.org: domain of tom@samplonius.org has no SPF policy when checking 2607:f8b0:4864:20::634) smtp.mailfrom=tom@samplonius.org X-Spamd-Result: default: False [-5.62 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[samplonius-org.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; MV_CASE(0.50)[]; IP_SCORE(-2.83)[ip: (-8.83), ipnet: 2607:f8b0::/32(-2.90), asn: 15169(-2.35), country: US(-0.05)]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-stable@freebsd.org]; DMARC_NA(0.00)[samplonius.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[samplonius-org.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[4.3.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.994,0]; R_SPF_NA(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[25.23.244.24.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2019 01:22:53 -0000 > On Aug 21, 2019, at 2:55 PM, Alan Somers wrote: >=20 > Today I tried to use chsh to change my shell from bash to fish. The > command completed successfully, but new logins continued to use bash! > Investigating, I discovered that /etc/pwd.db and /etc/spwd.db seem to > contain 3-4 entries per user. One of those still refers to my old Berkeley DB files can only have a single index, so users are stored = three times, once by username, once by uid, and once by line number. So = that isn=E2=80=99t corruption. > shell. Worse, if I try using chsh again, it fails with an "entry > inconsistent" error, and I have to restore the password files from > backup. Has anybody seen something like this before? This is just a > single system, with no NIS or LDAP. You shouldn=E2=80=99t need to restore the files. You should be able = to just regenerate the *.db files from the master.passwd file: /usr/sbin/pwd_mkdb -p /etc/master.passwd Unless, of course your master.passwd file was damaged. But the *.db = files are really just caches for faster access to user data. The real = master file is master.passwd. The ch* tools typically just change master.passwd, and then call = pwd_mkdb to rebuild the *.db files. =20 Tom=