From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3 09/12] syscalls/mount03: Copy setuid_test to execute instead of 'TEST FILE'
Date: Fri, 8 Dec 2017 11:43:02 +0100 [thread overview]
Message-ID: <20171208104302.GD13286@rei> (raw)
In-Reply-To: <87609hwlkr.fsf@e105922-lin.cambridge.arm.com>
Hi!
> >> case 5:
> >> /* Validate MS_NOSUID flag of mount call */
> >>
> >> - snprintf(file, PATH_MAX, "%ssetuid_test", path_name);
> >> - SAFE_FILE_PRINTF(cleanup, file, "TEST FILE");
> >> + TST_RESOURCE_COPY(cleanup, "mount03_setuid_test", path_name);
> >> + snprintf(file, PATH_MAX, "%smount03_setuid_test", path_name);
> >>
> >> SAFE_STAT(cleanup, file, &file_stat);
> >>
> >> @@ -291,9 +291,8 @@ int test_rwflag(int i, int cnt)
> >> /* reset the setup_uid */
> >> if (status)
> >> return 0;
> >> - else
> >> - return 1;
> >> }
> >> + return 1;
> >> }
> >> case 6:
> >> /* Validate MS_NOATIME flag of mount call */
> >> @@ -373,6 +372,10 @@ static void setup(void)
> >> strncpy(path, path_name, PATH_MAX);
> >> snprintf(path_name, PATH_MAX, "%s/%s/", path, mntpoint);
> >>
> >> + SAFE_MOUNT(cleanup, device, mntpoint, fs_type, 0, NULL);
> >> + TST_RESOURCE_COPY(cleanup, "mount03_setuid_test", path_name);
> >> + SAFE_UMOUNT(cleanup, mntpoint);
> >
> > I'm, a bit confused now, do we copy the file here in the setup or in the
> > actual test above? Surely we don't have to do both.
>
> In an earlier email you said -
>
> "... secondly you are supposed to use the TST_RESOURCE_COPY() macro
> instead of the function itself and it should be done once in the test
> setup as well as the code that sets the actual setuid bit."
>
> And now I'm confused as I updated the patch as per your request (or so I
> thought). Where's the disconnect?
As far as I can see, we do TST_RESOURCE_COPY() twice in this patch, once
in the test setup and once in the actual test, which is what confuses
me.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2017-12-08 10:43 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-04 16:36 [LTP] [PATCH v3 00/12] Collection of fixes Punit Agrawal
2017-12-04 16:36 ` [LTP] [PATCH v3 01/12] Move check_hugepage() helper to mem/lib Punit Agrawal
2017-12-05 8:52 ` Petr Vorel
2017-12-04 16:36 ` [LTP] [PATCH v3 02/12] thp: ensure hugetlbfs is available Punit Agrawal
2017-12-05 8:53 ` Petr Vorel
2017-12-04 16:36 ` [LTP] [PATCH v3 03/12] hugeshmctl01: Convert to LTP synchronisation primitives Punit Agrawal
2017-12-04 16:36 ` [LTP] [PATCH v3 04/12] hugeshmctl01: Fix warning about signed/unsigned comparison Punit Agrawal
2017-12-05 9:50 ` Petr Vorel
2017-12-04 16:36 ` [LTP] [PATCH v3 05/12] hugeshmctl02: Fix allocation size for odd number of hugepages Punit Agrawal
2017-12-04 16:36 ` [LTP] [PATCH v3 06/12] hugeshmget02: add missing SHM_HUGETLB flag on segment creation Punit Agrawal
2017-12-04 16:36 ` [LTP] [PATCH v3 07/12] sigwaitinfo01: fix race between sending and dequeueing RT signals Punit Agrawal
2017-12-04 16:36 ` [LTP] [PATCH v3 08/12] sigwaitinfo01: catch SEGV and report success for bad_address2 testcase Punit Agrawal
2017-12-08 10:28 ` Cyril Hrubis
2017-12-08 11:49 ` Punit Agrawal
2017-12-08 12:09 ` Cyril Hrubis
2017-12-04 16:36 ` [LTP] [PATCH v3 09/12] syscalls/mount03: Copy setuid_test to execute instead of 'TEST FILE' Punit Agrawal
2017-12-08 10:26 ` Cyril Hrubis
2017-12-08 10:39 ` Punit Agrawal
2017-12-08 10:43 ` Cyril Hrubis [this message]
2017-12-08 10:58 ` Punit Agrawal
2017-12-08 11:37 ` Cyril Hrubis
2017-12-08 11:50 ` Punit Agrawal
2017-12-04 16:36 ` [LTP] [PATCH v3 10/12] getdtablesize01: Handle ENFILE errno Punit Agrawal
2017-12-08 10:27 ` Cyril Hrubis
2017-12-08 10:41 ` Punit Agrawal
2017-12-04 16:36 ` [LTP] [PATCH v3 11/12] perf_event_open: Handle absence of PMU gracefully Punit Agrawal
2017-12-04 16:36 ` [LTP] [PATCH v3 12/12] hotplug/cpu_hotplug: Remove bashism disown from kill_pid() Punit Agrawal
2017-12-05 8:21 ` Petr Vorel
2017-12-05 10:20 ` Punit Agrawal
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=20171208104302.GD13286@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