[PATCH 10/45] kstrtox: convert security/

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alexey Dobriyan
Date: Sunday, December 5, 2010 - 10:49 am

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
 security/apparmor/lsm.c             |    2 +-
 security/integrity/ima/ima_audit.c  |    2 +-
 security/integrity/ima/ima_policy.c |   15 ++++-----------
 security/selinux/hooks.c            |    4 ++--
 security/selinux/selinuxfs.c        |    2 +-
 security/tomoyo/common.c            |    8 +++++---
 6 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index b7106f1..990ff86 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -754,7 +754,7 @@ module_param_named(enabled, apparmor_enabled, aabool, S_IRUSR);
 static int __init apparmor_enabled_setup(char *str)
 {
 	unsigned long enabled;
-	int error = strict_strtoul(str, 0, &enabled);
+	int error = kstrtoul(str, 0, &enabled);
 	if (!error)
 		apparmor_enabled = enabled ? 1 : 0;
 	return 1;
diff --git a/security/integrity/ima/ima_audit.c b/security/integrity/ima/ima_audit.c
index c5c5a72..b4a203c 100644
--- a/security/integrity/ima/ima_audit.c
+++ b/security/integrity/ima/ima_audit.c
@@ -24,7 +24,7 @@ static int __init ima_audit_setup(char *str)
 {
 	unsigned long audit;
 
-	if (!strict_strtoul(str, 0, &audit))
+	if (!kstrtoul(str, 0, &audit))
 		ima_audit = audit ? 1 : 0;
 	return 1;
 }
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
index aef8c0a..7958938 100644
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@ -276,7 +276,6 @@ static int ima_parse_rule(char *rule, struct ima_measure_rule_entry *entry)
 	while ((p = strsep(&rule, " \t")) != NULL) {
 		substring_t args[MAX_OPT_ARGS];
 		int token;
-		unsigned long lnum;
 
 		if (result < 0)
 			break;
@@ -347,8 +346,7 @@ static int ima_parse_rule(char *rule, struct ima_measure_rule_entry *entry)
 				break;
 			}
 
-			result = strict_strtoul(args[0].from, 16,
-						&entry->fsmagic);
+			result = kstrtoul(args[0].from, 16, &entry->fsmagic);
 			if (!result)
 				entry->flags |= IMA_FSMAGIC;
 			break;
@@ -360,14 +358,9 @@ static int ima_parse_rule(char *rule, struct ima_measure_rule_entry *entry)
 				break;
 			}
 
-			result = strict_strtoul(args[0].from, 10, &lnum);
-			if (!result) {
-				entry->uid = (uid_t) lnum;
-				if (entry->uid != lnum)
-					result = -EINVAL;
-				else
-					entry->flags |= IMA_UID;
-			}
+			result = kstrtou32(args[0].from, 10, &entry->uid);
+			if (!result)
+				entry->flags |= IMA_UID;
 			break;
 		case Opt_obj_user:
 			ima_log_string(ab, "obj_user", args[0].from);
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 65fa8bf..4ee09bd 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -101,7 +101,7 @@ int selinux_enforcing;
 static int __init enforcing_setup(char *str)
 {
 	unsigned long enforcing;
-	if (!strict_strtoul(str, 0, &enforcing))
+	if (!kstrtoul(str, 0, &enforcing))
 		selinux_enforcing = enforcing ? 1 : 0;
 	return 1;
 }
@@ -114,7 +114,7 @@ int selinux_enabled = CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE;
 static int __init selinux_enabled_setup(char *str)
 {
 	unsigned long enabled;
-	if (!strict_strtoul(str, 0, &enabled))
+	if (!kstrtoul(str, 0, &enabled))
 		selinux_enabled = enabled ? 1 : 0;
 	return 1;
 }
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index 073fd5b..cdaf958 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -50,7 +50,7 @@ unsigned int selinux_checkreqprot = CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE;
 static int __init checkreqprot_setup(char *str)
 {
 	unsigned long checkreqprot;
-	if (!strict_strtoul(str, 0, &checkreqprot))
+	if (!kstrtoul(str, 0, &checkreqprot))
 		selinux_checkreqprot = checkreqprot ? 1 : 0;
 	return 1;
 }
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 7556315..1096c81 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -1091,14 +1091,16 @@ static int tomoyo_write_domain_profile(struct tomoyo_io_buffer *head)
 	char *data = head->write_buf;
 	char *cp = strchr(data, ' ');
 	struct tomoyo_domain_info *domain;
-	unsigned long profile;
+	unsigned int profile;
+	int rv;
 
 	if (!cp)
 		return -EINVAL;
 	*cp = '\0';
 	domain = tomoyo_find_domain(cp + 1);
-	if (strict_strtoul(data, 10, &profile))
-		return -EINVAL;
+	rv = kstrtouint(data, 10, &profile);
+	if (rv < 0)
+		return rv;
 	if (domain && profile < TOMOYO_MAX_PROFILES
 	    && (tomoyo_profile_ptr[profile] || !tomoyo_policy_loaded))
 		domain->profile = (u8) profile;
-- 
1.7.2.2

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 02/45] kstrtox: convert arch/x86/, Alexey Dobriyan, (Sun Dec 5, 10:48 am)
[PATCH 03/45] kstrtox: convert arch/arm/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 04/45] kstrtox: convert kernel/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 05/45] kstrtox: kernel/trace/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 06/45] kstrtox: convert mm/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 07/45] kstrtox: convert fs/fuse/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 08/45] kstrtox: convert fs/nfs/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 09/45] kstrtox: convert fs/proc/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 10/45] kstrtox: convert security/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 11/45] kstrtox: convert block/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 12/45] kstrtox: convert drivers/acpi/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 13/45] kstrtox: convert drivers/ata/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 14/45] kstrtox: convert drivers/base/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 15/45] kstrtox: convert drivers/block/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 16/45] kstrtox: convert drivers/bluetooth/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 17/45] kstrtox: convert drivers/clocksource/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 18/45] kstrtox: convert drivers/edac/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 19/45] kstrtox: convert drivers/gpio/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 20/45] kstrtox: convert drivers/gpu/drm/nouveau/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 21/45] kstrtox: convert drivers/hid/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 22/45] kstrtox: convert drivers/hwmon/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 23/45] kstrtox: convert drivers/ide/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 24/45] kstrtox: convert drivers/infiniband/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 25/45] kstrtox: convert drivers/input/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 26/45] kstrtox: convert drivers/isdn/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 27/45] kstrtox: convert drivers/leds/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 28/45] kstrtox: convert drivers/md/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 29/45] kstrtox: convert drivers/mfd/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 30/45] kstrtox: convert drivers/misc/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 31/45] kstrtox: convert drivers/mmc/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 32/45] kstrtox: convert drivers/net/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 33/45] kstrtox: convert drivers/net/wireless/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 34/45] kstrtox: convert drivers/pci/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 35/45] kstrtox: convert drivers/platform/x86/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 36/45] kstrtox: convert drivers/power/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 37/45] kstrtox: convert drivers/regulator/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 38/45] kstrtox: convert drivers/rtc/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 39/45] kstrtox: convert drivers/scsi/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 40/45] kstrtox: convert drivers/ssb/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 41/45] kstrtox: convert drivers/usb/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 42/45] kstrtox: convert drivers/video/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 43/45] kstrtox: convert drivers/w1/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 44/45] kstrtox: convert sound/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
[PATCH 45/45] kstrtox: convert net/, Alexey Dobriyan, (Sun Dec 5, 10:49 am)
Re: [PATCH 26/45] kstrtox: convert drivers/isdn/, Tilman Schmidt, (Sun Dec 5, 5:10 pm)
Re: [PATCH 26/45] kstrtox: convert drivers/isdn/, Alexey Dobriyan, (Mon Dec 6, 1:10 pm)
Re: [PATCH 26/45] kstrtox: convert drivers/isdn/, Tilman Schmidt, (Tue Dec 7, 3:06 am)