libsepol: fix version comparison when writing policies
PATCH 1/1 libsepol: fix version comparison when writing policies
Fix a version comparison that prohibits the "old style" range transition rules from being written for a version 5 base policy.
---
libsepol/src/write.c +0 -0
@@ -1641,7 +1641,7 @@ int policydb_write(policydb_t * p, struc
if ((p->policyvers >= POLICYDB_VERSION_MLS
&& p->policy_type == POLICY_KERN)
|| (p->policyvers >= MOD_POLICYDB_VERSION_MLS
- && p->policyvers < MOD_POLICYDB_VERSION_MLS
+ && p->policyvers < MOD_POLICYDB_VERSION_RANGETRANS
&& p->policy_type == POLICY_BASE)) {
if (range_write(p, fp)) {
return POLICYDB_ERROR;Signature · 6 lines
Darrel -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 9 lines · Darrel Goeddel
Fix a version comparison that prohibits the "old style" range transition rules from being written for a version 5 base policy.
---
diff -ruNp --exclude=.svn
selinux-base/libsepol/src/write.cselinux/libsepol/src/write.c
libsepol/src/write.c int policydb_write(policydb_t * p, struc · line 1647
Quoted 8 lines
libsepol/src/write.c +1
-1@@ -1641,7 +1641,7 @@ int policydb_write(policydb_t * p, strucif ((p->policyvers >=POLICYDB_VERSION_MLS && p->policy_type ==POLICY_KERN ) || (p->policyvers >=MOD_POLICYDB_VERSION_MLS - && p->policyvers <MOD_POLICYDB_VERSION_MLS + && p->policyvers <MOD_POLICYDB_VERSION_RANGETRANS && p->policy_type ==POLICY_BASE )) {if (range_write (p, fp)) {return POLICYDB_ERROR ;
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Joshua Brindle
Acked-byQuoted 6 lines · Stephen Smalley
Quoted 5 lines · Darrel Goeddel
Fix a version comparison that prohibits the "old style" range transition rules from being written for a version 5 base policy.
---
Quoted 15 lines
libsepol/src/write.c int policydb_write(policydb_t * p, struc · line 1647
Quoted 12 lines
diff -ruNp --exclude=.svn
selinux-base/libsepol/src/write.cselinux/libsepol/src/write.clibsepol/src/write.c +1
-1@@ -1641,7 +1641,7 @@ int policydb_write(policydb_t * p, strucif ((p->policyvers >=POLICYDB_VERSION_MLS && p->policy_type ==POLICY_KERN ) || (p->policyvers >=MOD_POLICYDB_VERSION_MLS - && p->policyvers <MOD_POLICYDB_VERSION_MLS + && p->policyvers <MOD_POLICYDB_VERSION_RANGETRANS && p->policy_type ==POLICY_BASE )) {if (range_write (p, fp)) {return POLICYDB_ERROR ;Acked-by Stephen Smalley <[email protected]>
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Karl MacMillan
Acked-byQuoted 23 lines · Joshua Brindle
Quoted 6 lines · Stephen Smalley
Quoted 5 lines · Darrel Goeddel
Fix a version comparison that prohibits the "old style" range transition rules from being written for a version 5 base policy.
---
Quoted 15 lines
libsepol/src/write.c int policydb_write(policydb_t * p, struc · line 1647
Quoted 12 lines
diff -ruNp --exclude=.svn
selinux-base/libsepol/src/write.cselinux/libsepol/src/write.clibsepol/src/write.c +1
-1@@ -1641,7 +1641,7 @@ int policydb_write(policydb_t * p, strucif ((p->policyvers >=POLICYDB_VERSION_MLS && p->policy_type ==POLICY_KERN ) || (p->policyvers >=MOD_POLICYDB_VERSION_MLS - && p->policyvers <MOD_POLICYDB_VERSION_MLS + && p->policyvers <MOD_POLICYDB_VERSION_RANGETRANS && p->policy_type ==POLICY_BASE )) {if (range_write (p, fp)) {return POLICYDB_ERROR ;Acked-by Stephen Smalley <[email protected]>
Quoted 3 lines
Acked-by Joshua Brindle <[email protected]>
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.