Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ded50988 authored by Roy.Li's avatar Roy.Li Committed by Eric Paris
Browse files

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: default avatarRoy.Li <rongqing.li@windriver.com>
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
parent 0f7e4c33
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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)