SELinux: services.c whitespace, syntax, and static declaraction cleanups
This patch changes services.c to fix whitespace and syntax issues. Things that are fixed may include (does not not have to include) whitespace at end of lines spaces followed by tabs spaces used instead of tabs spacing around parenthesis locateion of { around struct and else clauses location of * in pointer declarations removal of initialization of static data to keep it in the right section useless {} in if statemetns useless checking for NULL before kfree fixing of the indentation depth of switch statements and any number of other things I forgot to mention Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
@@ -82,7 +82,7 @@ static DEFINE_MUTEX(load_mutex);
|
||||
|
||||
static struct sidtab sidtab;
|
||||
struct policydb policydb;
|
||||
int ss_initialized = 0;
|
||||
int ss_initialized;
|
||||
|
||||
/*
|
||||
* The largest sequence number that has been used when
|
||||
@@ -90,7 +90,7 @@ int ss_initialized = 0;
|
||||
* The sequence number only changes when a policy change
|
||||
* occurs.
|
||||
*/
|
||||
static u32 latest_granting = 0;
|
||||
static u32 latest_granting;
|
||||
|
||||
/* Forward declaration. */
|
||||
static int context_struct_to_string(struct context *context, char **scontext,
|
||||
@@ -623,9 +623,8 @@ static int context_struct_to_string(struct context *context, char **scontext, u3
|
||||
|
||||
/* Allocate space for the context; caller must free this space. */
|
||||
scontextp = kmalloc(*scontext_len, GFP_ATOMIC);
|
||||
if (!scontextp) {
|
||||
if (!scontextp)
|
||||
return -ENOMEM;
|
||||
}
|
||||
*scontext = scontextp;
|
||||
|
||||
/*
|
||||
@@ -1289,25 +1288,22 @@ static int convert_context(u32 key,
|
||||
/* Convert the user. */
|
||||
usrdatum = hashtab_search(args->newp->p_users.table,
|
||||
args->oldp->p_user_val_to_name[c->user - 1]);
|
||||
if (!usrdatum) {
|
||||
if (!usrdatum)
|
||||
goto bad;
|
||||
}
|
||||
c->user = usrdatum->value;
|
||||
|
||||
/* Convert the role. */
|
||||
role = hashtab_search(args->newp->p_roles.table,
|
||||
args->oldp->p_role_val_to_name[c->role - 1]);
|
||||
if (!role) {
|
||||
if (!role)
|
||||
goto bad;
|
||||
}
|
||||
c->role = role->value;
|
||||
|
||||
/* Convert the type. */
|
||||
typdatum = hashtab_search(args->newp->p_types.table,
|
||||
args->oldp->p_type_val_to_name[c->type - 1]);
|
||||
if (!typdatum) {
|
||||
if (!typdatum)
|
||||
goto bad;
|
||||
}
|
||||
c->type = typdatum->value;
|
||||
|
||||
rc = mls_convert_context(args->oldp, args->newp, c);
|
||||
@@ -1938,12 +1934,11 @@ int security_set_bools(int len, int *values)
|
||||
audit_get_loginuid(current),
|
||||
audit_get_sessionid(current));
|
||||
}
|
||||
if (values[i]) {
|
||||
if (values[i])
|
||||
policydb.bool_val_to_struct[i]->state = 1;
|
||||
} else {
|
||||
else
|
||||
policydb.bool_val_to_struct[i]->state = 0;
|
||||
}
|
||||
}
|
||||
|
||||
for (cur = policydb.cond_list; cur != NULL; cur = cur->next) {
|
||||
rc = evaluate_cond_node(&policydb, cur);
|
||||
|
Reference in New Issue
Block a user