linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Shawn Landden <shawn-01I/ocv1qBBILuwUvNxBeQ@public.gmane.org>,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH] credential syscalls only effect calling thread
Date: Sun, 22 Mar 2015 15:38:27 +0100	[thread overview]
Message-ID: <550ED3E3.3000202@gmail.com> (raw)
In-Reply-To: <1426971044-37980-1-git-send-email-shawn-01I/ocv1qBBILuwUvNxBeQ@public.gmane.org>

Hi Shawn

Thanks for the patch. By chance, I've just been doing some work
on updating the pages regarding exactly this point. My patches
go into rather more detail though, and include a new page,
nptl(7), that foes into some of the details. I'll CC you on
my request for review of that page, in case you'd like to make 
some comments.

Cheers,

Michael


On 03/21/2015 09:50 PM, Shawn Landden wrote:
> Signed-off-by: Shawn Landden <shawn-01I/ocv1qBBILuwUvNxBeQ@public.gmane.org>
> ---
>  man2/seteuid.2   | 4 ++++
>  man2/setfsgid.2  | 4 ++++
>  man2/setfsuid.2  | 4 ++++
>  man2/setgid.2    | 4 ++++
>  man2/setresuid.2 | 4 ++++
>  man2/setreuid.2  | 4 ++++
>  man2/setuid.2    | 4 ++++
>  7 files changed, 28 insertions(+)
> 
> diff --git a/man2/seteuid.2 b/man2/seteuid.2
> index 4690fd6..d482570 100644
> --- a/man2/seteuid.2
> +++ b/man2/seteuid.2
> @@ -138,6 +138,10 @@ are implemented as library functions that call, respectively,
>  .BR setreuid (2)
>  and
>  .BR setresgid (2).
> +
> +The syscall only sets the credentials of the calling thread. The glibc wrapper
> +sets up a signal handler so that it effects all threads. This means that you
> +can use the syscall directly to have differn't credentials on differn't threads.
>  .SH SEE ALSO
>  .BR geteuid (2),
>  .BR setresuid (2),
> diff --git a/man2/setfsgid.2 b/man2/setfsgid.2
> index d1d021d..1451b69 100644
> --- a/man2/setfsgid.2
> +++ b/man2/setfsgid.2
> @@ -120,6 +120,10 @@ least,
>  should be returned when the call fails (because the caller lacks the
>  .B CAP_SETGID
>  capability).
> +
> +The syscall only sets the credentials of the calling thread. The glibc wrapper
> +sets up a signal handler so that it effects all threads. This means that you
> +can use the syscall directly to have differn't credentials on differn't threads.
>  .SH SEE ALSO
>  .BR kill (2),
>  .BR setfsuid (2),
> diff --git a/man2/setfsuid.2 b/man2/setfsuid.2
> index 57b125e..e04ad78 100644
> --- a/man2/setfsuid.2
> +++ b/man2/setfsuid.2
> @@ -128,6 +128,10 @@ least,
>  should be returned when the call fails (because the caller lacks the
>  .B CAP_SETUID
>  capability).
> +
> +The syscall only sets the credentials of the calling thread. The glibc wrapper
> +sets up a signal handler so that it effects all threads. This means that you
> +can use the syscall directly to have differn't credentials on differn't threads.
>  .SH SEE ALSO
>  .BR kill (2),
>  .BR setfsgid (2),
> diff --git a/man2/setgid.2 b/man2/setgid.2
> index d9cccd5..0500961 100644
> --- a/man2/setgid.2
> +++ b/man2/setgid.2
> @@ -80,6 +80,10 @@ supporting 32-bit IDs.
>  The glibc
>  .BR setgid ()
>  wrapper function transparently deals with the variation across kernel versions.
> +
> +The syscall only sets the credentials of the calling thread. The glibc wrapper
> +sets up a signal handler so that it effects all threads. This means that you
> +can use the syscall directly to have differn't credentials on differn't threads.
>  .SH SEE ALSO
>  .BR getgid (2),
>  .BR setegid (2),
> diff --git a/man2/setresuid.2 b/man2/setresuid.2
> index 99ab94f..eb97a9d 100644
> --- a/man2/setresuid.2
> +++ b/man2/setresuid.2
> @@ -129,6 +129,10 @@ The glibc
>  and
>  .BR setresgid ()
>  wrapper functions transparently deal with the variations across kernel versions.
> +
> +The syscall only sets the credentials of the calling thread. The glibc wrapper
> +sets up a signal handler so that it effects all threads. This means that you
> +can use the syscall directly to have differn't credentials on differn't threads.
>  .SH SEE ALSO
>  .BR getresuid (2),
>  .BR getuid (2),
> diff --git a/man2/setreuid.2 b/man2/setreuid.2
> index c6597e9..844c5c4 100644
> --- a/man2/setreuid.2
> +++ b/man2/setreuid.2
> @@ -191,6 +191,10 @@ The glibc
>  and
>  .BR setregid ()
>  wrapper functions transparently deal with the variations across kernel versions.
> +
> +The syscall only sets the credentials of the calling thread. The glibc wrapper
> +sets up a signal handler so that it effects all threads. This means that you
> +can use the syscall directly to have differn't credentials on differn't threads.
>  .SH SEE ALSO
>  .BR getgid (2),
>  .BR getuid (2),
> diff --git a/man2/setuid.2 b/man2/setuid.2
> index c6f870e..6a90ae0 100644
> --- a/man2/setuid.2
> +++ b/man2/setuid.2
> @@ -142,6 +142,10 @@ supporting 32-bit IDs.
>  The glibc
>  .BR setuid ()
>  wrapper function transparently deals with the variation across kernel versions.
> +
> +The syscall only sets the credentials of the calling thread. The glibc wrapper
> +sets up a signal handler so that it effects all threads. This means that you
> +can use the syscall directly to have differn't credentials on differn't threads.
>  .SH SEE ALSO
>  .BR getuid (2),
>  .BR seteuid (2),
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2015-03-22 14:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-21 20:50 [PATCH] credential syscalls only effect calling thread Shawn Landden
     [not found] ` <1426971044-37980-1-git-send-email-shawn-01I/ocv1qBBILuwUvNxBeQ@public.gmane.org>
2015-03-22 14:38   ` Michael Kerrisk (man-pages) [this message]

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=550ED3E3.3000202@gmail.com \
    --to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=shawn-01I/ocv1qBBILuwUvNxBeQ@public.gmane.org \
    /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;
as well as URLs for NNTP newsgroup(s).