diff options
author | Eric Paris <eparis@redhat.com> | 2008-05-14 11:27:45 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-07-14 01:01:36 -0400 |
commit | f5269710789f666a65cf1132c4f1d14fbc8d3c29 (patch) | |
tree | 8c61f74cb04505e3f16483baf1d7113e750968d7 /security/selinux/hooks.c | |
parent | 9a59daa03df72526d234b91dd3e32ded5aebd3ef (diff) |
SELinux: keep the code clean formating and syntax
Formatting and syntax changes
whitespace, tabs to spaces, trailing space
put open { on same line as struct def
remove unneeded {} after if statements
change printk("Lu") to printk("llu")
convert asm/uaccess.h to linux/uaacess.h includes
remove unnecessary asm/bug.h includes
convert all users of simple_strtol to strict_strtol
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 59c6e98f7bea..eca70f42e678 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -53,7 +53,7 @@ | |||
53 | #include <net/tcp.h> /* struct or_callable used in sock_rcv_skb */ | 53 | #include <net/tcp.h> /* struct or_callable used in sock_rcv_skb */ |
54 | #include <net/net_namespace.h> | 54 | #include <net/net_namespace.h> |
55 | #include <net/netlabel.h> | 55 | #include <net/netlabel.h> |
56 | #include <asm/uaccess.h> | 56 | #include <linux/uaccess.h> |
57 | #include <asm/ioctls.h> | 57 | #include <asm/ioctls.h> |
58 | #include <asm/atomic.h> | 58 | #include <asm/atomic.h> |
59 | #include <linux/bitops.h> | 59 | #include <linux/bitops.h> |
@@ -104,7 +104,9 @@ int selinux_enforcing; | |||
104 | 104 | ||
105 | static int __init enforcing_setup(char *str) | 105 | static int __init enforcing_setup(char *str) |
106 | { | 106 | { |
107 | selinux_enforcing = simple_strtol(str, NULL, 0); | 107 | unsigned long enforcing; |
108 | if (!strict_strtoul(str, 0, &enforcing)) | ||
109 | selinux_enforcing = enforcing ? 1 : 0; | ||
108 | return 1; | 110 | return 1; |
109 | } | 111 | } |
110 | __setup("enforcing=", enforcing_setup); | 112 | __setup("enforcing=", enforcing_setup); |
@@ -115,7 +117,9 @@ int selinux_enabled = CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE; | |||
115 | 117 | ||
116 | static int __init selinux_enabled_setup(char *str) | 118 | static int __init selinux_enabled_setup(char *str) |
117 | { | 119 | { |
118 | selinux_enabled = simple_strtol(str, NULL, 0); | 120 | unsigned long enabled; |
121 | if (!strict_strtoul(str, 0, &enabled)) | ||
122 | selinux_enabled = enabled ? 1 : 0; | ||
119 | return 1; | 123 | return 1; |
120 | } | 124 | } |
121 | __setup("selinux=", selinux_enabled_setup); | 125 | __setup("selinux=", selinux_enabled_setup); |
@@ -594,7 +598,7 @@ static int selinux_set_mnt_opts(struct super_block *sb, | |||
594 | */ | 598 | */ |
595 | if (sbsec->initialized && (sb->s_type->fs_flags & FS_BINARY_MOUNTDATA) | 599 | if (sbsec->initialized && (sb->s_type->fs_flags & FS_BINARY_MOUNTDATA) |
596 | && (num_opts == 0)) | 600 | && (num_opts == 0)) |
597 | goto out; | 601 | goto out; |
598 | 602 | ||
599 | /* | 603 | /* |
600 | * parse the mount options, check if they are valid sids. | 604 | * parse the mount options, check if they are valid sids. |
@@ -2695,7 +2699,7 @@ static int selinux_inode_setxattr(struct dentry *dentry, const char *name, | |||
2695 | } | 2699 | } |
2696 | 2700 | ||
2697 | static void selinux_inode_post_setxattr(struct dentry *dentry, const char *name, | 2701 | static void selinux_inode_post_setxattr(struct dentry *dentry, const char *name, |
2698 | const void *value, size_t size, | 2702 | const void *value, size_t size, |
2699 | int flags) | 2703 | int flags) |
2700 | { | 2704 | { |
2701 | struct inode *inode = dentry->d_inode; | 2705 | struct inode *inode = dentry->d_inode; |
@@ -5390,7 +5394,7 @@ static struct security_operations selinux_ops = { | |||
5390 | .inode_listsecurity = selinux_inode_listsecurity, | 5394 | .inode_listsecurity = selinux_inode_listsecurity, |
5391 | .inode_need_killpriv = selinux_inode_need_killpriv, | 5395 | .inode_need_killpriv = selinux_inode_need_killpriv, |
5392 | .inode_killpriv = selinux_inode_killpriv, | 5396 | .inode_killpriv = selinux_inode_killpriv, |
5393 | .inode_getsecid = selinux_inode_getsecid, | 5397 | .inode_getsecid = selinux_inode_getsecid, |
5394 | 5398 | ||
5395 | .file_permission = selinux_file_permission, | 5399 | .file_permission = selinux_file_permission, |
5396 | .file_alloc_security = selinux_file_alloc_security, | 5400 | .file_alloc_security = selinux_file_alloc_security, |
@@ -5431,7 +5435,7 @@ static struct security_operations selinux_ops = { | |||
5431 | .task_to_inode = selinux_task_to_inode, | 5435 | .task_to_inode = selinux_task_to_inode, |
5432 | 5436 | ||
5433 | .ipc_permission = selinux_ipc_permission, | 5437 | .ipc_permission = selinux_ipc_permission, |
5434 | .ipc_getsecid = selinux_ipc_getsecid, | 5438 | .ipc_getsecid = selinux_ipc_getsecid, |
5435 | 5439 | ||
5436 | .msg_msg_alloc_security = selinux_msg_msg_alloc_security, | 5440 | .msg_msg_alloc_security = selinux_msg_msg_alloc_security, |
5437 | .msg_msg_free_security = selinux_msg_msg_free_security, | 5441 | .msg_msg_free_security = selinux_msg_msg_free_security, |