forked from Minki/linux
SELinux: Trivial minor fixes that change C null character style
Trivial minor fixes that change C null character style. Signed-off-by: Vesa-Matti Kari <vmkari@cc.helsinki.fi> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
parent
3583a71183
commit
df4ea865f0
@ -239,7 +239,7 @@ int cond_read_bool(struct policydb *p, struct hashtab *h, void *fp)
|
|||||||
rc = next_entry(key, fp, len);
|
rc = next_entry(key, fp, len);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto err;
|
goto err;
|
||||||
key[len] = 0;
|
key[len] = '\0';
|
||||||
if (hashtab_insert(h, key, booldatum))
|
if (hashtab_insert(h, key, booldatum))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
@ -283,8 +283,8 @@ int mls_context_to_sid(struct policydb *pol,
|
|||||||
p++;
|
p++;
|
||||||
|
|
||||||
delim = *p;
|
delim = *p;
|
||||||
if (delim != 0)
|
if (delim != '\0')
|
||||||
*p++ = 0;
|
*p++ = '\0';
|
||||||
|
|
||||||
for (l = 0; l < 2; l++) {
|
for (l = 0; l < 2; l++) {
|
||||||
levdatum = hashtab_search(pol->p_levels.table, scontextp);
|
levdatum = hashtab_search(pol->p_levels.table, scontextp);
|
||||||
@ -302,14 +302,14 @@ int mls_context_to_sid(struct policydb *pol,
|
|||||||
while (*p && *p != ',' && *p != '-')
|
while (*p && *p != ',' && *p != '-')
|
||||||
p++;
|
p++;
|
||||||
delim = *p;
|
delim = *p;
|
||||||
if (delim != 0)
|
if (delim != '\0')
|
||||||
*p++ = 0;
|
*p++ = '\0';
|
||||||
|
|
||||||
/* Separate into range if exists */
|
/* Separate into range if exists */
|
||||||
rngptr = strchr(scontextp, '.');
|
rngptr = strchr(scontextp, '.');
|
||||||
if (rngptr != NULL) {
|
if (rngptr != NULL) {
|
||||||
/* Remove '.' */
|
/* Remove '.' */
|
||||||
*rngptr++ = 0;
|
*rngptr++ = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
catdatum = hashtab_search(pol->p_cats.table,
|
catdatum = hashtab_search(pol->p_cats.table,
|
||||||
@ -357,8 +357,8 @@ int mls_context_to_sid(struct policydb *pol,
|
|||||||
p++;
|
p++;
|
||||||
|
|
||||||
delim = *p;
|
delim = *p;
|
||||||
if (delim != 0)
|
if (delim != '\0')
|
||||||
*p++ = 0;
|
*p++ = '\0';
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -932,7 +932,7 @@ static int perm_read(struct policydb *p, struct hashtab *h, void *fp)
|
|||||||
rc = next_entry(key, fp, len);
|
rc = next_entry(key, fp, len);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto bad;
|
goto bad;
|
||||||
key[len] = 0;
|
key[len] = '\0';
|
||||||
|
|
||||||
rc = hashtab_insert(h, key, perdatum);
|
rc = hashtab_insert(h, key, perdatum);
|
||||||
if (rc)
|
if (rc)
|
||||||
@ -979,7 +979,7 @@ static int common_read(struct policydb *p, struct hashtab *h, void *fp)
|
|||||||
rc = next_entry(key, fp, len);
|
rc = next_entry(key, fp, len);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto bad;
|
goto bad;
|
||||||
key[len] = 0;
|
key[len] = '\0';
|
||||||
|
|
||||||
for (i = 0; i < nel; i++) {
|
for (i = 0; i < nel; i++) {
|
||||||
rc = perm_read(p, comdatum->permissions.table, fp);
|
rc = perm_read(p, comdatum->permissions.table, fp);
|
||||||
@ -1117,7 +1117,7 @@ static int class_read(struct policydb *p, struct hashtab *h, void *fp)
|
|||||||
rc = next_entry(key, fp, len);
|
rc = next_entry(key, fp, len);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto bad;
|
goto bad;
|
||||||
key[len] = 0;
|
key[len] = '\0';
|
||||||
|
|
||||||
if (len2) {
|
if (len2) {
|
||||||
cladatum->comkey = kmalloc(len2 + 1, GFP_KERNEL);
|
cladatum->comkey = kmalloc(len2 + 1, GFP_KERNEL);
|
||||||
@ -1128,7 +1128,7 @@ static int class_read(struct policydb *p, struct hashtab *h, void *fp)
|
|||||||
rc = next_entry(cladatum->comkey, fp, len2);
|
rc = next_entry(cladatum->comkey, fp, len2);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto bad;
|
goto bad;
|
||||||
cladatum->comkey[len2] = 0;
|
cladatum->comkey[len2] = '\0';
|
||||||
|
|
||||||
cladatum->comdatum = hashtab_search(p->p_commons.table,
|
cladatum->comdatum = hashtab_search(p->p_commons.table,
|
||||||
cladatum->comkey);
|
cladatum->comkey);
|
||||||
@ -1201,7 +1201,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
|
|||||||
rc = next_entry(key, fp, len);
|
rc = next_entry(key, fp, len);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto bad;
|
goto bad;
|
||||||
key[len] = 0;
|
key[len] = '\0';
|
||||||
|
|
||||||
rc = ebitmap_read(&role->dominates, fp);
|
rc = ebitmap_read(&role->dominates, fp);
|
||||||
if (rc)
|
if (rc)
|
||||||
@ -1262,7 +1262,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
|
|||||||
rc = next_entry(key, fp, len);
|
rc = next_entry(key, fp, len);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto bad;
|
goto bad;
|
||||||
key[len] = 0;
|
key[len] = '\0';
|
||||||
|
|
||||||
rc = hashtab_insert(h, key, typdatum);
|
rc = hashtab_insert(h, key, typdatum);
|
||||||
if (rc)
|
if (rc)
|
||||||
@ -1334,7 +1334,7 @@ static int user_read(struct policydb *p, struct hashtab *h, void *fp)
|
|||||||
rc = next_entry(key, fp, len);
|
rc = next_entry(key, fp, len);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto bad;
|
goto bad;
|
||||||
key[len] = 0;
|
key[len] = '\0';
|
||||||
|
|
||||||
rc = ebitmap_read(&usrdatum->roles, fp);
|
rc = ebitmap_read(&usrdatum->roles, fp);
|
||||||
if (rc)
|
if (rc)
|
||||||
@ -1388,7 +1388,7 @@ static int sens_read(struct policydb *p, struct hashtab *h, void *fp)
|
|||||||
rc = next_entry(key, fp, len);
|
rc = next_entry(key, fp, len);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto bad;
|
goto bad;
|
||||||
key[len] = 0;
|
key[len] = '\0';
|
||||||
|
|
||||||
levdatum->level = kmalloc(sizeof(struct mls_level), GFP_ATOMIC);
|
levdatum->level = kmalloc(sizeof(struct mls_level), GFP_ATOMIC);
|
||||||
if (!levdatum->level) {
|
if (!levdatum->level) {
|
||||||
@ -1440,7 +1440,7 @@ static int cat_read(struct policydb *p, struct hashtab *h, void *fp)
|
|||||||
rc = next_entry(key, fp, len);
|
rc = next_entry(key, fp, len);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
goto bad;
|
goto bad;
|
||||||
key[len] = 0;
|
key[len] = '\0';
|
||||||
|
|
||||||
rc = hashtab_insert(h, key, catdatum);
|
rc = hashtab_insert(h, key, catdatum);
|
||||||
if (rc)
|
if (rc)
|
||||||
@ -1523,7 +1523,7 @@ int policydb_read(struct policydb *p, void *fp)
|
|||||||
kfree(policydb_str);
|
kfree(policydb_str);
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
policydb_str[len] = 0;
|
policydb_str[len] = '\0';
|
||||||
if (strcmp(policydb_str, POLICYDB_STRING)) {
|
if (strcmp(policydb_str, POLICYDB_STRING)) {
|
||||||
printk(KERN_ERR "SELinux: policydb string %s does not match "
|
printk(KERN_ERR "SELinux: policydb string %s does not match "
|
||||||
"my string %s\n", policydb_str, POLICYDB_STRING);
|
"my string %s\n", policydb_str, POLICYDB_STRING);
|
||||||
|
Loading…
Reference in New Issue
Block a user