Skip to content

OSError: No such file or directory (Both Files in command exists) #101

Open

Description

@F9Alejandro
FangMacBookPro:~ fang_shadow$ pius-keyring-mgr build -r test.gpg -b PGP_SIGN_PARTY.mbox/mbox
Found 1 keys in mbox: 1 fingerprints and 0 full keys
Traceback (most recent call last):
  File "/usr/local/bin/pius-keyring-mgr", line 638, in <module>
    main()
  File "/usr/local/bin/pius-keyring-mgr", line 630, in main
    kb.get_all_keys(keys)
  File "/usr/local/bin/pius-keyring-mgr", line 341, in get_all_keys
    if self.have_key(key['keyid']):
  File "/usr/local/bin/pius-keyring-mgr", line 295, in have_key
    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Using Relative seems to be unable to find a certain file or another,

FangMacBookPro:~ fang_shadow$ pius-keyring-mgr build -r /users/fang_shadow/test.gpg -b /users/fang_shadow/PGP_SIGN_PARTY.mbox/mbox
Found 1 keys in mbox: 1 fingerprints and 0 full keys
Traceback (most recent call last):
  File "/usr/local/bin/pius-keyring-mgr", line 638, in <module>
    main()
  File "/usr/local/bin/pius-keyring-mgr", line 630, in main
    kb.get_all_keys(keys)
  File "/usr/local/bin/pius-keyring-mgr", line 341, in get_all_keys
    if self.have_key(key['keyid']):
  File "/usr/local/bin/pius-keyring-mgr", line 295, in have_key
    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

same goes for when using absolute, is there something for python I am missing? some sort of compatibility?

Activity

  1. F9Alejandro commented on Sep 10, 2018

    @F9Alejandro
    Author

    Found the issue, it had to do with the default location of gpg (wish when pius setup.py is ran it gets the gpg location from PATH or can be read from a .pius-keyring-mgr config type config)

    EDIT: Found a way to have the path for gpg and gpg2 to be found (gpg2 will be the first choice and gpg is second, and then /usr/bin/gpg if none are found), will work on getting a pull request in place that reflects the changes

    EDIT 2: #103 Should fix this for others, it is in the 3_work for the future release.

  2. jaymzh commented on Sep 21, 2018

    @jaymzh
    Owner

    You can pass in -g to specify the path. I'm happy to have per-OS hard-coded lists, but given we're a security application dealing with private keys, we will not execute gpg out random PATHs.

  3. F9Alejandro commented on Sep 21, 2018

    @F9Alejandro
    Author

    There is hard coded paths for linux and unix, a binary constant for /usr/bin, /usr/local/bin, /usr/sbin, /usr/local/sbin, /bin, and /sbin. which should cover both OSes and where they like to install to, meaning it is no longer a random path but will check in normal binary paths.

    Normal which function can be used for windows, then just check the string returned to see if it contains "gpg4win..\gnupg\bin" in it, if it does then it is a valid install and should be used as this is what gpg4win uses in system path. (I uses gpg4win on my windows computer, and gpg toolset for macOS. I also have a little linux server box for testing purposes and doesn't have remote access unless given access via ssh v2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions