diff options
| -rw-r--r-- | changes/choose_one_gnupg | 1 | ||||
| -rw-r--r-- | src/leap/bitmask/services/soledad/soledadbootstrapper.py | 13 | 
2 files changed, 13 insertions, 1 deletions
| diff --git a/changes/choose_one_gnupg b/changes/choose_one_gnupg new file mode 100644 index 00000000..d759616b --- /dev/null +++ b/changes/choose_one_gnupg @@ -0,0 +1 @@ +  o Choose one gnupg binary path that is also not a symlink. Closes #3999.
\ No newline at end of file diff --git a/src/leap/bitmask/services/soledad/soledadbootstrapper.py b/src/leap/bitmask/services/soledad/soledadbootstrapper.py index 6731cc84..7968dd6a 100644 --- a/src/leap/bitmask/services/soledad/soledadbootstrapper.py +++ b/src/leap/bitmask/services/soledad/soledadbootstrapper.py @@ -321,7 +321,18 @@ class SoledadBootstrapper(AbstractBootstrapper):              gpgbin = os.path.join(                  get_path_prefix(), "..", "apps", "mail", "gpg")          else: -            gpgbin = which("gpg") +            try: +                gpgbin_options = which("gpg") +                # gnupg checks that the path to the binary is not a +                # symlink, so we need to filter those and come up with +                # just one option. +                for opt in gpgbin_options: +                    if not os.path.islink(opt): +                        gpgbin = opt +                        break +            except IndexError as e: +                logger.debug("Couldn't find the gpg binary!") +                logger.exception(e)          leap_check(gpgbin is not None, "Could not find gpg binary")          return gpgbin | 
