# HG changeset patch # User Arun Kulshreshtha # Date 2024-01-04 19:41:18 # Node ID bf7c24e12fadf8cb1ab1458aaa6c4972b09898be # Parent c17cf2d51ff48ea840e29ab941cec900419170ab narrow: add test demonstrating bug in acl exclusion enforcement diff --git a/tests/test-narrow-acl.t b/tests/test-narrow-acl-excludes.t copy from tests/test-narrow-acl.t copy to tests/test-narrow-acl-excludes.t --- a/tests/test-narrow-acl.t +++ b/tests/test-narrow-acl-excludes.t @@ -1,4 +1,4 @@ -Make a narrow clone then archive it +Test exclusion-based ACL enforcement $ . "$TESTDIR/narrow-library.sh" $ hg init master @@ -11,7 +11,9 @@ Make a narrow clone then archive it > done $ cat >> .hg/hgrc << EOF > [narrowacl] - > default.includes=f1 f2 + > default.includes=* + > default.excludes=f2 f3 + > test.excludes=f3 > EOF $ hg serve -a localhost -p $HGPORT1 -d --pid-file=hg.pid $ cat hg.pid >> "$DAEMON_PIDS" @@ -37,43 +39,43 @@ Requirements should contain narrowhg $ hg debugrequires -R narrowclone1 | grep narrowhg narrowhg-experimental -NarrowHG should track f1 and f2 +NarrowHG should exclude f3. $ hg -R narrowclone1 tracked - I path:f1 - I path:f2 + I path:. + X path:f3 Narrow should not be able to widen to include f3 $ hg -R narrowclone1 tracked --addinclude f3 comparing with http://localhost:$HGPORT1/ searching for changes - abort: The following includes are not accessible for test: ['path:f3'] - [255] + adding changesets + adding manifests + adding file changes $ ls -A -1 narrowclone1 | sort .hg f1 f2 $ hg -R narrowclone1 tracked - I path:f1 - I path:f2 + I path:. + X path:f3 -Narrow should allow widen to include f2 - $ hg -R narrowclone1 tracked --removeinclude f2 > /dev/null - $ hg -R narrowclone1 tracked - I path:f1 - $ ls -A -1 narrowclone1 | sort - .hg - f1 - $ hg -R narrowclone1 tracked --addinclude f2 + +Narrow should not be able to remove the exclusion for f3 + $ hg -R narrowclone1 tracked --removeexclude f3 comparing with http://localhost:$HGPORT1/ searching for changes adding changesets adding manifests adding file changes added 0 changesets with 1 changes to 1 files - $ hg -R narrowclone1 tracked - I path:f1 - I path:f2 $ ls -A -1 narrowclone1 | sort .hg f1 f2 + f3 + $ hg -R narrowclone1 tracked + I path:. + + +XXX: BUG! This test demonstrates that we are presently +able to gain access to f3 by removing the exclusion.