summaryrefslogtreecommitdiffstats
path: root/login-utils/newgrp.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:26:54 +0100
committerKarel Zak2006-12-07 00:26:54 +0100
commit48d7b13a1eab85fab91c8d6c5ddf298f733c74f5 (patch)
tree8813d36590ee3361bd75f57a12fd2032e9296ddb /login-utils/newgrp.c
parentImported from util-linux-2.12r tarball. (diff)
downloadkernel-qcow2-util-linux-48d7b13a1eab85fab91c8d6c5ddf298f733c74f5.tar.gz
kernel-qcow2-util-linux-48d7b13a1eab85fab91c8d6c5ddf298f733c74f5.tar.xz
kernel-qcow2-util-linux-48d7b13a1eab85fab91c8d6c5ddf298f733c74f5.zip
Imported from util-linux-2.13-pre1 tarball.
Diffstat (limited to 'login-utils/newgrp.c')
-rw-r--r--login-utils/newgrp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/login-utils/newgrp.c b/login-utils/newgrp.c
index 89db17548..a46f9ee53 100644
--- a/login-utils/newgrp.c
+++ b/login-utils/newgrp.c
@@ -33,6 +33,7 @@ allow_setgid(struct passwd *pe, struct group *ge)
int notfound = 1;
if (getuid() == 0) return TRUE; /* root may do anything */
+ if (ge->gr_gid == pe->pw_gid) return TRUE; /* You can switch back to your default group */
look = ge->gr_mem;
while (*look && (notfound = strcmp(*look++,pe->pw_name)));