summaryrefslogtreecommitdiffstats
path: root/security/selinux
diff options
context:
space:
mode:
authorRoy.Li <rongqing.li@windriver.com>2011-05-20 10:38:06 +0800
committerEric Paris <eparis@redhat.com>2011-06-14 12:58:51 -0400
commitded509880f6a0213b09f8ae7bef84acb16eaccbf (patch)
treeac8819a1b23a13b0f04ca34ab2983040c9d66e99 /security/selinux
parent0f7e4c33eb2c40b1e9cc24d2eab6de5921bc619c (diff)
downloadlinux-ded509880f6a0213b09f8ae7bef84acb16eaccbf.tar.gz
linux-ded509880f6a0213b09f8ae7bef84acb16eaccbf.tar.bz2
linux-ded509880f6a0213b09f8ae7bef84acb16eaccbf.zip
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>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/ss/policydb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index 102e9ec1b77a..d246aca3f4fb 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -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)