SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.03k stars 1.23k forks source link

GnuPG package missing pinentry symlink in /usr/local/bin #6165

Closed aurrak closed 3 weeks ago

aurrak commented 4 months ago

Is this a new Bug?

Package Name

GnuPG

Package Version

2.4.2-6

Device Model

DS920+

Device Architecture

x86_64

Firmware Version

DSM 7.2.1-69057 Update 5

What happened?

After installing the SynoCommunity GnuPG package, pinentry is not added to /usr/local/bin like the rest of the gpg* binaries.

Therefore, subsequent gpg --expert --full-gen-key produces error like the following:

gpg: agent_genkey failed: No pinentry
Key generation failed: No pinentry

Workaround: Manually create a symlink that points to /var/packages/gnupg/target/bin/pinentry

❯ ls -al /usr/local/bin/pinentry
lrwxrwxrwx root root 39 B Mon Jul  1 00:43:39 2024  /usr/local/bin/pinentry ⇒ /var/packages/gnupg/target/bin/pinentry

Reproduction steps

  1. Install GnuPG package from Package Center
  2. Confirm package is installed successfully by running which gpg (pointing to /usr/local/bin) and gpg --version (2.4.2).
  3. Try to create key by running gpg --expert --full-gen-key

Install Log

2024/07/01 00:42:24     install gnupg 2.4.2-6 Begin preinst
2024/07/01 00:42:24     Begin load_variables_from_file
2024/07/01 00:42:24     End load_variables_from_file
2024/07/01 00:42:24     Begin initialize_variables
2024/07/01 00:42:24     End initialize_variables
2024/07/01 00:42:24     ===> Step preinst. STATUS=INSTALL USER= GROUP= SHARE_PATH=
2024/07/01 00:42:24     install gnupg 2.4.2-6 End preinst ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/mkdir -p /volume1/@appstore/gnupg -m 755
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/mkdir -p /volume1/@appstore/gnupg -m 755 ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/rm -rf /volume1/@appstore/gnupg
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/rm -rf /volume1/@appstore/gnupg ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/mv -f /volume1/@tmp/synopkg/install.egUFZk/package /volume1/@appstore/gnupg
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/mv -f /volume1/@tmp/synopkg/install.egUFZk/package /volume1/@appstore/gnupg ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/rm -rf /var/packages/gnupg
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/rm -rf /var/packages/gnupg ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/mkdir -p /var/packages/gnupg -m 755
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/mkdir -p /var/packages/gnupg -m 755 ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/touch /var/packages/gnupg/installing
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/touch /var/packages/gnupg/installing ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/mv -f /volume1/@tmp/synopkg/install.egUFZk/INFO /var/packages/gnupg/INFO
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/mv -f /volume1/@tmp/synopkg/install.egUFZk/INFO /var/packages/gnupg/INFO ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/rm -rf /var/packages/gnupg/scripts
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/rm -rf /var/packages/gnupg/scripts ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/mv -f /volume1/@tmp/synopkg/install.egUFZk/scripts /var/packages/gnupg/scripts
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/mv -f /volume1/@tmp/synopkg/install.egUFZk/scripts /var/packages/gnupg/scripts ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/rm -rf /var/packages/gnupg/WIZARD_UIFILES
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/rm -rf /var/packages/gnupg/WIZARD_UIFILES ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/mv -f /volume1/@tmp/synopkg/install.egUFZk/WIZARD_UIFILES /var/packages/gnupg/WIZARD_UIFILES
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/mv -f /volume1/@tmp/synopkg/install.egUFZk/WIZARD_UIFILES /var/packages/gnupg/WIZARD_UIFILES ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/rm -rf /var/packages/gnupg/conf
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/rm -rf /var/packages/gnupg/conf ret=[0]
2024/07/01 00:42:25     install gnupg 2.4.2-6 Begin /bin/mv -f /volume1/@tmp/synopkg/install.egUFZk/conf /var/packages/gnupg/conf
2024/07/01 00:42:25     install gnupg 2.4.2-6 End /bin/mv -f /volume1/@tmp/synopkg/install.egUFZk/conf /var/packages/gnupg/conf ret=[0]
2024/07/01 00:42:32     install gnupg 2.4.2-6 Begin postinst
2024/07/01 00:42:32     Begin load_variables_from_file
2024/07/01 00:42:32     End load_variables_from_file
2024/07/01 00:42:32     Begin initialize_variables
2024/07/01 00:42:32     End initialize_variables
2024/07/01 00:42:32     ===> Step postinst. STATUS=INSTALL USER= GROUP= SHARE_PATH=
2024/07/01 00:42:32     Begin save_wizard_variables
2024/07/01 00:42:32     End save_wizard_variables
2024/07/01 00:42:32     Begin syno_sync_var_folder
2024/07/01 00:42:32     End syno_sync_var_folder
2024/07/01 00:42:32     install gnupg 2.4.2-6 End postinst ret=[0]
2024/07/01 00:42:33     install gnupg 2.4.2-6 Begin start-stop-status start
2024/07/01 00:42:33     install gnupg 2.4.2-6 End start-stop-status start ret=[0]

Service Log

No response

Other Logs

No response

hgy59 commented 4 months ago

@aurrak does it work with this link?

When I execute gpg --expert --full-gen-key as root, everything works without such a link and there is no error for missing pinentry. Only execution as regular user gives the error.

BTW I used the full path /var/packages/gnupg/target/bin/gpg since /bin/gpg is an older version installed. The key gen as root works for both, /bin/gpg and gpp of the package (and there is no other pinentry executable except the one of the gnupg package.

We already had a related issue #5150 that was fixed by #5777.

aurrak commented 4 months ago

@aurrak does it work with this link?

When I execute gpg --expert --full-gen-key as root, everything works without such a link and there is no error for missing pinentry. Only execution as regular user gives the error.

BTW I used the full path /var/packages/gnupg/target/bin/gpg since /bin/gpg is an older version installed. The key gen as root works for both, /bin/gpg and gpp of the package (and there is no other pinentry executable except the one of the gnupg package.

We already had a related issue #5150 that was fixed by #5777.

Oh wow, you are right. I just tried removing that symlink and the same command somehow works for both root and regular user still.

I could have sworn that it wasn't working last night until I manually created that pinentry symlink. I am not sure why it's all working fine now, but I guess that's good news? 👍

mreid-tt commented 3 weeks ago

@aurrak, just circling back on some older tickets. Do you still require assistance or should this issue be closed?

aurrak-hws commented 3 weeks ago

@mreid-tt This issue can be closed now, thanks for the follow up!