Daniel Shahaf wrote on Sat, Feb 19, 2022 at 13:35:22 +0000:
> This seems to have regressed the failure mode of «svn cat iota@BASE»
> when iota is locally-modified and has no read access.
> 
> To reproduce:
> 

Here's a patch too:

[[[
Index: subversion/tests/cmdline/authz_tests.py
===================================================================
--- subversion/tests/cmdline/authz_tests.py     (revision 1898216)
+++ subversion/tests/cmdline/authz_tests.py     (working copy)
@@ -1634,6 +1634,12 @@ def remove_access_after_commit(sbox):
   # Local modification
   sbox.simple_append('A/D/G/pi', 'appended\n')
 
+  # Check the error message from 'cat'
+  # ### Once this passes, verify stdout too
+  svntest.actions.run_and_verify_svn(None, '.*E170001: Authorization failed',
+                                     'cat', sbox.ospath('A/D/G/pi') + '@BASE')
+
+  # Update and expect a mixed rev copy
   expected_output = svntest.wc.State(wc_dir, {
     'A/B'  : Item(status='D '),
     'A/D'  : Item(status='  ', treeconflict='C'),
@@ -1655,7 +1661,6 @@ def remove_access_after_commit(sbox):
   expected_status.remove('A/B', 'A/B/E', 'A/B/E/alpha', 'A/B/E/beta', 'A/B/F',
                          'A/B/lambda')
 
-  # And expect a mixed rev copy
   expected_status.tweak('A/D/G/rho', status='A ', entry_status='  ')
   svntest.actions.run_and_verify_update(wc_dir,
                                         expected_output,
]]]

Cheers,

Daniel


> [[[
> #!/bin/sh
> 
> : ${svn:=svn}
> svn="$svn --username=h --password=h --no-auth-cache"
> 
> rm -rf r wc
> svnadmin create r
> printf '%s\n' '[general]' 'anon-access = write' 'authz-db = authz' > 
> r/conf/svnserve.conf
> printf '%s\n' '[users]' 'h=h' > r/conf/passwd
> printf '%s\n' '[/]' '* = rw' > r/conf/authz
> svnserve --foreground -d -r r & pid=$!
> 
> $svn -q co svn://localhost wc --compatible-version=1.15 2>/dev/null ||
> $svn -q co svn://localhost wc
> cd wc
> sqlite3 .svn/wc.db "PRAGMA user_version;"
> echo "This is the file 'iota'." > iota
> $svn -q add iota
> $svn -q ci -m "r1: add iota"
> $svn -q up
> $svn cleanup
> find .svn/pristine/ -type f -exec head -v -- {} +
> 
> # r2
> printf '%s\n' '[/iota]' '* = ' >> ../r/conf/authz
> echo >> "conflicting local mod" >> iota
> $svn cat -r BASE iota@BASE
> 
> kill -9 $pid
> exit
> ]]]
> 
> Output with trunk:
> 
> [[[
> 31
> ==> .svn/pristine/2c/2c0aa9014a0cd07f01795a333d82485ef6d083e2.svn-base <==
> This is the file 'iota'.
> This is the file 'iota'.
> ]]]
> 
> Output with pristines-on-demand-mwf@r1898184:
> 
> [[[
> 32
> ./subversion/svn/cat-cmd.c:88,
> ./subversion/svn/util.c:626,
> ./subversion/libsvn_client/cat.c:221,
> ./subversion/libsvn_client/textbase.c:106,
> ./subversion/libsvn_wc/textbase.c:553,
> ./subversion/libsvn_wc/textbase.c:514,
> ./subversion/libsvn_client/textbase.c:84,
> ./subversion/libsvn_ra_svn/client.c:1456,
> ./subversion/libsvn_ra_svn/client.c:249,
> ./subversion/libsvn_ra_svn/marshal.c:1875,
> ./subversion/svnserve/serve.c:132: (apr_err=SVN_ERR_RA_NOT_AUTHORIZED)
> svn: E170001: Authorization failed
> ]]]
> 
> Output with pristines-on-demand-mwf@r1898216:
> 
> [[[
> 32
> ./subversion/svn/cat-cmd.c:88,
> ./subversion/svn/util.c:626,
> ./subversion/libsvn_client/cat.c:227,
> ./subversion/libsvn_client/cat.c:91: (apr_err=SVN_ERR_ILLEGAL_TARGET)
> svn: E200009: '/scratch/tmp.uD2t1Qh9LB/wc/iota' has no pristine version until 
> it is committed
> ]]]
> 
> Output with pristines-on-demand-mwf@r1898216 after changing the authz on
> iota to «* = rw», or with authz disabled entirely (whether by commenting
> it out in svnserve.conf or by checking out over file://):
> 
> [[[
> 32
> This is the file 'iota'.
> ]]]
> 
> Cheers,
> 
> Daniel

Reply via email to