Re: [PATCH] Realtime LSM

Chris Wright
2004-10-08T22:24:48Z

(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)