Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/1] setregid: Fallback to `nogroup' group
Date: Fri, 4 May 2018 16:53:31 +0200	[thread overview]
Message-ID: <20180504145330.GD7653@rei> (raw)
In-Reply-To: <20180504082829.10973-1-pvorel@suse.cz>

Hi!
> -	GET_GID(nobody);
> +#define GET_GID_FALLBACK(group, group2) do { \
> +	junk = getgrnam(#group); \
> +	if (junk == NULL) { \
> +		tst_resm(TINFO, "%s not found, trying fallback %s", #group, #group2); \
> +		junk = getgrnam(#group2); \
> +		if (junk == NULL) { \
> +			tst_brkm(TBROK, NULL, "%s or %s must be a valid group", #group, #group2); \
> +		} \
> +	} \
> +	GID16_CHECK(junk->gr_gid, setregid, NULL); \
> +	group ## _gr = *(junk); \
> +} while (0)
> +
> +	GET_GID_FALLBACK(nobody, nogroup);

Uh this macros are ugly, but then the original is is ugly as well.

So let's get this in for the release to keep the amount of changes
minimal if you promise to clean it up after the release is finalized :-).

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2018-05-04 14:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04  8:28 [LTP] [PATCH 1/1] setregid: Fallback to `nogroup' group Petr Vorel
2018-05-04 14:53 ` Cyril Hrubis [this message]
2018-05-04 14:58   ` Petr Vorel
2018-05-04 15:02   ` Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180504145330.GD7653@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox