diff options
Diffstat (limited to 'security/selinux/ss/services.c')
-rw-r--r-- | security/selinux/ss/services.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 6a22eaebf3b7..e11b4b038f4a 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -1362,7 +1362,8 @@ static void filename_compute_type(struct policydb *p, struct context *newcontext | |||
1362 | u32 stype, u32 ttype, u16 tclass, | 1362 | u32 stype, u32 ttype, u16 tclass, |
1363 | const char *objname) | 1363 | const char *objname) |
1364 | { | 1364 | { |
1365 | struct filename_trans *ft; | 1365 | struct filename_trans ft; |
1366 | struct filename_trans_datum *otype; | ||
1366 | 1367 | ||
1367 | /* | 1368 | /* |
1368 | * Most filename trans rules are going to live in specific directories | 1369 | * Most filename trans rules are going to live in specific directories |
@@ -1372,15 +1373,14 @@ static void filename_compute_type(struct policydb *p, struct context *newcontext | |||
1372 | if (!ebitmap_get_bit(&p->filename_trans_ttypes, ttype)) | 1373 | if (!ebitmap_get_bit(&p->filename_trans_ttypes, ttype)) |
1373 | return; | 1374 | return; |
1374 | 1375 | ||
1375 | for (ft = p->filename_trans; ft; ft = ft->next) { | 1376 | ft.stype = stype; |
1376 | if (ft->stype == stype && | 1377 | ft.ttype = ttype; |
1377 | ft->ttype == ttype && | 1378 | ft.tclass = tclass; |
1378 | ft->tclass == tclass && | 1379 | ft.name = objname; |
1379 | !strcmp(ft->name, objname)) { | 1380 | |
1380 | newcontext->type = ft->otype; | 1381 | otype = hashtab_search(p->filename_trans, &ft); |
1381 | return; | 1382 | if (otype) |
1382 | } | 1383 | newcontext->type = otype->otype; |
1383 | } | ||
1384 | } | 1384 | } |
1385 | 1385 | ||
1386 | static int security_compute_sid(u32 ssid, | 1386 | static int security_compute_sid(u32 ssid, |