Re: Cannot edit existing password using vim (or gvim)
On 02/12/16 11:13, ads wrote: Thanks for the suggestion. I looked at strace, but couldn't see any obvious cause (no EPERM for example). I set up a new user where it all worked properly, so I started to try and find a difference, and realised that my normal userid uses gvim (echo $EDITOR --> gvim) while my new test user uses vim. So to make the straces comparable I switched to using vim for this task, but using vim I find works fine anyway. I don't really need to find out why gvim doesn't work since I have a good work-around, i.e. preface the pass edit command with EDITOR=vim. I think that gvim detaches by default, so when it "exits" pass saves the (unchanged) file. Then you edit the file but pass is long gone. There might be a flag you can set to make it "block" or stay in the foreground. That or use a different editor. ___ Password-Store mailing list Password-Store@lists.zx2c4.com https://lists.zx2c4.com/mailman/listinfo/password-store
Re: Cannot edit existing password using vim (or gvim)
Thanks for the suggestion. I looked at strace, but couldn't see any obvious cause (no EPERM for example). I set up a new user where it all worked properly, so I started to try and find a difference, and realised that my normal userid uses gvim (echo $EDITOR --> gvim) while my new test user uses vim. So to make the straces comparable I switched to using vim for this task, but using vim I find works fine anyway. I don't really need to find out why gvim doesn't work since I have a good work-around, i.e. preface the pass edit command with EDITOR=vim. ___ Password-Store mailing list Password-Store@lists.zx2c4.com https://lists.zx2c4.com/mailman/listinfo/password-store
Re: Cannot edit existing password using vim (or gvim)
On 01/12/2016 12:20, ads wrote: If I do mkdir /dev/shm/foo, then touch /dev/shm/foo/bar, the file bar gets written correctly. And what if you do "gvim /dev/shm/foo/bar" ? Is it possible that there is an apparmor policy for gvim, which is preventing it opening files under /dev ? Somebody else suggested setting nobackup in vim, and I have tried that (and nowritebackup too). No difference. I have also removed my .vimrc file and .vim directory, and no difference. I'm very puzzled. It might be useful to do an strace to see the actual system call it tried to do and the error it got back: strace -f pass edit 2>strace.out This will generate a ton of splurge in file strace.out, but if you search through it for EPERM somewhere near the end, or just before it prints the error message, it may give a clue. Regards, Brian. ___ Password-Store mailing list Password-Store@lists.zx2c4.com https://lists.zx2c4.com/mailman/listinfo/password-store
Re: Cannot edit existing password using vim (or gvim)
Hi, On Dec 1, 2016 10:53 AM, "ads"wrote: > > I apologise for re-opening this topic. I did not receive the reply kindly sent me by Renato Alves other than as part of a daily digest (I had only subscribed to digests) and I don't know how to simulate a reply to keep the old thread going. > > My original query was as follows: > >> When I try to edit an existing password using vim, when it comes time to >> save (I enter :w as a vim command) I get a message >> "/dev/shm/pass.tQVSIzXmX17hI/McsB5-test-pass.txt" E212: Cannot open file >> for writing >> >> I'm sure I used to be able to edit passwords, but I can't work out why I >> can't save to /dev/shm. Does anybody have any ideas? >> >> Steps to recreate: >> >> 1) pass add test-pass (followed by entering the password twice) >> 2) pass show test-pass works fine and displays password from previous >> step >> 3) pass edit test-pass >> >> opens instance of gvim, so I make a change and :w and I get the error >> message above. >> >> >> Notes: >> >> >>1. mount | grep "shm" gives >>tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) >>2. df -h | grep shm gives >>tmpfs 3.8G 152M 3.7G 4% /dev/shm i.e. we're not out >>of temp disk space (or indeed inodes, checked separately) >>3. crontab -e works, so saving to a temporary file seems to work >>4. with EDITOR set to nano, it seems to work > > > Renato Alves replied: > >> Most likely permissions. Try: ls -ld /dev/shm >> > When I try ls -ld /dev/shm I get >> >> >> drwxrwxrwt 2 root root 260 Dec 1 09:19 /dev/shm >> >> which looks good to me. >> > If I try touch /dev/shm/something then I get no message and something is created in the /dev/shm directory. > > If I try vim /dev/shm/something-else, add a line, then :wq, it all works fine (the something-else file is created). > > As I said above, if I do pass edit test-pass, then when I do :w I get e.g. message > > "/dev/shm/pass.tQVSIzXmX17hI/McsB5-test-pass.txt" E212: Cannot open file > for writing > > but if instead of :w I do :saveas /dev/shm/anything then it saves fine, but of course the original password file is not changed. What if you try to write in /dev/shm/foo/bar? > > It seems to be only when I try to write to the temporary filename that is created as part of the process of executing pass edit etc. that I am blocked from writing. > > Sorry to go on at such length. If anybody has a clue why this might be happening, I would be grateful to know. > > Thanks. > > ___ > Password-Store mailing list > Password-Store@lists.zx2c4.com > https://lists.zx2c4.com/mailman/listinfo/password-store > ___ Password-Store mailing list Password-Store@lists.zx2c4.com https://lists.zx2c4.com/mailman/listinfo/password-store
Cannot edit existing password using vim (or gvim)
I apologise for re-opening this topic. I did not receive the reply kindly sent me by Renato Alves other than as part of a daily digest (I had only subscribed to digests) and I don't know how to simulate a reply to keep the old thread going. My original query was as follows: When I try to edit an existing password using vim, when it comes time to save (I enter :w as a vim command) I get a message "/dev/shm/pass.tQVSIzXmX17hI/McsB5-test-pass.txt" E212: Cannot open file for writing I'm sure I used to be able to edit passwords, but I can't work out why I can't save to /dev/shm. Does anybody have any ideas? Steps to recreate: 1) pass add test-pass (followed by entering the password twice) 2) pass show test-pass works fine and displays password from previous step 3) pass edit test-pass opens instance of gvim, so I make a change and :w and I get the error message above. Notes: 1. mount | grep "shm" gives tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) 2. df -h | grep shm gives tmpfs 3.8G 152M 3.7G 4% /dev/shm i.e. we're not out of temp disk space (or indeed inodes, checked separately) 3. crontab -e works, so saving to a temporary file seems to work 4. with EDITOR set to nano, it seems to work Renato Alves replied: Most likely permissions. Try: ls -ld /dev/shm When I try ls -ld /dev/shm I get drwxrwxrwt 2 root root 260 Dec 1 09:19 /dev/shm which looks good to me. If I try touch /dev/shm/something then I get no message and something is created in the /dev/shm directory. If I try vim /dev/shm/something-else, add a line, then :wq, it all works fine (the something-else file is created). As I said above, if I do pass edit test-pass, then when I do :w I get e.g. message "/dev/shm/pass.tQVSIzXmX17hI/McsB5-test-pass.txt" E212: Cannot open file for writing but if instead of :w I do :saveas /dev/shm/anything then it saves fine, but of course the original password file is not changed. It seems to be only when I try to write to the temporary filename that is created as part of the process of executing pass edit etc. that I am blocked from writing. Sorry to go on at such length. If anybody has a clue why this might be happening, I would be grateful to know. Thanks. ___ Password-Store mailing list Password-Store@lists.zx2c4.com https://lists.zx2c4.com/mailman/listinfo/password-store
Cannot edit existing password using vim (or gvim)
When I try to edit an existing password using vim, when it comes time to save (I enter :w as a vim command) I get a message "/dev/shm/pass.tQVSIzXmX17hI/McsB5-test-pass.txt" E212: Cannot open file for writing "/dev/shm/pass.BrDRETCxY0V0s/DlvET-visa...3603.txt" E212: Cannot open file for writing". I'm sure I used to be able to edit passwords, but I can't work out why I can't save to /dev/shm. Does anybody have any ideas? Steps to recreate: 1) pass add test-pass (followed by entering the password twice) 2) pass show test-pass N.B. works fine and displays password from previous step 3) pass edit test-pass opens instance of gvim, so I make a change and :w and I get the error message above. Notes: 1. mount | grep "shm" gives tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) 2. df -h | grep shm gives tmpfs 3.8G 152M 3.7G 4% /dev/shm i.e. we're not out of temp disk space 3. crontab -e works, so saving to a temporary file seems to work 4. with EDITOR set to nano, it seems to work Thanks, A ___ Password-Store mailing list Password-Store@lists.zx2c4.com https://lists.zx2c4.com/mailman/listinfo/password-store