Commit graph

26333 commits

Author SHA1 Message Date
pete.ward@26c41318616c4cf9601d0431557c1df734ccdb77
ffefc488f4 2015-12-16 22:15:17 +00:00
Joey Hess
0914d33b21
Merge branch 'master' of ssh://git-annex.branchable.com 2015-12-16 17:05:12 -04:00
Joey Hess
ca9b84754d
devblog 2015-12-16 17:04:48 -04:00
Joey Hess
e55ac3d383
update 2015-12-16 17:04:31 -04:00
Joey Hess
a0498b47de
test suite down to only 4 fails with v6 2015-12-16 16:56:27 -04:00
Joey Hess
e61f3d1752
update todo list 2015-12-16 16:02:21 -04:00
Joey Hess
a858a331c4
fix docs
"git -a annex.largefiles=* add" cannot be used.. git does not pass the
config along to the smudge filter, sadly.
2015-12-16 16:00:41 -04:00
Joey Hess
6b717032c5
v6: fix locking modified file when the content is not present 2015-12-16 15:35:42 -04:00
Joey Hess
2d343224dc
fix add of file that was locked but has been replaced by a new, unlocked file (v6) 2015-12-16 14:53:41 -04:00
Joey Hess
35f6a78b66
fix reversion in v5 git-annex add of unlocked file
In v5, lookupFile is supposed to only look at symlinks on disk (except when
in direct mode).

Note that v6 also has a bug when a locked file's symlink is deleted and is
replaced with a new file. It sees that a link is staged and gets that
key.
2015-12-16 14:27:12 -04:00
Joey Hess
38a23928e9
temporarily remove cached keys database connection
The problem is that shutdown is not always called, particularly in the test
suite. So, a database connection would be opened, possibly some changes
queued, and then not shut down.

One way this can happen is when using Annex.eval or Annex.run with a new
state. A better fix might be to make both of them call Keys.shutdown
(and be sure to do it even if the annex action threw an error).

Complication: Sometimes they're run reusing an existing state, so shutting
down a database connection could cause problems for other users of that
same state. I think this would need a MVar holding the database handle,
so it could be emptied once shut down, and another user of the database
connection could then start up a new one if it got shut down. But, what if
2 threads were concurrently using the same database handle and one shut it
down while the other was writing to it? Urgh.

Might have to go that route eventually to get the database access to run
fast enough. For now, a quick fix to get the test suite happier, at the
expense of speed.
2015-12-16 14:05:26 -04:00
Joey Hess
622da992f8
reorder database shutdown to be concurrency safe
If a DbHandle is in use by another thread, it could be queueing changes
while shutdown is running. So, wait for the worker to finish before
flushing the queue, so that any last-minute writes are included. Before
this fix, they would be silently dropped.

Of course, if the other thread continues to try to use a DbHandle once it's
closed, it will block forever as the worker is no longer reading from the
jobs MVar. So, that would crash with
"thread blocked indefinitely in an MVar operation".
2015-12-16 13:52:43 -04:00
Joey Hess
1a051f4300
comment 2015-12-16 13:24:45 -04:00
Joey Hess
1e016611de
pass --version to init when needed 2015-12-16 13:14:18 -04:00
Joey Hess
029111b89a
Merge branch 'master' into smudge 2015-12-16 13:07:46 -04:00
wsha.code+ga@b38779424f41c5701bbe5937340be43ff1474b2d
4a02a243f3 Added a comment 2015-12-16 11:21:48 +00:00
14.203.223.70
ff5de4ff57 poll vote (My phone (or MP3 player)) 2015-12-16 07:09:17 +00:00
Joey Hess
1c3b644345
Merge branch 'master' of ssh://git-annex.branchable.com 2015-12-15 20:50:52 -04:00
Joey Hess
25bc6ea6d8
bring back some deleted functions that git-repair uses 2015-12-15 20:42:35 -04:00
Joey Hess
96dd0f4ebe
improve temp dir security
http://bugs.debian.org/807341

* Fix insecure temporary permissions when git-annex repair is used in
  in a corrupted git repository.

  Other calls to withTmpDir didn't leak any potentially private data,
  but repair clones the git repository to a temp directory which is made
  using the user's umask. Thus, it might expose a git repo that is
  otherwise locked down.

* Fix potential denial of service attack when creating temp dirs.

  Since withTmpDir used easily predictable temporary directory names,
  an attacker could create foo.0, foo.1, etc and as long as it managed to
  keep ahead of it, could prevent it from ever returning.

  I'd rate this as a low utility DOS attack. Most attackers in a position
  to do this could just fill up the disk /tmp is on to prevent anything
  from writing temp files. And few parts of git-annex use withTmpDir
  anyway, so DOS potential is quite low.

Examined all callers of withTmpDir and satisfied myself that
switching to mkdtmp and so getting a mode 700 temp dir wouldn't break any
of them.

Note that withTmpDirIn continues to not force temp dir to 700.
But it's only used for temp directories inside .git/annex/wherever/
so that is not a problem.

Also re-audited all other uses of temp files and dirs in git-annex.
2015-12-15 20:21:48 -04:00
Joey Hess
7800125783
starting to work on test suite for v6 2015-12-15 17:19:26 -04:00
Joey Hess
7d0e79b9e1
Use git-annex init --version=6 to get v6 for now
Not ready to make it default because of the direct mode upgrade needing to
all happen at once.
2015-12-15 17:17:13 -04:00
Joey Hess
b9588fe69e
in v6 mode, unannex does not interact badly with pre-commit hook
So can be used in a tree with staged changes, no problems. Much nicer.
2015-12-15 16:18:39 -04:00
Joey Hess
99f1d7991d
recent fsck changes caused ugly message when object was not present 2015-12-15 16:10:48 -04:00
Joey Hess
db8b32254c
update todo list 2015-12-15 16:07:02 -04:00
Joey Hess
f9d077186a
implemented upgrade of direct mode repo to v6 2015-12-15 16:00:26 -04:00
Joey Hess
cdd27b8920
reorg 2015-12-15 15:34:28 -04:00
Joey Hess
0ddcaae9c1
changes for v6 broke fsck in direct mode 2015-12-15 14:27:20 -04:00
Joey Hess
3ba6d84559
clarify 2015-12-15 14:18:44 -04:00
Joey Hess
178dbe8cb1
doc update 2015-12-15 14:17:34 -04:00
Joey Hess
8a660a7b14
add: In v6 mode, acts on modified files.
Same as was done in direct mode, except in v6 mode add always adds files
locked, so
2015-12-15 14:17:00 -04:00
Joey Hess
c7a066a3e4
fix incorrect doc change 2015-12-15 14:14:19 -04:00
Joey Hess
d245a80518
avoid pre-commit check having to do with v5 unlocked files when in v6 mode 2015-12-15 14:09:36 -04:00
Joey Hess
a983a3a7a2
rename stuff for v5 unlocked files to indicate it's old 2015-12-15 14:08:07 -04:00
Joey Hess
d1bb518e25
update doc for v6 2015-12-15 14:07:54 -04:00
Joey Hess
a4a813fb07
add: no need to make pass for old unlocked files in v6 2015-12-15 14:03:25 -04:00
Joey Hess
71e2050f8f
have clean filter check if the filename was already in use by an old key
The annex object for it may have been modified due to hard link, and
that should be cleaned up when the new version is added. If another
associated file has the old key's content, that's linked into the annex
object. Otherwise, update location log to reflect that content has been
lost.
2015-12-15 13:06:52 -04:00
Joey Hess
0a7a2dae4e
add getAssociatedKey
I guess this is just as efficient as the getAssociatedFiles query, but I
have not tried to optimise the database yet.
2015-12-15 13:05:23 -04:00
Joey Hess
2bc920e266
update inode cache to cover file even when nothing needs to be done to linkAnnex
This covers the case where multiple files have the same content and are
added with git add. Previously only the one that was linked to the annex
got its inode cached; now both are.
2015-12-15 13:02:33 -04:00
Joey Hess
9fcc5046b3
todo 2015-12-15 12:38:32 -04:00
Joey Hess
f5d4ee9b63
Merge branch 'master' into smudge 2015-12-15 12:01:21 -04:00
wsha.code+ga@b38779424f41c5701bbe5937340be43ff1474b2d
555f5ae302 removed 2015-12-14 12:04:46 +00:00
wsha.code+ga@b38779424f41c5701bbe5937340be43ff1474b2d
eb822fbd1c Added a comment 2015-12-14 12:03:58 +00:00
wsha.code+ga@b38779424f41c5701bbe5937340be43ff1474b2d
9051166774 Added a comment 2015-12-14 12:03:23 +00:00
https://me.yahoo.com/a/ZF7p46cPmpWtb9zvA8iTitPmiQ--#eb014
9690904b45 Added a comment: It worked 2015-12-14 04:46:46 +00:00
https://me.yahoo.com/a/ZF7p46cPmpWtb9zvA8iTitPmiQ--#eb014
367791c827 Added a comment: I'm also having this issue 2015-12-14 03:17:58 +00:00
yminus
97bb479165 Added a comment 2015-12-13 22:55:16 +00:00
scorchgeek
d998d20364 Added a comment: Indeed 2015-12-13 22:30:47 +00:00
basak
4c8fdaa008 Added a comment 2015-12-13 21:35:59 +00:00
joakim.hovlandsvag@ad788ffa13d1ccbf03f2c485653900f8baa33950
ea01310d98 Added a comment: Repairing ignores disk space issues too 2015-12-13 09:13:25 +00:00