~alpine/aports

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] gnupg-scdaemon: fix pre-install group add

Hunter Blanks <hblanks@artifex.org>
Details
Message ID
<20200725162955.87130-1-hblanks@artifex.org>
DKIM signature
missing
Download raw message
Patch: +4 -1
gnupg-scdaemon fails if /etc/group already contains the group
gnupg. Fix this by checking first if the group exists before
trying to add it.

Example of the bug follows:
  # apk add gnupg-scdaemon
  ...
  Executing gnupg-scdaemon-2.2.20-r0.pre-install
  OK: 26 MiB in 44 packages
  # grep gnupg /etc/group
  gnupg:x:101:
  # apk del gnupg-scdaemon
  ...
  # apk add gnupg-scdaemon
  ...
  Executing gnupg-scdaemon-2.2.20-r0.pre-install
  ERROR: gnupg-scdaemon-2.2.20-r0.pre-install: script exited with error 1
  1 error; 26 MiB in 44 packages
  # addgroup -S gnupg
  addgroup: group 'gnupg' in use
---
 main/gnupg/gnupg-scdaemon.pre-install | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/main/gnupg/gnupg-scdaemon.pre-install b/main/gnupg/gnupg-scdaemon.pre-install
index 8d8262ceea..9e6e5ed01d 100644
--- a/main/gnupg/gnupg-scdaemon.pre-install
+++ b/main/gnupg/gnupg-scdaemon.pre-install
@@ -1,2 +1,5 @@
#!/bin/sh
addgroup -S gnupg 2> /dev/null
if ! grep -q -E '^gnupg:' /etc/group
then
    addgroup -S gnupg 2> /dev/null
fi
-- 
2.25.1
Details
Message ID
<20200725180705.12fb87c2@enterprise>
In-Reply-To
<20200725162955.87130-1-hblanks@artifex.org> (view parent)
DKIM signature
missing
Download raw message
On Sat, 25 Jul 2020 09:29:55 -0700
Hunter Blanks <hblanks@artifex.org> wrote:

> gnupg-scdaemon fails if /etc/group already contains the group
> gnupg. Fix this by checking first if the group exists before
> trying to add it.
> 
> Example of the bug follows:
>   # apk add gnupg-scdaemon
>   ...
>   Executing gnupg-scdaemon-2.2.20-r0.pre-install
>   OK: 26 MiB in 44 packages
>   # grep gnupg /etc/group
>   gnupg:x:101:
>   # apk del gnupg-scdaemon
>   ...
>   # apk add gnupg-scdaemon
>   ...
>   Executing gnupg-scdaemon-2.2.20-r0.pre-install
>   ERROR: gnupg-scdaemon-2.2.20-r0.pre-install: script exited with
> error 1 1 error; 26 MiB in 44 packages
>   # addgroup -S gnupg
>   addgroup: group 'gnupg' in use
> ---
>  main/gnupg/gnupg-scdaemon.pre-install | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/main/gnupg/gnupg-scdaemon.pre-install
> b/main/gnupg/gnupg-scdaemon.pre-install index 8d8262ceea..9e6e5ed01d
> 100644 --- a/main/gnupg/gnupg-scdaemon.pre-install
> +++ b/main/gnupg/gnupg-scdaemon.pre-install
> @@ -1,2 +1,5 @@
>  #!/bin/sh
> -addgroup -S gnupg 2> /dev/null
> +if ! grep -q -E '^gnupg:' /etc/group
> +then
> +    addgroup -S gnupg 2> /dev/null
> +fi

Just add an 'exit 0' at the end of script like pre-install scripts
shoul ddo. Also you need to bump pkgrel so your changes take effect.

And please open it as a merge request on
gitlab.alpinelinux.org/alpine/aports
Reply to thread Export thread (mbox)