Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default repo_path isn't user writable #257

Open
jbeich opened this issue Oct 27, 2016 · 3 comments
Open

Default repo_path isn't user writable #257

jbeich opened this issue Oct 27, 2016 · 3 comments
Labels

Comments

@jbeich
Copy link

jbeich commented Oct 27, 2016

FreeBSD uses /var/db instead of /var/lib to hold app-specific state data across reboots. It's still not accessible by a regular user. tempfile respects POSIX TMPDIR, so why gitfs wants to hardcode the path at all?

$ mkdir gitfs
$ gitfs https://github.com/PressLabs/gitfs/ gitfs
Traceback (most recent call last):
  File "/usr/local/bin/gitfs", line 11, in <module>
    load_entry_point('gitfs==0.4.4', 'console_scripts', 'gitfs')()
  File "/usr/local/lib/python2.7/site-packages/gitfs/__init__.py", line 20, in mount
    start_fuse()
  File "/usr/local/lib/python2.7/site-packages/gitfs/mounter.py", line 107, in start_fuse
    args = parse_args(parser)
  File "/usr/local/lib/python2.7/site-packages/gitfs/mounter.py", line 39, in parse_args
    return Args(parser)
  File "/usr/local/lib/python2.7/site-packages/gitfs/utils/args.py", line 62, in __init__
    self.config = self.build_config(parser.parse_args())
  File "/usr/local/lib/python2.7/site-packages/gitfs/utils/args.py", line 71, in build_config
    return self.check_args(self.set_defaults(args))
  File "/usr/local/lib/python2.7/site-packages/gitfs/utils/args.py", line 141, in set_defaults
    value = value(args)
  File "/usr/local/lib/python2.7/site-packages/gitfs/utils/args.py", line 172, in get_repo_path
    return tempfile.mkdtemp(dir="/var/lib/gitfs")
  File "/usr/local/lib/python2.7/tempfile.py", line 339, in mkdtemp
    _os.mkdir(file, 0700)
OSError: [Errno 2] No such file or directory: '/var/lib/gitfs/tmpmbCIQv'
@vtemian vtemian added the should label Nov 10, 2016
@ei-grad
Copy link

ei-grad commented Nov 15, 2016

+1, btw, it is better to use $HOME/.cache/gitfs or $HOME/.local/share than $TMPDIR

@metux
Copy link

metux commented Sep 7, 2018

Exactly. This is user specific data, so it belongs under $HOME/. If $TMPDIR is that, this should be used.

@gitqlt
Copy link

gitqlt commented Jan 22, 2021

For test, I installed the gitfs package in userspace (with pip3 install --user gitfs) on my Linux. Still, the ~/.local/bin/gitfs command wants to write the nonexisting /var/lib/gitfs directory. User specific data should go to $HOME/.cache/gitfs if TMPDIR is undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants