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

GPGEditOptions Broken ? #89

Closed
FractalWire opened this issue Apr 10, 2018 · 4 comments
Closed

GPGEditOptions Broken ? #89

FractalWire opened this issue Apr 10, 2018 · 4 comments
Labels
Milestone

Comments

@FractalWire
Copy link

Hi,

I have an issue with GPGEditOptions.
When I called it and then save it, I got an error saying something like :

The recipient "encrypt" is not in your public keyring !
The recipient "armor" is not in your public keyring !

If I try to save the file, I've got a warning stating I have to edit GPGEditRecipients, which give a content similar to that :

GPG: Please edit the list of recipients, one recipient per line.
GPG: Unknown recipients have a prepended "!".
GPG: Lines beginning with "GPG:" are removed automatically.
GPG: Data after recipients between and including "(" and ")" is ignored.
GPG: Closing this buffer commits changes.
GPG: ----------------------------------------------------------------------
myname [email protected] (ID: 0xC1BDCB497E0B9CD6 created at mar. 10 avril 2018 19:40:18 CEST)
GPG: ----------------------------------------------------------------------
GPG: Please edit the list of recipients, one recipient per line.
GPG: Unknown recipients have a prepended "!".
GPG: Lines beginning with "GPG:" are removed automatically.
GPG: Data after recipients between and including "(" and ")" is ignored.
GPG: Closing this buffer commits changes.
GPG: ----------------------------------------------------------------------
myname [email protected] (ID: 0xC1BDCB497E0B9CD6 created at mar. 10 avril 2018 19:40:18 CEST)
!encrypt
!armor

So, somehow, GPGEditOptions and GPGEditRecipients might be mixed up...

@jamessan
Copy link
Owner

Can you give some more concrete steps, please? Especially regarding the contents of the GPGEditOptions buffer.

@FractalWire
Copy link
Author

Hi sorry for the late answer.
Yes I was a bit lazy when I report the issue.

So here is the full steps :

  1. Create a file test.asc
  2. save and exit
  3. edit the file again and invoke GPGEditOptions. It gives something like that :
GPG: Please edit the list of recipients, one recipient per line.
GPG: Unknown recipients have a prepended "!".
GPG: Lines beginning with "GPG:" are removed automatically.
GPG: Data after recipients between and including "(" and ")" is ignored.
GPG: Closing this buffer commits changes.
GPG: ----------------------------------------------------------------------
myname <[email protected]>	 	(ID: 0xC1BDCB497E0B9CD6 created at mar. 10 avril 2018 19:40:18 CEST)
GPG: ----------------------------------------------------------------------
GPG: THERE IS NO CHECK OF THE ENTERED OPTIONS!
GPG: YOU NEED TO KNOW WHAT YOU ARE DOING!
GPG: IF IN DOUBT, QUICKLY EXIT USING :x OR :bd.
GPG: Please edit the list of options, one option per line.
GPG: Please refer to the gpg documentation for valid options.
GPG: Lines beginning with "GPG:" are removed automatically.
GPG: Closing this buffer commits changes.
GPG: ----------------------------------------------------------------------
encrypt
armor

Both, the recipient and the options are present in the buffer.

  1. Without modifying anything, I try to save and close the buffer and I've got the following error :
The recipient "encrypt" is not in your public keyring !
The recipient "armor" is not in your public keyring !
  1. I now have 2 buffers opens :
  • 1 empty buffer named GPGOptions_PathToMyFile.asc (that need to be saved)
  • my original GPG file
  1. So I save and quit the empty buffer, Now my GPG file need saving
  2. ... so I try to save my GPG file but I've got an error :
The recipient "encrypt" is not in your public keyring !
The recipient "armor" is not in your public keyring !
Please use GPGEditRecipients to correct !!
  1. So I do that and here is the content of the buffer :
GPG: Please edit the list of recipients, one recipient per line.
GPG: Unknown recipients have a prepended "!".
GPG: Lines beginning with "GPG:" are removed automatically.
GPG: Data after recipients between and including "(" and ")" is ignored.
GPG: Closing this buffer commits changes.
GPG: ----------------------------------------------------------------------
myname <[email protected]>	 	(ID: 0xC1BDCB497E0B9CD6 created at mar. 10 avril 2018 19:40:18 CEST)
GPG: ----------------------------------------------------------------------
GPG: Please edit the list of recipients, one recipient per line.
GPG: Unknown recipients have a prepended "!".
GPG: Lines beginning with "GPG:" are removed automatically.
GPG: Data after recipients between and including "(" and ")" is ignored.
GPG: Closing this buffer commits changes.
GPG: ----------------------------------------------------------------------
myname <[email protected]>	 	(ID: 0xC1BDCB497E0B9CD6 created at mar. 10 avril 2018 19:40:18 CEST)
!encrypt
!armor

  1. now I clean up a bit, living only one myname <[email protected]> with its commentary, and I save and close the buffer
  2. I've now got 2 buffer :
  • 1 empty buffer named GPGRecipients_PathToMyFile.asc (that need to be saved)
  • my original GPG file
  1. So I save and close the empty buffer
  2. Finally, when trying to save and close my GPG file I've got the following error :
/bin/sh: -c: line 0: syntax error near unexpected token `('
Message could not be encrypted! (Press ENTER)
')`

And I'm forced to close without saving now.

@Joedang
Copy link

Joedang commented Jun 22, 2018

I think I'm experiencing the same/similar error. AFAICT, it's happening when we try to edit the options buffer.

Here's what I think may help...

  • I have GPG_TTY set, as described in the vim.org page.
  • I open an empty file, vim foo.gpg.
  • I'm presented with a recipients buffer and my empty file.
  • I enter something that GPG can use to uniquely identify me.
  • I save and exit the buffer.
  • GPGViewRecipients shows me and GPGViewOptions is empty.
  • I call GPGEditOptions.
  • I'm presented with GPGRecipients_GPGOptions_/home/joedang/foo.gpg, GPGOptions_/home/joedang/foo.gpg, and my empty file.
    screenshot_2018-06-21_18-24-52

This is where I think we're either getting confused or experiencing a bug.

  • I enter my name after line 6 of the top window.
  • I put the encrypt, armor, and sign options at the end.
  • I try to save end exit, but get E382: Cannot write, buftype option is set.
  • I quit and force-quit the two windows, respectively.
  • GPGViewOptions shows me my name and my options, while GPGViewRecipients has a totally unrelated key from my keyring (the Debian CD signing key) along with !encrypt and !armor.

Now, if I try something different...

  • I edit the recipients.
  • It shows me, the Debian key, !encrypt, and !armor.
  • I remove those superfluous lines.
  • GPGViewRecipients just shows me now.
  • GPGViewOptions still shows me and my options.
  • I do GPGEditOptions again.
  • I'm presented with the two windows as before, with the top one still showing my name and my options.
  • I remove my name.
  • I simply quit the buffer without saving.
  • GPGViewOptions now shows only the options.
  • GPGViewRecipients shows Debian key with !encrypt and !armor again.
  • I do GPGEditRecipients and change it back to my name.
  • Viewing the recipients and options shows what I'd expect them to be (my email for recipients, and my options for options).
  • If I do GPGEditOptions again it messes up the recipients again. (No editing or saving, just quitting those windows.)

So, maybe I don't understand how buffers are supposed to work, and quitting is the wrong thing to do. But, it seems like the plugin shouldn't be doing this. As long as the recipients and options are in the state they should be, the files save and open as I'd expect. But changing them really sucks because of this.

@jamessan
Copy link
Owner

Thanks for the report! This should be fixed now.

@jamessan jamessan added the bug label Jun 23, 2018
@jamessan jamessan added this to the 2.6.1 milestone Jun 23, 2018
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

3 participants