From nobody Mon Aug 26 15:34:42 2024 X-Original-To: bugs@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 4Wsvqk4Bwjz5T7GW for ; Mon, 26 Aug 2024 15:34:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wsvqk2h22z4r4Z for ; Mon, 26 Aug 2024 15:34:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724686482; a=rsa-sha256; cv=none; b=o3KMFWeuMwej1MEBi20yasfhnvAVAec5MHZE66cexoS7lCYE1+8CBN9WZF13V4tYkVMJu2 D5fEbeZtOOSvCERmaRQ+USi7wc6/mXZhSL7Pq0bBePOmGamJwhLQsn3xfZlMQmwtmscHxJ D9+l75nZWGphwzB27pX+PPkNRkuWVuKHzbeqLmHGeJ7d+vi8sf5LmS5Rai41uO2hq/muz8 5RGtrmgG86PvuvrJn3Pwcv77wD5RmqzQ2E1xOqhQJHhuUWa39dD7brpsYl/g7dUR9PRtl1 +E5qEiLVqUuyGAY4wyiK7eqosVFVMSMHZ149cfl1c/YClXRCRuN4HB9HAZ+3Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724686482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lsTBsUINUaGNvdYu+1bD4nkvlV0qzgDYgSyAbC6MBvw=; b=PUnXt0tKPDbmjI+4fgeR6O/dOkZDiPn5xWeMpYsRlBjS4K7z8iezsnbgbJK5KaOBWVnPme WeAy6MiILPLyXIlajD6wUAaL3Z9QU+2DYBmk+p2KEbzqphjgsd8XgVcAQ6UZ2AF+gNIQf8 GOOnP0aaRvmi90t4C/QWcXXRp7hUw+EV/rKp94KzoDQWYTUSVqr1QfDFb+BkcgF35Y/vBs FqBfDLQuxsS1pd3rqPZGt7JTGJHA2Q5nUsDGuc63zd08AQWonDrDSjRHMQLcnLTB6Xx1Rd DEa0KBkrDYgXLjXaOEz3XwCNPkM+Y2mjs5eRxbsfoS3XOzhzA0I9Lw3IB/vt8A== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wsvqk29crz1BBR for ; Mon, 26 Aug 2024 15:34:42 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 47QFYgrk049765 for ; Mon, 26 Aug 2024 15:34:42 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 47QFYgIA049764 for bugs@FreeBSD.org; Mon, 26 Aug 2024 15:34:42 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 280099] adduser not respecting home directory mode Date: Mon, 26 Aug 2024 15:34:42 +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: 14.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: kevans@freebsd.org X-Bugzilla-Status: Open 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 List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280099 --- Comment #9 from Kyle Evans --- pw(8) probably should have been doing this all along: diff --git a/usr.sbin/pw/cpdir.c b/usr.sbin/pw/cpdir.c index 504933ab88af..856ab95ee781 100644 --- a/usr.sbin/pw/cpdir.c +++ b/usr.sbin/pw/cpdir.c @@ -49,9 +49,13 @@ copymkdir(int rootfd, char const * dir, int skelfd, mode= _t mode, uid_t uid, if (*dir =3D=3D '/') dir++; - if (mkdirat(rootfd, dir, mode) !=3D 0 && errno !=3D EEXIST) { - warn("mkdir(%s)", dir); - return; + if (mkdirat(rootfd, dir, mode) !=3D 0) { + if (errno !=3D EEXIST) { + warn("mkdir(%s)", dir); + return; + } + + (void)fchmodat(rootfd, dir, mode, AT_SYMLINK_NOFOLLOW); } fchownat(rootfd, dir, uid, gid, AT_SYMLINK_NOFOLLOW); if (flags > 0) --=20 You are receiving this mail because: You are the assignee for the bug.=