patch-2.2.15 linux/kernel/sys.c
Next file: linux/kernel/sysctl.c
Previous file: linux/kernel/signal.c
Back to the patch index
Back to the overall index
- Lines: 28
- Date:
Fri Apr 21 12:47:02 2000
- Orig file:
v2.2.14/kernel/sys.c
- Orig date:
Sat Aug 14 02:26:52 1999
diff -u --new-file --recursive --exclude-from ../../exclude v2.2.14/kernel/sys.c linux/kernel/sys.c
@@ -807,6 +807,27 @@
return 1;
}
+/* Like in_group_p, but testing against egid, not fsgid */
+
+int in_egroup_p(gid_t grp)
+{
+ if (grp != current->egid) {
+ int i = current->ngroups;
+ if (i) {
+ gid_t *groups = current->groups;
+ do {
+ if (*groups == grp)
+ goto out;
+ groups++;
+ i--;
+ } while (i);
+ }
+ return 0;
+ }
+out:
+ return 1;
+}
+
/*
* This should really be a blocking read-write lock
* rather than a semaphore. Anybody want to implement
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)