From: Petr Lautrbach <plautrba@redhat.com>
To: Stephen Smalley <stephen.smalley.work@gmail.com>,
selinux@vger.kernel.org
Cc: jwcart2@gmail.com, omosnace@redhat.com, paul@paul-moore.com,
perfinion@gentoo.org,
Stephen Smalley <stephen.smalley.work@gmail.com>
Subject: Re: [PATCH] sandbox/seunshare: fix error checking for setfsuid()
Date: Thu, 14 May 2026 14:44:55 +0200 [thread overview]
Message-ID: <87y0hm6tyw.fsf@redhat.com> (raw)
In-Reply-To: <20260512193553.752163-1-stephen.smalley.work@gmail.com>
Stephen Smalley <stephen.smalley.work@gmail.com> writes:
> setfsuid() doesn't reliably set errno or return anything indicating
> an error.
>
> Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Acked-by: Petr Lautrbach <lautrbach@redhat.com>
> ---
> sandbox/seunshare.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sandbox/seunshare.c b/sandbox/seunshare.c
> index 17a727e7..b9c85bf2 100644
> --- a/sandbox/seunshare.c
> +++ b/sandbox/seunshare.c
> @@ -858,8 +858,8 @@ int main(int argc, char **argv) {
> /* Changing fsuid is usually required when user-specified directory is
> * on an NFS mount. It's also desired to avoid leaking info about
> * existence of the files not accessible to the user. */
> - if (((uid_t)setfsuid(uid) != 0) && (errno != 0)) {
> - fprintf(stderr, _("Error: unable to setfsuid %m\n"));
> + if ((uid_t)setfsuid(uid) != 0) {
> + fprintf(stderr, _("Error: unable to setfsuid\n"));
>
> return -1;
> }
> --
> 2.54.0
next prev parent reply other threads:[~2026-05-14 12:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 19:35 [PATCH] sandbox/seunshare: fix error checking for setfsuid() Stephen Smalley
2026-05-14 12:44 ` Petr Lautrbach [this message]
2026-05-15 14:08 ` Petr Lautrbach
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=87y0hm6tyw.fsf@redhat.com \
--to=plautrba@redhat.com \
--cc=jwcart2@gmail.com \
--cc=omosnace@redhat.com \
--cc=paul@paul-moore.com \
--cc=perfinion@gentoo.org \
--cc=selinux@vger.kernel.org \
--cc=stephen.smalley.work@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.