aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2018-01-02 16:25:27 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2018-01-02 16:25:27 -0400
commit97ec39db6b3b1b3c8d018786264ab6c625a7b018 (patch)
tree2356359e5d6504ed130b2a39afb26c9babe8be79
parentdb0d0ecae7b8d460c05e310c7fa1d84721e0c426 (diff)
unused: Write .git/annex/unused etc files with appropriate permissions for the core.sharedRepository config.
This commit was sponsored by an anonymous bitcoin donor.
-rw-r--r--CHANGELOG2
-rw-r--r--Logs/Unused.hs6
-rw-r--r--doc/bugs/wrong_permissions_of_unused__44___badunused_and_tmpunused__63__.mdwn2
-rw-r--r--doc/bugs/wrong_permissions_of_unused__44___badunused_and_tmpunused__63__/comment_2_252800c3f4df5a5219e7f13c2b6ef841._comment9
4 files changed, 18 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 01701f99a..75111164b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -11,6 +11,8 @@ git-annex (6.20171215) UNRELEASED; urgency=medium
* addurl: Fix encoding of filename queried from youtube-dl when in
--fast mode.
* git-annex.cabal: Add back custom-setup stanza, so cabal new-build works.
+ * unused: Write .git/annex/unused etc files with appropriate permissions
+ for the core.sharedRepository config.
-- Joey Hess <id@joeyh.name> Wed, 20 Dec 2017 12:11:46 -0400
diff --git a/Logs/Unused.hs b/Logs/Unused.hs
index a2f40410b..076245591 100644
--- a/Logs/Unused.hs
+++ b/Logs/Unused.hs
@@ -33,6 +33,7 @@ import Data.Time
import Annex.Common
import qualified Annex
+import Annex.Perms
import Utility.Tmp
import Logs.TimeStamp
@@ -64,10 +65,13 @@ updateUnusedLog prefix m = do
writeUnusedLog :: FilePath -> UnusedLog -> Annex ()
writeUnusedLog prefix l = do
logfile <- fromRepo $ gitAnnexUnusedLog prefix
- liftIO $ viaTmp writeFile logfile $ unlines $ map format $ M.toList l
+ viaTmp writelog logfile $ unlines $ map format $ M.toList l
where
format (k, (i, Just t)) = show i ++ " " ++ key2file k ++ " " ++ show t
format (k, (i, Nothing)) = show i ++ " " ++ key2file k
+ writelog f c = do
+ liftIO $ writeFile f c
+ setAnnexFilePerm f
readUnusedLog :: FilePath -> Annex UnusedLog
readUnusedLog prefix = do
diff --git a/doc/bugs/wrong_permissions_of_unused__44___badunused_and_tmpunused__63__.mdwn b/doc/bugs/wrong_permissions_of_unused__44___badunused_and_tmpunused__63__.mdwn
index 393370de7..e03ea396a 100644
--- a/doc/bugs/wrong_permissions_of_unused__44___badunused_and_tmpunused__63__.mdwn
+++ b/doc/bugs/wrong_permissions_of_unused__44___badunused_and_tmpunused__63__.mdwn
@@ -69,3 +69,5 @@ This is somewhat expected, because the permissions of `unused`, `badunused` and
-rw------- 1 ele testgroup 101 dic 19 14:50 unused
If this is the intended behavior, could you please explain me how to use `git annex unused` and `dropunused` in a shared repository?
+
+> Fixed all of this I was able to reproduce. [[done]] --[[Joey]]
diff --git a/doc/bugs/wrong_permissions_of_unused__44___badunused_and_tmpunused__63__/comment_2_252800c3f4df5a5219e7f13c2b6ef841._comment b/doc/bugs/wrong_permissions_of_unused__44___badunused_and_tmpunused__63__/comment_2_252800c3f4df5a5219e7f13c2b6ef841._comment
new file mode 100644
index 000000000..ef6ede63e
--- /dev/null
+++ b/doc/bugs/wrong_permissions_of_unused__44___badunused_and_tmpunused__63__/comment_2_252800c3f4df5a5219e7f13c2b6ef841._comment
@@ -0,0 +1,9 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2018-01-02T20:17:03Z"
+ content="""
+Fixed, but I was not able to reproduce the part where dropunused failed
+with a permissions error involving .git/annex/misctmp, despite having it
+set up the same as you did.
+"""]]