Skip to content

Commit ded5098

Browse files
Roy.Lieparis
authored andcommitted
SELinux: skip file_name_trans_write() when policy downgraded.
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>
1 parent 0f7e4c3 commit ded5098

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎security/selinux/ss/policydb.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3222,6 +3222,9 @@ static int filename_trans_write(struct policydb *p, void *fp)
32223222
__le32 buf[1];
32233223
int rc;
32243224

3225+
if (p->policyvers < POLICYDB_VERSION_FILENAME_TRANS)
3226+
return 0;
3227+
32253228
nel = 0;
32263229
rc = hashtab_map(p->filename_trans, hashtab_cnt, &nel);
32273230
if (rc)

0 commit comments

Comments
 (0)