SELinux: whitespace and formating fixes for hooks.c
All whitespace and formatting. Nothing interesting to see here. About the only thing to remember is that we aren't supposed to initialize static variables to 0/NULL. It is done for us and doing it ourselves puts them in a different section. With this patch running checkpatch.pl against hooks.c only gives us complaints about busting the 80 character limit and declaring extern's in .c files. Apparently they don't like it, but I don't feel like going to the trouble of moving those to .h files... Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
parent
744ba35e45
commit
828dfe1da5
1 changed files with 247 additions and 252 deletions
|
@ -99,7 +99,7 @@ extern struct security_operations *security_ops;
|
|||
atomic_t selinux_secmark_refcount = ATOMIC_INIT(0);
|
||||
|
||||
#ifdef CONFIG_SECURITY_SELINUX_DEVELOP
|
||||
int selinux_enforcing = 0;
|
||||
int selinux_enforcing;
|
||||
|
||||
static int __init enforcing_setup(char *str)
|
||||
{
|
||||
|
@ -123,13 +123,13 @@ int selinux_enabled = 1;
|
|||
#endif
|
||||
|
||||
/* Original (dummy) security module. */
|
||||
static struct security_operations *original_ops = NULL;
|
||||
static struct security_operations *original_ops;
|
||||
|
||||
/* Minimal support for a secondary security module,
|
||||
just to allow the use of the dummy or capability modules.
|
||||
The owlsm module can alternatively be used as a secondary
|
||||
module as long as CONFIG_OWLSM_FD is not enabled. */
|
||||
static struct security_operations *secondary_ops = NULL;
|
||||
static struct security_operations *secondary_ops;
|
||||
|
||||
/* Lists of inode and superblock security structures initialized
|
||||
before the policy was loaded. */
|
||||
|
@ -1818,16 +1818,14 @@ static int selinux_quotactl(int cmds, int type, int id, struct super_block *sb)
|
|||
case Q_QUOTAOFF:
|
||||
case Q_SETINFO:
|
||||
case Q_SETQUOTA:
|
||||
rc = superblock_has_perm(current,
|
||||
sb,
|
||||
FILESYSTEM__QUOTAMOD, NULL);
|
||||
rc = superblock_has_perm(current, sb, FILESYSTEM__QUOTAMOD,
|
||||
NULL);
|
||||
break;
|
||||
case Q_GETFMT:
|
||||
case Q_GETINFO:
|
||||
case Q_GETQUOTA:
|
||||
rc = superblock_has_perm(current,
|
||||
sb,
|
||||
FILESYSTEM__QUOTAGET, NULL);
|
||||
rc = superblock_has_perm(current, sb, FILESYSTEM__QUOTAGET,
|
||||
NULL);
|
||||
break;
|
||||
default:
|
||||
rc = 0; /* let the kernel handle invalid cmds */
|
||||
|
@ -2315,8 +2313,7 @@ static inline void take_selinux_option(char **to, char *from, int *first,
|
|||
if (!*first) {
|
||||
**to = '|';
|
||||
*to += 1;
|
||||
}
|
||||
else
|
||||
} else
|
||||
*first = 0;
|
||||
|
||||
while (current_size < len) {
|
||||
|
@ -2894,7 +2891,6 @@ static int selinux_file_ioctl(struct file *file, unsigned int cmd,
|
|||
*/
|
||||
default:
|
||||
error = file_has_perm(current, file, FILE__IOCTL);
|
||||
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
@ -5219,8 +5215,7 @@ static int selinux_setprocattr(struct task_struct *p,
|
|||
tsec->sid = sid;
|
||||
task_unlock(p);
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
return -EINVAL;
|
||||
|
||||
return size;
|
||||
|
@ -5524,11 +5519,10 @@ static __init int selinux_init(void)
|
|||
if (register_security(&selinux_ops))
|
||||
panic("SELinux: Unable to register with kernel.\n");
|
||||
|
||||
if (selinux_enforcing) {
|
||||
if (selinux_enforcing)
|
||||
printk(KERN_DEBUG "SELinux: Starting in enforcing mode\n");
|
||||
} else {
|
||||
else
|
||||
printk(KERN_DEBUG "SELinux: Starting in permissive mode\n");
|
||||
}
|
||||
|
||||
#ifdef CONFIG_KEYS
|
||||
/* Add security information to initial keyrings */
|
||||
|
@ -5673,10 +5667,11 @@ static void selinux_nf_ip_exit(void)
|
|||
#endif /* CONFIG_NETFILTER */
|
||||
|
||||
#ifdef CONFIG_SECURITY_SELINUX_DISABLE
|
||||
static int selinux_disabled;
|
||||
|
||||
int selinux_disable(void)
|
||||
{
|
||||
extern void exit_sel_fs(void);
|
||||
static int selinux_disabled = 0;
|
||||
|
||||
if (ss_initialized) {
|
||||
/* Not permitted after initial policy load. */
|
||||
|
|
Loading…
Add table
Reference in a new issue