aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/linux_standalone_git_annex_won__39__t_work_in_a_directory_whose_path_contains___58___or___59__.mdwn
blob: c660f065b835a09b8556eac5c3a7d79eeafab240 (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
### Please describe the problem.

The shim for the standalone version of git annex invokes the dynamic linker with --library-path set appropriately.  glibc's parsing of library-path treats : and ; as separators and has no quoting syntax for those characters.  Also path items have to be absolute paths so you can't avoid having the whole path.

As a result if you install the standalone version in a directory whose path includes either of those characters it will produce a library-path that's interpreted incorrectly leading to it looking for the libraries in the wrong place and potentially eventually using the system's installed versions if they are available.

### What steps will reproduce the problem?

1. Find a system with as few libraries installed as possible.  libnettle.so.6 is an easy one to avoid.
2. create a directory called 'test;test'
3. install git annex standalone in 'test;test'
4. use the standalone git annex to do a 'git annex get'
5. there will be an error saying it can't find libnettle.so.6

### What version of git-annex are you using? On what operating system?

This bug applies to any version.  with a ':' it will probably occur on any unix, with a ';' it will occur on at least Linux and Solaris.

### Please provide any additional information below.

This bug can't be fixed.  It's unlikely to trip people up but might with a bad combination of label-based drive mounting and odd drive labels.  The worst case would be incompatible libraries on the system install which could lead to data corruption.

I recommend that the git annex shim should check for ':' or ';' in the path and exit non-zero if they are found.

[[!format sh """
# If you can, paste a complete transcript of the problem occurring here.
# If the problem is with the git-annex assistant, paste in .git/annex/daemon.log

jdamery-iabak@oklina:/mnt/iabak-ext;/IA.BAK/shard9$ PATH=../git-annex.linux/:$PATH git annex get prelinger_library/11annualreport00unitrich/11annualreport00unitrich_raw_jp2.zip
get prelinger_library/11annualreport00unitrich/11annualreport00unitrich_raw_jp2.zip (from web...)
/mnt/iabak-ext;/IA.BAK/git-annex.linux/shimmed/wget/wget: error while loading shared libraries: libnettle.so.6: cannot open shared object file: No such file or directory

  Unable to access these remotes: web

  Try making some of these repositories available:
        00000000-0000-0000-0000-000000000001 -- web
failed
git-annex: get: 1 failed

# End of transcript or log.
"""]]

> Actually, this bug is fixable. And I have! I made it detect the problem
> path, and then fall back to making a directory in /tmp, symlinking the
> git-annex.linux directory into it, and using that as its base directory.
> 
> Of course, that's a suboptimal configuration, but better than having some
> configurations where it doesn't work. [[done]] --[[Joey]]