lkml.org 
[lkml]   [2004]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] Realtime LSM
(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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:06    [W:0.173 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site