New submission from Eric Kow <[email protected]>: 5 patches for repository http://darcs.net/releases/branch-2.4:
Sat Mar 27 06:16:17 GMT 2010 Trent W. Buck <[email protected]> * Extend issue1645 with additional pathologies. Thu Apr 1 14:11:00 BST 2010 Eric Kow <[email protected]> * Fix bug in issue1645 test. Tue Apr 6 06:53:46 BST 2010 Dmitry Astapov <[email protected]> * Implemented all test cases from the discussion of bug 1645 Sun Apr 11 16:00:04 BST 2010 Eric Kow <[email protected]> * Resolve issue1645: bump hashed-storage to 0.4.11; don't follow symlinks. Sun Apr 11 16:00:13 BST 2010 Eric Kow <[email protected]> * Split case-folding tests for issue1645 out so we can skip them as needed. ---------- files: extend-issue1645-with-additional-pathologies_.dpatch, unnamed messages: 10703 nosy: darcs-users, kowey status: needs-review title: Extend issue1645 with additional patholo... (and 4 more) __________________________________ Darcs bug tracker <[email protected]> <http://bugs.darcs.net/patch205> __________________________________
New patches: [Extend issue1645 with additional pathologies. Trent W. Buck <[email protected]>**20100327061617 Ignore-this: f0ade119d4126af22b88cc21f23215ec ] hunk ./tests/failing-issue1645-ignore-symlinks.sh 2 #!/usr/bin/env bash -## Test for issue1645 - whatsnew -l should not consider symlinks to be -## "real" files in the working tree. +## Test for issue1646 - Darcs should not follow symlinks, ESPECIALLY +## symlinks to directories outside the repository. ## hunk ./tests/failing-issue1645-ignore-symlinks.sh 5 -## Copyright (C) 2009 Trent W. Buck +## Copyright (C) 2010 Trent W. Buck ## ## Permission is hereby granted, free of charge, to any person ## obtaining a copy of this software and associated documentation hunk ./tests/failing-issue1645-ignore-symlinks.sh 27 ## CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ## SOFTWARE. -. ../tests/lib # Load some portability helpers. -rm -rf R f # Another script may have left a mess. -darcs init --repo R # Create our test repos. +. lib # Load some portability helpers. +rm -rf R S # Another script may have left a mess. +darcs init --repo R S # Create our test repos. hunk ./tests/failing-issue1645-ignore-symlinks.sh 31 +## These are the simple does-the-wrong-thing errors. cd R hunk ./tests/failing-issue1645-ignore-symlinks.sh 33 -echo 'Example content.' > ../f # a file outside the repo -ln -s ../f # a symlink to same inside the repo -darcs whatsnew -l >log -fgrep 'No changes!' log # Darcs shouldn't report any changes. +echo 'Example content.' > f +darcs rec -lamf # business as usual... +ln -s f l # darcs should just ignore l +not darcs add -qr . # add -r never had -l's problem. +darcs w -l >log # w -l shouldn't "see" the link. +grep 'No changes!' log +darcs rec -laml >log # rec -l shouldn't record it. +grep 'No changes!' log +cd .. + +## These are pathological cases +cd S +echo 'Example content.' > f +ln -s l l +darcs w -l + +rm l +ln -s /dev/zero l +darcs w -l + +rm l +ln -s /dev/nonexistent l +darcs w -l + +mkfifo f +rm l +ln -s f l +darcs w -l [Fix bug in issue1645 test. Eric Kow <[email protected]>**20100401131100 Ignore-this: dfcf454712d2a5bbcdd68c663f4c5218 ] hunk ./tests/failing-issue1645-ignore-symlinks.sh 29 . lib # Load some portability helpers. rm -rf R S # Another script may have left a mess. -darcs init --repo R S # Create our test repos. +darcs init --repo R # Create our test repos. +darcs init --repo S ## These are the simple does-the-wrong-thing errors. cd R [Implemented all test cases from the discussion of bug 1645 Dmitry Astapov <[email protected]>**20100406055346 Ignore-this: 315cde3de56fabf831ba0eccd9b05dcd ] hunk ./tests/failing-issue1645-ignore-symlinks.sh 2 #!/usr/bin/env bash -## Test for issue1646 - Darcs should not follow symlinks, ESPECIALLY -## symlinks to directories outside the repository. +## Test for issue1645 - Since Darcs does not version-contol symlinks, +## it should not follow them, ESPECIALLY symlinks to directories +## outside the repository. All these tests are passed with darcs-2.2 ## hunk ./tests/failing-issue1645-ignore-symlinks.sh 6 -## Copyright (C) 2010 Trent W. Buck +## See path_resolution(7) and symlink(7) for more info, especially +## the former. +## +## Copyright (C) 2010 Trent W. Buck, Dmitry Astapov ## ## Permission is hereby granted, free of charge, to any person ## obtaining a copy of this software and associated documentation hunk ./tests/failing-issue1645-ignore-symlinks.sh 36 darcs init --repo R # Create our test repos. darcs init --repo S +darcs --version + +add_to_boring() { + echo "$1" >> _darcs/prefs/boring +} + ## These are the simple does-the-wrong-thing errors. cd R hunk ./tests/failing-issue1645-ignore-symlinks.sh 44 -echo 'Example content.' > f -darcs rec -lamf # business as usual... -ln -s f l # darcs should just ignore l -not darcs add -qr . # add -r never had -l's problem. -darcs w -l >log # w -l shouldn't "see" the link. -grep 'No changes!' log -darcs rec -laml >log # rec -l shouldn't record it. -grep 'No changes!' log -cd .. +touch log +add_to_boring '^log$' + +unset pwd # Since this test is pretty much linux-specific, hspwd.hs is not needed + +# Case 1: looping symlink to non-recorded non-boring dir +mkdir non-recorded-dir +ln -s ../non-recorded-dir ./non-recorded-dir/loop # relative symlink +ln -s "`pwd`"/non-recorded-dir ./non-recorded-dir/loop2 # absolute symlink +darcs w -l >log 2>&1 # should not loop +darcs rec -alm "added ./non-recorded-dir" >>log 2>&1 # should not loop +darcs changes -s --patch="added ./non-recorded-dir" >>log 2>&1 # should report only dir, not symlink +not grep -vE "(^ *$|^\+|[0-9]:[0-9][0-9]:[0-9]|./non-recorded-dir)" log + +# Case 2: looping symlink to recorded dir +mkdir recorded-dir +darcs add recorded-dir +darcs rec -am "added recorded-dir" +ln -s ../recorded-dir ./recorded-dir/loop # relative symlink +ln -s "`pwd`"/recorded-dir ./recorded-dir/loop2 # absolute symlink +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log + +# Case 3: looping symlink to boring dir +mkdir boring-dir +add_to_boring '^boring-dir$' +ln -s ../boring-dir ./boring-dir/loop +ln -s "`pwd`"/boting-dir ./boring-dir/loop2 +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log + +# Case 4: non-looping symlink to non-recorded non-boring dir +mkdir non-recorded-dir2 +ln -s ./non-recorded-dir2 link +ln -s "`pwd`"/non-recorded-dir2 ./link2 +darcs w -l >log 2>&1 # should report only "non-recorded-dir2" +darcs rec -alm "added ./non-recorded-dir2" >>log 2>&1 # should add only dir, not symlink +darcs changes -s --patch="added ./non-recorded-dir2" >>log 2>&1 # should report only dir, not symlink +not grep -vE "(^ *$|^\+|[0-9]:[0-9][0-9]:[0-9]|./non-recorded-dir2)" log +rm link link2 + +# Case 5: non-looping symlink to recorded dir +ln -s ./recorded-dir ./link +ln -s "`pwd`"/recorded-dir ./link2 +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log +rm link link2 + +# Case 6: non-looping symlink to boring dir +ln -s ./boring-dir ./link +ln -s "`pwd`"/boring-dir ./link2 +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log +rm link link2 hunk ./tests/failing-issue1645-ignore-symlinks.sh 103 -## These are pathological cases -cd S -echo 'Example content.' > f +# Case 7: symlink pointing outside the repo +ln -s ../S link +(cd ..; ln -s "`pwd`"/S ./R/link2) +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log +rm link link2 + +# Case 8: symlink to non-recorded non-boring file +touch non-recorded-file +ln -s ./non-recorded-file ./link +ln -s "`pwd`"/non-recorded-file ./link2 +darcs w -l >log 2>&1 # should report only "non-recorded-file" +darcs rec -alm "added ./non-recorded-file" >>log 2>&1 # should add only file, not symlink +darcs changes -s --patch="added ./non-recorded-file" >>log 2>&1 # should report only file, not symlink +not grep -vE "(^ *$|^\+|[0-9]:[0-9][0-9]:[0-9]|./non-recorded-file)" log +rm link link2 + +# Case 9: symlink to recorded file +echo "some content" > recorded-file +darcs add recorded-file +darcs rec -am "added recorded-file" recorded-file +ln -s ./recorded-file ./link +ln -s "`pwd`"/recorded-file ./link2 +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log +rm link link2 + +# Case 10: symlink to boring file +ln -s ./log ./link +ln -s "`pwd`"/log ./link2 +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log +rm link link2 + +# Case 11: dangling symlink +ln -s /completely/bogus/path ./link +ln -s ../../../../not/exist ./link2 +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log +rm link link2 + +# Case 12: self-referencing link ln -s l l hunk ./tests/failing-issue1645-ignore-symlinks.sh 150 -darcs w -l +ln -s "`pwd`"/l2 ./l2 +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log +rm l l2 hunk ./tests/failing-issue1645-ignore-symlinks.sh 156 -rm l +# Case 13: link to device file outside the repo ln -s /dev/zero l hunk ./tests/failing-issue1645-ignore-symlinks.sh 158 -darcs w -l - +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log rm l hunk ./tests/failing-issue1645-ignore-symlinks.sh 162 -ln -s /dev/nonexistent l -darcs w -l hunk ./tests/failing-issue1645-ignore-symlinks.sh 163 +# Case 14: link to fifo mkfifo f hunk ./tests/failing-issue1645-ignore-symlinks.sh 165 -rm l ln -s f l hunk ./tests/failing-issue1645-ignore-symlinks.sh 166 -darcs w -l +ln -s "`pwd`"/f ./l2 +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log +rm f l l2 + +# Case 15: case-folding link to non-recorded file +touch non-recorded-file2 +ln -s ./non-recorded-file2 ./Non-Recorded-File2 +ln -s "`pwd`"/non-recorded-file2 ./Non-ReCoRdEd-File2 +darcs w -l >log 2>&1 # should report only "non-recorded-file" +darcs rec -alm "added ./non-recorded-file2" >>log 2>&1 # should add only file, not symlink +darcs changes -s --patch="added ./non-recorded-file2" >>log 2>&1 # should report only file, not symlink +not grep -vE "(^ *$|^\+|[0-9]:[0-9][0-9]:[0-9]|./non-recorded-file2)" log +rm Non-Recorded-File2 ./Non-ReCoRdEd-File2 + +# Case 16: case-folding link to recorded file +ln -s ./recorded-file ./Recorded-File +ln -s "`pwd`"/recorded-file ./ReCorded-File +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log +rm Recorded-File ReCorded-File [Resolve issue1645: bump hashed-storage to 0.4.11; don't follow symlinks. Eric Kow <[email protected]>**20100411150004 Ignore-this: dc680d7f37252c59035b19cbd0f27927 ] move ./tests/failing-issue1645-ignore-symlinks.sh ./tests/issue1645-ignore-symlinks.sh hunk ./darcs.cabal 328 html == 1.0.*, filepath == 1.1.*, haskeline >= 0.6.1 && < 0.7, - hashed-storage == 0.4.10 + hashed-storage == 0.4.11 if !os(windows) build-depends: unix >= 1.0 && < 2.5 hunk ./darcs.cabal 458 html == 1.0.*, filepath == 1.1.*, haskeline >= 0.6.1 && < 0.7, - hashed-storage == 0.4.10 + hashed-storage == 0.4.11 if !os(windows) build-depends: unix >= 1.0 && < 2.5 [Split case-folding tests for issue1645 out so we can skip them as needed. Eric Kow <[email protected]>**20100411150013 Ignore-this: 5ebab6147495d19c0887a30313333fad ] addfile ./tests/issue1645-ignore-symlinks-case-fold.sh hunk ./tests/issue1645-ignore-symlinks-case-fold.sh 1 +#!/usr/bin/env bash +## Test for issue1645 - Since Darcs does not version-contol symlinks, +## it should not follow them, ESPECIALLY symlinks to directories +## outside the repository. All these tests are passed with darcs-2.2 +## +## See path_resolution(7) and symlink(7) for more info, especially +## the former. +## +## This only covers the case-folding test cases. +## See also the issue1645-ignore-symlinks for the main test +## +## Copyright (C) 2010 Trent W. Buck, Dmitry Astapov +## +## Permission is hereby granted, free of charge, to any person +## obtaining a copy of this software and associated documentation +## files (the "Software"), to deal in the Software without +## restriction, including without limitation the rights to use, copy, +## modify, merge, publish, distribute, sublicense, and/or sell copies +## of the Software, and to permit persons to whom the Software is +## furnished to do so, subject to the following conditions: +## +## The above copyright notice and this permission notice shall be +## included in all copies or substantial portions of the Software. +## +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +## EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +## MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +## NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +## BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +## ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +## CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +## SOFTWARE. + +. lib # Load some portability helpers. +rm -rf R S # Another script may have left a mess. +darcs init --repo R # Create our test repos. +darcs init --repo S + +add_to_boring() { + echo "$1" >> _darcs/prefs/boring +} + +## These are the simple does-the-wrong-thing errors. +cd R +touch log +add_to_boring '^log$' + +unset pwd # Since this test is pretty much linux-specific, hspwd.hs is not needed + +# Skip the case-folding tests on systems that don't support it +touch cs-test +ln -s cs-test cs-Test || exit 200 + +# Case 15: case-folding link to non-recorded file +touch non-recorded-file2 +ln -s ./non-recorded-file2 ./Non-Recorded-File2 +ln -s "`pwd`"/non-recorded-file2 ./Non-ReCoRdEd-File2 +darcs w -l >log 2>&1 # should report only "non-recorded-file" +darcs rec -alm "added ./non-recorded-file2" >>log 2>&1 # should add only file, not symlink +darcs changes -s --patch="added ./non-recorded-file2" >>log 2>&1 # should report only file, not symlink +not grep -vE "(^ *$|^\+|[0-9]:[0-9][0-9]:[0-9]|./non-recorded-file2)" log +rm Non-Recorded-File2 ./Non-ReCoRdEd-File2 + +# Case 16: case-folding link to recorded file +ln -s ./recorded-file ./Recorded-File +ln -s "`pwd`"/recorded-file ./ReCorded-File +not darcs w -l >log 2>&1 # expecting "No changes!" +darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well +not grep -vE "(^ *$|^\+|No changes!)" log +rm Recorded-File ReCorded-File hunk ./tests/issue1645-ignore-symlinks.sh 9 ## See path_resolution(7) and symlink(7) for more info, especially ## the former. ## +## There's a second section to this test for systems that support +## case-folding. See issue1645-ignore-symlinks-case-fold.sh +## ## Copyright (C) 2010 Trent W. Buck, Dmitry Astapov ## ## Permission is hereby granted, free of charge, to any person hunk ./tests/issue1645-ignore-symlinks.sh 174 darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well not grep -vE "(^ *$|^\+|No changes!)" log rm f l l2 - -# Case 15: case-folding link to non-recorded file -touch non-recorded-file2 -ln -s ./non-recorded-file2 ./Non-Recorded-File2 -ln -s "`pwd`"/non-recorded-file2 ./Non-ReCoRdEd-File2 -darcs w -l >log 2>&1 # should report only "non-recorded-file" -darcs rec -alm "added ./non-recorded-file2" >>log 2>&1 # should add only file, not symlink -darcs changes -s --patch="added ./non-recorded-file2" >>log 2>&1 # should report only file, not symlink -not grep -vE "(^ *$|^\+|[0-9]:[0-9][0-9]:[0-9]|./non-recorded-file2)" log -rm Non-Recorded-File2 ./Non-ReCoRdEd-File2 - -# Case 16: case-folding link to recorded file -ln -s ./recorded-file ./Recorded-File -ln -s "`pwd`"/recorded-file ./ReCorded-File -not darcs w -l >log 2>&1 # expecting "No changes!" -darcs rec -alm "should not happen" >>log 2>&1 # expecting "No changes!" as well -not grep -vE "(^ *$|^\+|No changes!)" log -rm Recorded-File ReCorded-File Context: [Only use stderr in install-deps, avoiding stderr/stdout interleaving issues. Petr Rockai <[email protected]>**20100320143212 Ignore-this: 7fe9820f10015867f17d70f39ef5e201 ] [Pass the install-deps options down to second cabal install call as well. Petr Rockai <[email protected]>**20100320134009 Ignore-this: 5061ea1965ed6856ee0cf455c27e2ae0 ] [Update the install-deps script to work with Cabal 1.8. Petr Rockai <[email protected]>**20100302221215 Ignore-this: 4d5f29b28f09727d3686bc9883c88878 ] [Resolve issue1750: uncover help text for darcs show pristine. Eric Kow <[email protected]>**20100221125933 Ignore-this: 46c8575ff5889d6092f9e5a221275732 f r { foo = bar } means f (r { foo = bar }) whereas what we really wanted was (f r) { foo = bar } ] [Correct online help text for aliases of subcommands. Eric Kow <[email protected]>**20100221125653 Ignore-this: e33fe432bc0ef53205103cabdcd33a61 ] [resolve issue1767: send CRC warnings to stderr Ganesh Sittampalam <[email protected]>**20100314224948 Ignore-this: b0555759c3fa55fc9689f9a957d9eb1 ] [Remove intermediary files from "cabal sdist" tarball. Trent W. Buck <[email protected]>**20100219003943 Ignore-this: ddb9caa7bf9025c8e8b0ea8897e82844 AFAICT these files are generated during "make html pdf", and are thus unnecessary in the source tarball. Removing them makes "cabal sdist" work in clean checkout. ] [fix issue458.sh failing on systems with xattrs Jens Petersen <[email protected]>**20100305052023 Ignore-this: 8dd7c366bf87f3f9106974e66cdccbe6 Systems with selinux or other extended fs attributes give output with trailing-dot like "-rw-------." instead of "-rw-------". The change just filters off any trailing "." with sed. ] [Update tests/README.test_maintainers.txt to cabalized build system Reinier Lamers <[email protected]>**20100315171511 Ignore-this: 3b869e68133c1c79dcbe44aa811ec40 ] [Include tests/README.test_maintainers.txt in distribution tarballs Reinier Lamers <[email protected]>**20100314130520 Ignore-this: 5b326ecc806c89dc64b297ab93bbc665 ] [resolve issue1756: bump hashed-storage dependency to 0.4.10 Reinier Lamers <[email protected]>**20100325082732 Ignore-this: c59e8582416191a8d55b72ae511f70b3 ] [Bump hashed-storage dependency to 0.4.8 Salvatore Insalaco <[email protected]>**20100321103955 Ignore-this: 3e54bef5ade88f3c402c8e9eecbd7ca ] [Test release tarballs more thoroughly in release.sh Reinier Lamers <[email protected]>**20100313225454 Ignore-this: 423fe1d4b4a8c97758c937fae9df3c7a ] [Add missing unit test modules to darcs.cabal Reinier Lamers <[email protected]>**20100313221428 Ignore-this: 22eb7e0530a1b81cd8da21c35974a4e1 ] [Resolve issue1753: restrict mmap to version used by hashed-storage. Eric Kow <[email protected]>**20100301163950 Ignore-this: a53ca223c957f80ff5b021fc6c2026d8 Looks like we'll have to be careful about synchronising the dependencies. ] [Add 2.4 release announcement to web site Reinier Lamers <[email protected]>**20100227115055 Ignore-this: 38945035d233abb0565c16785e67fa9f ] [resolve issue1765: remove -r on untracked dir should not write bad pending Reinier Lamers <[email protected]>**20100403110800 Ignore-this: ec5e87a08b542d1d929b5fe4fb6cf323 This is a variant of the existing issue1765 patch. This one applies to the 2.4 release context, while the original issue1765 patch required some witnesses work that was not in 2.4. ] [Rename issue1765 test to reflect that it succeeds Reinier Lamers <[email protected]>**20100320172808 Ignore-this: 1f72ba012bb3cb79a6e05e75f5befdc6 ] [Accept issue1765: recursive remove on root Luca Molteni <[email protected]>**20100320143438 Ignore-this: 90de508f42c0d4b5b4379fefb6a92995 ] [TAG 2.4 Reinier Lamers <[email protected]>**20100226180900 Ignore-this: 36ce0456c214345f55a7bc5fc142e985 ] Patch bundle hash: c8184244f95d0e22fcaf874c59d1793f4f87adba
.
_______________________________________________ darcs-users mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-users
