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

sudo usage clobbers autojump_py to root ownership #39

Closed
nyarly opened this issue Feb 22, 2011 · 6 comments
Closed

sudo usage clobbers autojump_py to root ownership #39

nyarly opened this issue Feb 22, 2011 · 6 comments

Comments

@nyarly
Copy link

nyarly commented Feb 22, 2011

I'm not entirely positive, but I just got and error from jumpstat:
IOError: [Errno 13] Permission denied: '{$HOME}.local/share/autojump/autojump_py'

Sure enough, autojump_py was owned by root. Seems like a cd or something I ran with sudo wrote to the file as root (?) and chowning it back to me fixed the problem

@joelthelion
Copy link
Collaborator

Hi and thanks for the report! Are you using the latest git version or a previous release? I've had the same problem in the past, but I thought it was fixed now.

Also, do you have an idea of the command that caused the problem? What distro are you using?

@luciferous
Copy link

I have the same problem. I'm using autojump 14 on OS X installed via brew.

To reproduce just cd as root into another directory:

$ ls -l ~/.autojump_py
-rw-------  1 neuman  staff  17025 Mar 28 11:29 /Users/neuman/.autojump_py
$ sudo -s
# cd /tmp
# ls -l /Users/neuman/.autojump_py
-rw-------  1 root  staff  17025 Mar 28 11:44 /Users/neuman/.autojump_py
# exit
$ j
Problem with autojump database, trying to recover from backup...
Traceback (most recent call last):
  File "/usr/local/bin/autojump", line 132, in <module>
    path_dict=open_dic(dic_file)
  File "/usr/local/bin/autojump", line 117, in open_dic
    shutil.copy(dic_file+".bak",dic_file)
  [...snip...]
IOError: [Errno 13] Permission denied: '/Users/neuman/.autojump_py'

@jamilbk
Copy link

jamilbk commented Mar 29, 2011

I can confirm this as a bug as well. Using autojump 14 on OSX, but appears to be present in the latest git as well.

Same issue as luciferous.

@joelthelion
Copy link
Collaborator

I've just pushed a tentative fix. I can't test it because sudo is properly better configured under Arch, so I can't reproduce the problem. However I believe this patch should fix the problem. Can you confirm?

@jamilbk
Copy link

jamilbk commented Mar 31, 2011

I can't do any in-depth testing right now, but so far the issue looks fixed! ~/.autojump_py didn't change ownership after a sudo -s session.

Thanks!

@joelthelion
Copy link
Collaborator

Great! I'll close the issue for now; don't hesitate to re-open if needed.

I'll probably wait a week or so to make sure everything is ok, then I'll make a new release.

cbbrowne pushed a commit to cbbrowne/autojump that referenced this issue May 12, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants