From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] safe_setuid: skip if testing on CIFS
Date: Mon, 13 May 2019 16:34:13 +0200 [thread overview]
Message-ID: <20190513143413.GA4568@dell5510> (raw)
In-Reply-To: <20190510043845.4977-1-xzhou@redhat.com>
Hi Murphy,
> As CIFS is not supporting setuid operations.
Any reference to this?
fs/cifs/cifsfs.c and other parts of kernel cifs works with CIFS_MOUNT_SET_UID.
Also samba_setreuid() from lib/util/setid.c from samba git (I guess used in
samba libraries works with SYS_setreuid syscall or setreuid() libc wrapper.
What am I missing?
> diff --git a/lib/tst_safe_macros.c b/lib/tst_safe_macros.c
> index 0e59a3f98..36941ec0b 100644
> --- a/lib/tst_safe_macros.c
> +++ b/lib/tst_safe_macros.c
> @@ -111,6 +111,7 @@ int safe_setreuid(const char *file, const int lineno,
> uid_t ruid, uid_t euid)
> {
> int rval;
> + long fs_type;
> rval = setreuid(ruid, euid);
> if (rval == -1) {
> @@ -119,6 +120,13 @@ int safe_setreuid(const char *file, const int lineno,
> (long)ruid, (long)euid);
> }
> + fs_type = tst_fs_type(".");
> + if (fs_type == TST_CIFS_MAGIC) {
> + tst_brk_(file, lineno, TCONF,
> + "setreuid is not supported on %s filesystem",
> + tst_fs_type_name(fs_type));
> + }
I guess this check should be before setreuid() As it's in safe_seteuid() and
safe_setuid()
> +
> return rval;
> }
Kind regards,
Petr
next prev parent reply other threads:[~2019-05-13 14:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-10 4:38 [LTP] [PATCH] safe_setuid: skip if testing on CIFS Murphy Zhou
2019-05-13 14:34 ` Petr Vorel [this message]
2019-05-13 20:13 ` Steve French
2019-05-14 12:38 ` Murphy Zhou
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=20190513143413.GA4568@dell5510 \
--to=pvorel@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