Re: [PATCH] Realtime LSM

From: Chris Wright
Date: Fri Oct 08 2004 - 16:54:46 EST


* Lee Revell (rlrevell@xxxxxxxxxxx) wrote:
> On Fri, 2004-10-08 at 17:45, Chris Wright wrote:
> > > --- linux-2.6.8.1/security/realtime.c Wed Dec 31 18:00:00 1969
> > > +++ linux-2.6.8.1-rt02/security/realtime.c Mon Oct 4 21:35:41 2004
> > > +static int any = 0; /* if TRUE, any process is realtime */
> >
> > unecessary init to 0
> >
>
> I think gcc 3.4 complains otherwise.

Nah, it's fine.

$ grep 'int any' security/realtime.c
static int any; /* if TRUE, any process is realtime */
$ make security/realtime.o
CC security/realtime.o
$ gcc --version
gcc (GCC) 3.4.2 20040907 (Red Hat 3.4.2-2)

thanks,
-chris
--
Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net

--- security/realtime.c~orig 2004-10-08 14:27:27.000000000 -0700
+++ security/realtime.c 2004-10-08 14:52:31.303484080 -0700
@@ -26,6 +26,7 @@
#include <linux/netlink.h>
#include <linux/ptrace.h>
#include <linux/sysctl.h>
+#include <linux/moduleparam.h>

#ifdef CONFIG_SECURITY

@@ -46,16 +47,16 @@
* each is referenced only once in each function call. Nothing
* depends on parameters having the same value every time.
*/
-static int any = 0; /* if TRUE, any process is realtime */
-MODULE_PARM(any, "i");
+static int any; /* if TRUE, any process is realtime */
+module_param(any, int, 0644);
MODULE_PARM_DESC(any, " grant realtime privileges to any process.");

static int gid = -1; /* realtime group id, or NO_GROUP */
-MODULE_PARM(gid, "i");
+module_param(gid, int, 0644);
MODULE_PARM_DESC(gid, " the group ID with access to realtime privileges.");

static int mlock = 1; /* enable mlock() privileges */
-MODULE_PARM(mlock, "i");
+module_param(mlock, int, 0644);
MODULE_PARM_DESC(mlock, " enable memory locking privileges.");

/* helper function for testing group membership */
-
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/