Re: [PATCH] Realtime LSM
From: Chris Wright
Date: Fri Oct 08 2004 - 17:26:05 EST
(relative to last one)
use in_group_p
--- security/realtime.c~cap_bprm_set 2004-10-08 15:21:03.835639904 -0700
+++ security/realtime.c 2004-10-08 15:23:13.574916536 -0700
@@ -60,26 +60,15 @@
MODULE_PARM_DESC(mlock, " enable memory locking privileges.");
/* helper function for testing group membership */
-static inline int gid_ok(int gid, int e_gid) {
- int i;
- int rt_ok = 0;
-
+static inline int gid_ok(int gid, int e_gid)
+{
if (gid == -1)
return 0;
if ((gid == e_gid) || (gid == current->gid))
return 1;
- get_group_info(current->group_info);
- for (i = 0; i < current->group_info->ngroups; ++i) {
- if (gid == GROUP_AT(current->group_info, i)) {
- rt_ok = 1;
- break;
- }
- }
- put_group_info(current->group_info);
-
- return rt_ok;
+ return in_group_p(gid);
}
int realtime_bprm_set_security(struct linux_binprm *bprm)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/