From nobody Mon Jan 30 03:33:40 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P4v0l6cNHz3c9lS for ; Mon, 30 Jan 2023 03:33:43 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P4v0l0T5wz4LD3 for ; Mon, 30 Jan 2023 03:33:43 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com; dmarc=none Received: by mail-wm1-f51.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so9116657wma.1 for ; Sun, 29 Jan 2023 19:33:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lAQIYoNUdStkU53gJLwt4+ZRs0BkHrrNREUMRh0UjWU=; b=duHaTwiZ41ZCHZxaPMMOkqg9JkphJuLDgsfBzX2T7YGbMfYSFAV4tLposyS3wNjRZ+ XUwMIUwm+h2HxQ/bj0diiL71x2QRdfvQWMlEaWZjt4B8v6i/BNbFulIlF5qm8PuiOfHX +X14EvVNMP970Qlg/a7d3R33WrnEQoyc1sMAFsfq/oUt2qdnsUylUuWd96RhzsoWxVY8 OIEUhl7kTyyAJSIpjw2UhhfZzeE1UWPRXsdnIaUD9BLAVknafwcMO9NMAxP5m5sRuWKk xlO4e6ERYqGWudFST9vDmXPiAnpqP62g4/dNAadhFpB2/1DLlVFFWnRrclKL7rfkTDAB 3JqA== X-Gm-Message-State: AFqh2kpJ6Zi3Z9OWP9CRHbevgqAeEw32vzFaYBoPtYU+syDP8gkcMNTh 2JKHd1aiyPnAwYWz3t8xI4Xf0A== X-Google-Smtp-Source: AMrXdXvh8oac0KkuRBAZ4Qe1XbD4FUU/0ZAjyYJqCNMOFzMEJrOjtB4FvxByX8L+lIko0R0sHJO3rg== X-Received: by 2002:a05:600c:444b:b0:3da:fd06:a6f1 with SMTP id v11-20020a05600c444b00b003dafd06a6f1mr46489205wmn.31.1675049621702; Sun, 29 Jan 2023 19:33:41 -0800 (PST) Received: from smtpclient.apple (global-5-143.n-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id l16-20020a7bc350000000b003d9aa76dc6asm17374740wmj.0.2023.01.29.19.33.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Jan 2023 19:33:41 -0800 (PST) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: 0deb25bd9d6d - main - pwd_mkdb(8): Don't copy comments from /etc/master.passwd to /etc/passwd. From: Jessica Clarke In-Reply-To: <202301050648.3056mfrp075362@gitrepo.freebsd.org> Date: Mon, 30 Jan 2023 03:33:40 +0000 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202301050648.3056mfrp075362@gitrepo.freebsd.org> To: Xin LI X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spamd-Result: default: False [-2.48 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.98)[-0.977]; MV_CASE(0.50)[]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_THREE(0.00)[4]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_DN_EQ_ADDR_SOME(0.00)[]; DMARC_NA(0.00)[freebsd.org]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.51:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.51:from] X-Rspamd-Queue-Id: 4P4v0l0T5wz4LD3 X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On 5 Jan 2023, at 06:48, Xin LI wrote: >=20 > The branch main has been updated by delphij: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D0deb25bd9d6d2cdd4aa22f0e2754161e= 35f3785c >=20 > commit 0deb25bd9d6d2cdd4aa22f0e2754161e35f3785c > Author: Andre Albsmeier > AuthorDate: 2010-03-11 10:53:47 +0000 > Commit: Xin LI > CommitDate: 2023-01-05 06:18:09 +0000 >=20 > pwd_mkdb(8): Don't copy comments from /etc/master.passwd to = /etc/passwd. >=20 > The intention of /etc/passwd was to support legacy applications = that are > not yet converted to use modern API like getpwent(3). Comments are = not > defined in the legacy format, so copying them could break these > applications. Plus, it could leak sensitive information (e.g. = encrypted > form of password of an user that was commented out instead of = deleted > or disabled). This broke usr.sbin/etcupdate/tests/preworld_test.sh. Jess > PR: bin/144652 > MFC after: 1 month > --- > usr.sbin/pwd_mkdb/pwd_mkdb.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) >=20 > diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c = b/usr.sbin/pwd_mkdb/pwd_mkdb.c > index 6297bcb461db..261e7951a126 100644 > --- a/usr.sbin/pwd_mkdb/pwd_mkdb.c > +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c > @@ -462,11 +462,14 @@ main(int argc, char *argv[]) > error("put"); > } > } > - /* Create original format password file entry */ > - if (is_comment && makeold){ /* copy comments */ > - if (fprintf(oldfp, "%s\n", line) < 0) > - error("write old"); > - } else if (makeold) { > + /* > + * Create original style password file entry. > + * > + * Don't copy comments since this could reveal encrypted > + * passwords if entries have been simply commented out > + * in master.passwd. > + */ > + if (makeold && !is_comment) { > char uidstr[20]; > char gidstr[20]; >=20