All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Steve Dickson <steved@redhat.com>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/1] rpcbind: drop supplemental groups
Date: Thu, 08 Mar 2012 15:55:49 -0500	[thread overview]
Message-ID: <4F591CD5.7070102@RedHat.com> (raw)
In-Reply-To: <1331217450-20798-1-git-send-email-steved@redhat.com>



On 03/08/2012 09:37 AM, Steve Dickson wrote:
> Drop out of the 'root' group to ensure the process does
> not have any access to writable or readable files
> to that group.
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed....

steved.
> ---
>  src/rpcbind.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/src/rpcbind.c b/src/rpcbind.c
> index 24e069b..9a0504d 100644
> --- a/src/rpcbind.c
> +++ b/src/rpcbind.c
> @@ -236,6 +236,10 @@ main(int argc, char *argv[])
>                          syslog(LOG_ERR, "setgid to '%s' (%d) failed: %m", id, p->pw_gid);
>                          exit(1);
>                  }
> +		if (setgroups(0, NULL) == -1) {
> +			syslog(LOG_ERR, "dropping supplemental groups failed: %m");
> +			exit(1);
> +		}
>  		if (setuid(p->pw_uid) == -1) {
>  			syslog(LOG_ERR, "setuid to '%s' (%d) failed: %m", id, p->pw_uid);
>  			exit(1);

      reply	other threads:[~2012-03-08 20:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 14:37 [PATCH 1/1] rpcbind: drop supplemental groups Steve Dickson
2012-03-08 20:55 ` Steve Dickson [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=4F591CD5.7070102@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.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 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.