rpcbind: drop supplemental groups
Subsystems (2)
PATCH 1/1 rpcbind: drop supplemental groups
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 <[email protected]>
--- src/rpcbind.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
src/rpcbind.c +4 -0
@@ -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 );
Signature · 1 line
1.7.7.6
Quoted 5 lines · Steve Dickson
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 <[email protected]>
Committed....
steved.
Quoted 19 lines
--- src/rpcbind.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)src/rpcbind.c +4
-0@@ -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 );