Skip to content

Commit

Permalink
SELinux: skip file_name_trans_write() when policy downgraded.
Browse files Browse the repository at this point in the history
When policy version is less than POLICYDB_VERSION_FILENAME_TRANS,
skip file_name_trans_write().

Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
  • Loading branch information
Roy.Li authored and Eric Paris committed Jun 14, 2011
1 parent 0f7e4c3 commit ded5098
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions security/selinux/ss/policydb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3222,6 +3222,9 @@ static int filename_trans_write(struct policydb *p, void *fp)
__le32 buf[1];
int rc;

if (p->policyvers < POLICYDB_VERSION_FILENAME_TRANS)
return 0;

nel = 0;
rc = hashtab_map(p->filename_trans, hashtab_cnt, &nel);
if (rc)
Expand Down

0 comments on commit ded5098

Please sign in to comment.