From: chrubis@suse.cz
To: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Cc: vasily.isaenko@oracle.com, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 2/2] setregid02, setresuid03: inval_user fix
Date: Mon, 13 Jan 2014 18:38:55 +0100 [thread overview]
Message-ID: <20140113173855.GD1945@rei> (raw)
In-Reply-To: <1389605723-17937-2-git-send-email-stanislav.kholmanskikh@oracle.com>
Hi!
> diff --git a/testcases/kernel/syscalls/setresuid/setresuid03.c b/testcases/kernel/syscalls/setresuid/setresuid03.c
> index 9bb0abd..085ed7b 100644
> --- a/testcases/kernel/syscalls/setresuid/setresuid03.c
> +++ b/testcases/kernel/syscalls/setresuid/setresuid03.c
> @@ -70,10 +70,12 @@
> #include <errno.h>
> #include <sys/wait.h>
>
> +#include <compat_16.h>
> +
> char *TCID = "setresuid03";
>
> uid_t neg_one = -1;
> -uid_t inval_user = (USHRT_MAX - 2);
> +uid_t inval_user;
>
> /* flag to tell parent if child passed or failed. */
> int flag = 0;
> @@ -232,6 +234,10 @@ void setup(void)
> bin = *(getpwnam("bin"));
> bin_pw_uid = bin.pw_uid;
>
> + inval_user = GET_UNUSED_UID();
> + if (inval_user == -1)
> + tst_brkm(TBROK, NULL, "No free uid found");
> +
> /* Pause if that option was specified
> * TEST_PAUSE contains the code to fork the test with the -i option.
> * You want to make sure you do this before you create your temporary
Hmm, the setresuid03 did not fail because the EPERM check kicks in even
before the check for correct uid/gid. Which should probably be fixed
because there does not seem to be a setresuid test for invalid values
that would actually excercise such checks, but that can be fixed after
the release.
Thanks for the patches, I will commit them right after packages are
build and I have tested that everything is fine.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2014-01-13 17:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <52CFC6D1.4060006@oracle.com>
2014-01-13 9:35 ` [LTP] [PATCH 1/2] lib: tst_get_unused_uid, tst_get_unused_gid Stanislav Kholmanskikh
2014-01-13 17:32 ` chrubis
2014-01-13 9:35 ` [LTP] [PATCH 2/2] setregid02, setresuid03: inval_user fix Stanislav Kholmanskikh
2014-01-13 17:38 ` chrubis [this message]
[not found] ` <52D4F37C.4050409@oracle.com>
2014-01-14 15:05 ` chrubis
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=20140113173855.GD1945@rei \
--to=chrubis@suse.cz \
--cc=ltp-list@lists.sourceforge.net \
--cc=stanislav.kholmanskikh@oracle.com \
--cc=vasily.isaenko@oracle.com \
/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