mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Rusty Russell <rusty@rustcorp.com.au>,
	Andrew Morton <akpm@linux-foundation.org>,
	John Johansen <john.johansen@canonical.com>
Subject: [PATCH 3/3] [PATCH 3/3] module/lsm: Have apparmor module parameters work with no args
Date: Tue, 13 Aug 2013 17:02:31 -0400	[thread overview]
Message-ID: <20130813213039.196836151@goodmis.org> (raw)
In-Reply-To: <20130813210228.989279359@goodmis.org>

[-- Attachment #1: 0003-module-lsm-Have-apparmor-module-parameters-work-with.patch --]
[-- Type: text/plain, Size: 1388 bytes --]

The apparmor module parameters for param_ops_aabool and
param_ops_aalockpolicy are both based off of the param_ops_bool,
and can handle a NULL value passed in as val. Have it enable the
new KERNEL_PARAM_FL_NOARGS flag to allow the parameters to be set
without having to state "=y" or "=1".

Cc: John Johansen <john.johansen@canonical.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 security/apparmor/lsm.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 2e2a0dd..e3a704c 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -666,6 +666,7 @@ static int param_set_aabool(const char *val, const struct kernel_param *kp);
 static int param_get_aabool(char *buffer, const struct kernel_param *kp);
 #define param_check_aabool param_check_bool
 static struct kernel_param_ops param_ops_aabool = {
+	.flags = KERNEL_PARAM_FL_NOARG,
 	.set = param_set_aabool,
 	.get = param_get_aabool
 };
@@ -682,6 +683,7 @@ static int param_set_aalockpolicy(const char *val, const struct kernel_param *kp
 static int param_get_aalockpolicy(char *buffer, const struct kernel_param *kp);
 #define param_check_aalockpolicy param_check_bool
 static struct kernel_param_ops param_ops_aalockpolicy = {
+	.flags = KERNEL_PARAM_FL_NOARG,
 	.set = param_set_aalockpolicy,
 	.get = param_get_aalockpolicy
 };
-- 
1.7.10.4



  parent reply	other threads:[~2013-08-13 21:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13 21:02 [PATCH 0/3] module: Allow parameters without arguments Steven Rostedt
2013-08-13 21:02 ` [PATCH 1/3] [PATCH 1/3] module: Add flag to allow mod params to have no arguments Steven Rostedt
2013-08-14  7:30   ` Rusty Russell
2013-08-13 21:02 ` [PATCH 2/3] [PATCH 2/3] module: Add NOARG flag for ops with param_set_bool_enable_only() set function Steven Rostedt
2013-08-13 21:02 ` Steven Rostedt [this message]
2013-08-13 23:13 ` [PATCH 0/3] module: Allow parameters without arguments Steven Rostedt
2013-08-13 23:34 ` Lucas De Marchi
2013-08-14  0:17   ` Steven Rostedt
2013-08-14  1:00     ` Lucas De Marchi
2013-08-14  1:08       ` Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130813213039.196836151@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=john.johansen@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome