From nobody Mon May 06 16:19:23 2024 X-Original-To: dev-commits-src-all@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 4VY670134hz5KWYJ; Mon, 06 May 2024 16:19:24 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VY66z70mMz4ZkW; Mon, 6 May 2024 16:19:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715012364; 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; bh=WTngl1O7dkyFyP22v4Gk9eMpN9UbJUnFdLaAk9XTrDo=; b=IVwkbOo9gyM4ewGq/ohM0QsTgDbCMpIRtoxFSAopkunvvl1Xyui6nlrw0DEGHH/Nz+my1A XgOEHlmDaJTVcOdR30w6H7zMKG6pgYqhMe5cyQ2A/KCKIUnqNJgPfiiiIjkQSCNOGp8yOi gQgg+oNAYUCvtuPm1BG4bdT5A3P1Y9B5O34amkRlJEqREUe2VQNEkhwxA9Re3LF8/BDdoO w/BnOApzGBptHO4lMnNqQukD8lTzHUyxoR/od7LjV+VaQ1YRoBJtinX4jJa+69mwp6v/VH cdDaODvVg4RluC/aO8NPV1mMz6kEMbEPAgqG0lNrHmkrBxfKf5B1vEs10vfGlQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715012364; a=rsa-sha256; cv=none; b=uDiYVexi/IQN3AOChyss5d6y4So43YUiaUpXRRNlc20GfmqJkJeKe0LpH7XfzZmsGJ2L6B 07pTqw3Dyx9VJ5RhI9l1+8yeR58jxUxvQW5OJNmhHFaopr0AbN4BO3unD5HVwYAIhCfBtl BDcL/COUFiX4RiQt4Aez5b+5K9r5FEF1tx1oxO6MttAAlrLF7Ayp78VobQbTBQwsM+iar1 y7S7PkyFGGRKaroUsAF3K8jeERWRpTm5A0XNf8WDjpqcehVnCpFbJ9SJJFUAnVPHN9FL2+ yK1Q5jFS3bBpy2Rdd7i0AbjEpPAG/lDkCIw+RqYkG9MBuA3sw07tTmJKfViozQ== 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=1715012364; 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; bh=WTngl1O7dkyFyP22v4Gk9eMpN9UbJUnFdLaAk9XTrDo=; b=c0PTsbdSkAHVoJogBWMlHhWPrwHaCOCvgkr+ggEmGldg04lOpOe+y86v2/pAfcOSzDldeT m+S2X8fK+pdf+PPEAhWObxZ1K27sZ9Erx8gCWYHuk9dk7Xj5Jlch9OY2lyOU3wRQTgAEuf a6y1BIug1AqlPWEnbQ1MgARNwuiFeo8yPjAqRh7h/tjH8RkuSSkkpv7B/JfDuntU14R9Tc Nbcvab0jqgVmXYEeJv+3WanNwh2n3+BYO4MNXBC8sJyOglNkGyr2rlb+vkHIemASz2T/H3 9s0Fy4Pukwx5GGFsQD5abbpGURqNeBwtpZM8qAKmRs7igc+eILBpX9ceZVGGIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4VY66z6cTrz13qP; Mon, 6 May 2024 16:19:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 446GJNMo022862; Mon, 6 May 2024 16:19:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 446GJNjk022859; Mon, 6 May 2024 16:19:23 GMT (envelope-from git) Date: Mon, 6 May 2024 16:19:23 GMT Message-Id: <202405061619.446GJNjk022859@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: e12b7446bddc - main - pw: Test home directory ownership and mode. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e12b7446bddcb91b869abef6048910cc15185a33 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e12b7446bddcb91b869abef6048910cc15185a33 commit e12b7446bddcb91b869abef6048910cc15185a33 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-06 16:18:50 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-06 16:18:50 +0000 pw: Test home directory ownership and mode. MFC after: 3 days Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45099 --- usr.sbin/pw/tests/pw_useradd_test.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/usr.sbin/pw/tests/pw_useradd_test.sh b/usr.sbin/pw/tests/pw_useradd_test.sh index 3b495482eb05..b4efa42bada7 100755 --- a/usr.sbin/pw/tests/pw_useradd_test.sh +++ b/usr.sbin/pw/tests/pw_useradd_test.sh @@ -313,6 +313,22 @@ user_add_R_intermed_body() { test -d ${HOME}/a/b/c/foo || atf_fail "user directory not created" } +atf_test_case user_add_dir +user_add_dir_body() { + populate_root_etc_skel + + atf_check -s exit:0 ${RPW} useradd foo -M 0705 -m + atf_check grep -q '^foo:' $HOME/etc/master.passwd + atf_check test -d ${HOME}/home/foo + atf_check -o save:ugid \ + awk -F: '$1 == "foo" { print $3, $4 }' \ + $HOME/etc/master.passwd + atf_check -o file:ugid \ + stat -f '%u %g' ${HOME}/home/foo + atf_check -o inline:"40705\n" \ + stat -f '%p' ${HOME}/home/foo +} + atf_test_case user_add_skel user_add_skel_body() { populate_root_etc_skel @@ -511,6 +527,7 @@ atf_init_test_cases() { atf_add_test_case user_add_R atf_add_test_case user_add_R_no_symlink atf_add_test_case user_add_R_intermed + atf_add_test_case user_add_dir atf_add_test_case user_add_skel atf_add_test_case user_add_uid0 atf_add_test_case user_add_uid_too_large