aboutsummaryrefslogtreecommitdiff
path: root/doc/forum/Preserving_file_access_rights_in_directory_tree_below_objects__47__.mdwn
blob: d89bcee29044d0cf35b5cd17948f9ba18f8b81e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Hello,

I have the problem that, while git-annex preserves the file access rights (user, group, others) for the actual file, it does not make sure that others can access this file through the directory tree above said file:

    /tmp $ mkdir test
    /tmp $ chown claudius:media test
    /tmp $ chmod 750 test
    /tmp $ ls -dl test
    drwxr-x--- 2 claudius media 40 2012-01-23 19:27 test/
    /tmp $ cd test
    /tmp/test $ git init --shared=all
    Initialized empty shared Git repository in /tmp/test/.git/
    /tmp/test $ git annex init "test"
    init test ok
    /tmp/test $ echo 123 > abc
    /tmp/test $ chmod 640 abc
    /tmp/test $ chown claudius:media abc
    /tmp/test $ ls -l
    total 4
    -rw-r----- 1 claudius media 4 2012-01-23 19:27 abc
    /tmp/test $ git annex add .
    add abc (checksum...) ok
    (Recording state in git...)
    /tmp/test $ ls -l
    total 4
    lrwxrwxrwx 1 claudius claudius 176 2012-01-23 19:27 abc -> .git/annex/objects/8F/pj/SHA256-s4--181210f8f9c779c26da1d9b2075bde0127302ee0e3fca38c9a83f5b1dd8e5d3b/SHA256-s4--181210f8f9c779c26da1d9b2075bde0127302ee0e3fca38c9a83f5b1dd8e5d3b
    /tmp/test $ ls -l .git/annex/objects/8F/pj/SHA256-s4--181210f8f9c779c26da1d9b2075bde0127302ee0e3fca38c9a83f5b1dd8e5d3b/SHA256-s4--181210f8f9c779c26da1d9b2075bde0127302ee0e3fca38c9a83f5b1dd8e5d3b
    -r--r----- 1 claudius media 4 2012-01-23 19:27 .git/annex/objects/8F/pj/SHA256-s4--181210f8f9c779c26da1d9b2075bde0127302ee0e3fca38c9a83f5b1dd8e5d3b/SHA256-s4--181210f8f9c779c26da1d9b2075bde0127302ee0e3fca38c9a83f5b1dd8e5d3b
    /tmp/test $ ls -lR .git/annex/objects/
    .git/annex/objects/:
    total 0
    drwx--S--- 3 claudius claudius 60 2012-01-23 19:28 8F/
    
    .git/annex/objects/8F:
    total 0
    drwx--S--- 3 claudius claudius 60 2012-01-23 19:28 pj/
    
    .git/annex/objects/8F/pj:
    total 0
    dr-x--S--- 2 claudius claudius 60 2012-01-23 19:28 SHA256-s4--181210f8f9c779c26da1d9b2075bde0127302ee0e3fca38c9a83f5b1dd8e5d3b/
    
    .git/annex/objects/8F/pj/SHA256-s4--181210f8f9c779c26da1d9b2075bde0127302ee0e3fca38c9a83f5b1dd8e5d3b:
    total 4
    -r--r----- 1 claudius media 4 2012-01-23 19:27 SHA256-s4--181210f8f9c779c26da1d9b2075bde0127302ee0e3fca38c9a83f5b1dd8e5d3b
    /tmp/test $ stat .git/annex/objects/
      File: `.git/annex/objects/'
      Size: 60        	Blocks: 0          IO Block: 4096   directory
    Device: 11h/17d	Inode: 2365970     Links: 3
    Access: (2700/drwx--S---)  Uid: ( 1000/claudius)   Gid: ( 1000/claudius)
    Access: 2012-01-23 19:28:10.614948386 +0100
    Modify: 2012-01-23 19:28:10.614948386 +0100
    Change: 2012-01-23 19:28:10.614948386 +0100
     Birth: -

The use case is that I have a rather large collection of music I would like to manage with git-annex in various locations (all of it on my external hard drive, some on my notebook etc. This music is played by MPD, which can access the collection because it is in the "media" group. After changing to git-annex, however, this fails.

I tried to avoid this specific problem by declaring the git repository to be shared, which does appear to have some effect on the other files in .git:

    /tmp/test $ ls -l .git
    total 16
    drwx--S---  5 claudius claudius 160 2012-01-23 19:28 annex/
    drwxrwsr-x  2 claudius claudius  40 2012-01-23 19:27 branches/
    -rw-rw-r--  1 claudius claudius 218 2012-01-23 19:27 config
    -rw-rw-r--  1 claudius claudius  73 2012-01-23 19:27 description
    -rw-rw-r--  1 claudius claudius  23 2012-01-23 19:27 HEAD
    drwxrwsr-x  2 claudius claudius 220 2012-01-23 19:27 hooks/
    -rw-rw-r--  1 claudius claudius 104 2012-01-23 19:28 index
    drwxrwsr-x  2 claudius claudius  60 2012-01-23 19:27 info/
    drwxrwsr-x  3 claudius claudius  60 2012-01-23 19:27 logs/
    drwxrwsr-x 15 claudius claudius 300 2012-01-23 19:28 objects/
    drwxrwsr-x  4 claudius claudius  80 2012-01-23 19:27 refs/

I could obviously try to change the rights of annex/, annex/objects etc., but I would like to avoid having to adapt them each time a new folder is added somewhere below annex/objects/.

My knowledge of git and especially git-annex is not too good, so it might well be that I missed something obvious. Any hints? :)

(And thank you, of course, for taking the time to read all this)