Mail archive
alpine-aports

Re: [alpine-aports] [PATCH] main/open-iscsi: musl fix, second try. fixes bug #4802. added default config file.

From: Natanael Copa <ncopa_at_alpinelinux.org>
Date: Thu, 11 Aug 2016 21:59:07 +0200

On Wed, 20 Jul 2016 22:57:52 +0200
Jann - Ove Risvik <jann.ove_at_usaklig.com> wrote:

> While making sure it didn't throw away legitimate unrecognised
> arguments I managed to break everything else... Not good. Didn't test
> it well enough. :/

I looked at it and it is easy to get it wrong.

> I've also included the default config file. Previously the package
> didn't include all the config files needed to work out of the box.

Where did you find the config file? Is there some copy in the sources
that we can use instead of shipping our own variant.


> ---
> main/open-iscsi/APKBUILD | 21 +--
> main/open-iscsi/iscsid.conf | 304 +++++++++++++++++++++++++++++++++++++++
> main/open-iscsi/musl-fixes.patch | 21 ++-
> 3 files changed, 332 insertions(+), 14 deletions(-)
> create mode 100644 main/open-iscsi/iscsid.conf

...

> diff --git a/main/open-iscsi/musl-fixes.patch b/main/open-iscsi/musl-fixes.patch
> index 910b485..f101eda 100644
> --- a/main/open-iscsi/musl-fixes.patch
> +++ b/main/open-iscsi/musl-fixes.patch
> _at_@ -29,9 +29,17 @@
> #include <dirent.h>
> #include <limits.h>
> #include <sys/stat.h>
> ---- ./usr/iscsiadm.c.orig
> -+++ ./usr/iscsiadm.c
> -_at_@ -2553,7 +2553,10 @@ main(int argc, char **argv)
> +--- ./usr/iscsiadm.c.orig 2012-05-21 02:59:24.000000000 +0200
> ++++ ./usr/iscsiadm.c 2016-07-20 22:00:54.430451701 +0200
> +_at_@ -2403,6 +2403,7 @@ main(int argc, char **argv)
> + int tpgt = PORTAL_GROUP_TAG_UNKNOWN, killiscsid=-1, do_show=0;
> + int packet_size=32, ping_count=1, ping_interval=0;
> + int do_discover = 0, sub_mode = -1;
> ++ int argerror = 0;
> + struct sigaction sa_old;
> + struct sigaction sa_new;
> + struct list_head ifaces;
> +_at_@ -2553,7 +2554,11 @@ main(int argc, char **argv)
> return 0;
> case 'h':
> usage(0);
> _at_@ -39,17 +47,18 @@
> +
> + case '?':
> + log_error("unrecognized character '%c'", optopt);
> ++ argerror = 1;
> + }
>
> if (name && value) {
> param = idbm_alloc_user_param(name, value);
> -_at_@ -2568,8 +2571,7 @@ main(int argc, char **argv)
> +_at_@ -2568,8 +2573,7 @@ main(int argc, char **argv)
> }
> }
>
> - if (optopt) {
> - log_error("unrecognized character '%c'", optopt);
> -+ if (opterr) {
> ++ if (argerror) {
> rc = ISCSI_ERR_INVAL;
> goto free_ifaces;
> - }
> +

This looks better.

I think I'll merge the fix/workaround for getopt into a single commit
and then add a default config in separate commit. The reason is that I
want to backport the fix to stable, but without adding the config.

Thanks!

-nc


---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Thu Aug 11 2016 - 21:59:07 GMT