darcs

Issue 1951 darcs add: Can add files outside of repository.

Title darcs add: Can add files outside of repository.
Priority bug Status resolved
Milestone 2.5.0 Resolved in 2.5.0
Superseder Nosy List dmitry.kurochkin, mornfall, tux_rocker
Assigned To tux_rocker
Topics Regression

Created on 2010-09-07.22:50:08 by mornfall, last changed 2010-10-15.13:14:45 by tux_rocker.

Messages
msg12498 (view) Author: mornfall Date: 2010-09-07.22:50:07
00:48:25 | morn@twi:~/dev/darcs/adventure -> darcs-HEAD add
Skipping boring file ..
00:48:54 | morn@twi:~/dev/darcs/adventure -> darcs-HEAD wh -s
A ./../adventure-old/

This looks fairly bad. Someone please try reproducing, I *do* have a bit 
of a mess with darcs binaries, but looking at --exact-version, this one 
does look like plain HEAD from maybe a week ago.
msg12506 (view) Author: kowey Date: 2010-09-08.10:02:49
Not good at all.

I've pushed a test case for this to both unstable and darcs-2.5.  I can 
confirm that it's a regression between 2.4 and 2.4.98.5
msg12508 (view) Author: dagit Date: 2010-09-08.15:31:35
Eric,

Which version of 2.4?  2.4.4?  2.4.0?
msg12512 (view) Author: kowey Date: 2010-09-08.19:06:26
Ah good catch.  Darcs 2.4.4
Various release notes for that line here 
http://wiki.darcs.net/Releases/2.4
msg12609 (view) Author: tux_rocker Date: 2010-09-25.19:31:51
It looks like this is because of an unclarity in hashed-storage. It
appears that directoryExists from the TreeRO class in
Storage.Hashed.Monad returns true for "..". So Darcs.Utils.treeHasDir
also happily tells us that ".." is in the Tree that represents the
current state of the repo.

Petr, do you think this is a bug in hashed-storage or in the way we use
it in darcs?
msg12610 (view) Author: mornfall Date: 2010-09-25.19:54:24
In that case, I think it's a hashed-storage bug.
msg12611 (view) Author: tux_rocker Date: 2010-09-25.20:13:14
Further research indicates that darcs is wrong here. More specifically,
Darcs.Arguments.fixSubPaths. Perhaps I should stop tracing down the
problems out loud on the bug tracker.
msg12629 (view) Author: tux_rocker Date: 2010-10-03.14:23:14
The weird behavior of 'darcs move' with non-repository paths is now
issue1965.
msg12676 (view) Author: tux_rocker Date: 2010-10-09.16:52:22
The following patch updated issue issue1951 with status=resolved;resolvedin=2.8.0 HEAD

* resolve issue1951: refuse to add files outside repository 
Ignore-this: 906eca5d6a62c103b3e423967b37570d

Instead of passing on relative paths to hashed-storage if they are not
meaningful relative to the repository root, we now turn all relative paths into
absolute paths. We do that by chdir'ing to them from either the current working
directory, or if that fails, the repository root.
msg12697 (view) Author: tux_rocker Date: 2010-10-15.13:14:44
The following patch updated issue issue1951 with status=resolved;resolvedin=2.5.0 CURRENT

* resolve issue1951: refuse to add files outside repository 
Ignore-this: 906eca5d6a62c103b3e423967b37570d

Instead of passing on relative paths to hashed-storage if they are not
meaningful relative to the repository root, we now turn all relative paths into
absolute paths. We do that by chdir'ing to them from either the current working
directory, or if that fails, the repository root.
History
Date User Action Args
2010-09-07 22:50:08mornfallcreate
2010-09-08 10:02:51koweysetpriority: bug
status: unknown -> needs-reproduction
topic: + Regression
messages: + msg12506
milestone: 2.5.0
2010-09-08 15:31:35dagitsetmessages: + msg12508
2010-09-08 19:06:26koweysetmessages: + msg12512
2010-09-11 12:25:29tux_rockersetnosy: + tux_rocker
2010-09-25 19:31:55tux_rockersetmessages: + msg12609
2010-09-25 19:54:25mornfallsetmessages: + msg12610
2010-09-25 20:13:15tux_rockersetmessages: + msg12611
2010-09-26 15:24:23tux_rockersetassignedto: tux_rocker
2010-10-03 14:23:14tux_rockersetmessages: + msg12629
2010-10-09 16:52:23tux_rockersetstatus: needs-reproduction -> resolved
messages: + msg12676
resolvedin: 2.8.0
2010-10-15 13:14:45tux_rockersetmessages: + msg12697
resolvedin: 2.8.0 -> 2.5.0