/usr/lib64/python3.9/site-packages/setools/diff/__pycache__
NameSizeModeActions
bool.cpython-39.opt-1.pyc26170644editdlrm
bool.cpython-39.pyc26170644editdlrm
bounds.cpython-39.opt-1.pyc39770644editdlrm
bounds.cpython-39.pyc39770644editdlrm
commons.cpython-39.opt-1.pyc21610644editdlrm
commons.cpython-39.pyc21610644editdlrm
conditional.cpython-39.opt-1.pyc16900644editdlrm
conditional.cpython-39.pyc16900644editdlrm
constraints.cpython-39.opt-1.pyc73040644editdlrm
constraints.cpython-39.pyc75810644editdlrm
context.cpython-39.opt-1.pyc15900644editdlrm
context.cpython-39.pyc15900644editdlrm
default.cpython-39.opt-1.pyc34020644editdlrm
default.cpython-39.pyc34020644editdlrm
descriptors.cpython-39.opt-1.pyc12300644editdlrm
descriptors.cpython-39.pyc12300644editdlrm
difference.cpython-39.opt-1.pyc55420644editdlrm
difference.cpython-39.pyc57060644editdlrm
fsuse.cpython-39.opt-1.pyc30520644editdlrm
fsuse.cpython-39.pyc30520644editdlrm
genfscon.cpython-39.opt-1.pyc31510644editdlrm
genfscon.cpython-39.pyc31510644editdlrm
ibendportcon.cpython-39.opt-1.pyc31690644editdlrm
ibendportcon.cpython-39.pyc31690644editdlrm
ibpkeycon.cpython-39.opt-1.pyc31430644editdlrm
ibpkeycon.cpython-39.pyc31430644editdlrm
initsid.cpython-39.opt-1.pyc21960644editdlrm
initsid.cpython-39.pyc21960644editdlrm
mls.cpython-39.opt-1.pyc98000644editdlrm
mls.cpython-39.pyc98000644editdlrm
mlsrules.cpython-39.opt-1.pyc39380644editdlrm
mlsrules.cpython-39.pyc40690644editdlrm
netifcon.cpython-39.opt-1.pyc32390644editdlrm
netifcon.cpython-39.pyc32390644editdlrm
nodecon.cpython-39.opt-1.pyc30510644editdlrm
nodecon.cpython-39.pyc30510644editdlrm
objclass.cpython-39.opt-1.pyc29710644editdlrm
objclass.cpython-39.pyc29710644editdlrm
polcap.cpython-39.opt-1.pyc15400644editdlrm
polcap.cpython-39.pyc15400644editdlrm
portcon.cpython-39.opt-1.pyc30840644editdlrm
portcon.cpython-39.pyc30840644editdlrm
properties.cpython-39.opt-1.pyc17040644editdlrm
properties.cpython-39.pyc17040644editdlrm
rbacrules.cpython-39.opt-1.pyc54470644editdlrm
rbacrules.cpython-39.pyc56220644editdlrm
roles.cpython-39.opt-1.pyc28950644editdlrm
roles.cpython-39.pyc28950644editdlrm
terules.cpython-39.opt-1.pyc157450644editdlrm
terules.cpython-39.pyc157450644editdlrm
typeattr.cpython-39.opt-1.pyc30580644editdlrm
typeattr.cpython-39.pyc30580644editdlrm
types.cpython-39.opt-1.pyc36940644editdlrm
types.cpython-39.pyc36940644editdlrm
typing.cpython-39.opt-1.pyc5910644editdlrm
typing.cpython-39.pyc5910644editdlrm
users.cpython-39.opt-1.pyc37220644editdlrm
users.cpython-39.pyc37220644editdlrm
__init__.cpython-39.opt-1.pyc20810644editdlrm
__init__.cpython-39.pyc20810644editdlrm
Edit: /usr/lib64/python3.9/site-packages/setools/diff/__pycache__/constraints.cpython-39.pyc (7581B)
a qqe @sddlmZddlmZmZmZmZddlmZm Z m Z m Z m Z ddl mZddlmZmZmZddlmZdd lmZGd d d eZGd d d eeZdS)) defaultdict) FrozenSetListOptionalUnion) AnyConstraintConstraintRuletypeRoleTypeUser)DiffResultDescriptor) Difference SymbolWrapperWrapper)class_wrapper_factory)RuleListc@seZdZUdZedZedZedZedZedZ edZ edZ edZ dZ eeefed<dZeeefed<dd d d Zdd d d Zdd ddZdd ddZdd ddZdd ddZdS)ConstraintsDifferencea Determine the difference in constraints between two policies. Since the compiler does not union constraints, there may be multiple constraints with the same ruletype, object class, and permission set, so constraints can only be added or removed, not modified. The constraint expressions are compared only on a basic level. Expressions that are logically equivalent but are structurally different, for example, by associativity, will be considered different. Type and role attributes are also not expanded, so if there are changes to attribute members, it will not be reflected as a difference. diff_constrainsdiff_mlsconstrainsdiff_validatetransdiff_mlsvalidatetransN_left_constraints_right_constraints)returncCs|jd||jdus&|jdur.||jdus@Jd|jdusRJd|dd|jtjDdd|jtjD\|_ |_ }dS)zAGenerate the difference in constraint rules between the policies.zJGenerating constraint differences from {0.left_policy} to {0.right_policy}N)Left constraints didn't load, this a bug.*Right constraints didn't load, this a bug.css|]}t|VqdSNConstraintWrapper.0cr$>/usr/lib64/python3.9/site-packages/setools/diff/constraints.py ?z8ConstraintsDifference.diff_constrains..css|]}t|VqdSrrr!r$r$r%r&@r') loginfoformatrr_create_constrain_lists _set_diffr Z constrainadded_constrainsremoved_constrainsself_r$r$r%r2s z%ConstraintsDifference.diff_constrainscCs|jd||jdus&|jdur.||jdus@Jd|jdusRJd|dd|jtjDdd|jtjD\|_ |_ }dS)zEGenerate the difference in MLS constraint rules between the policies.zNGenerating MLS constraint differences from {0.left_policy} to {0.right_policy}Nrrcss|]}t|VqdSrrr!r$r$r%r&Pr'z;ConstraintsDifference.diff_mlsconstrains..css|]}t|VqdSrrr!r$r$r%r&Rr') r(r)r*rrr+r,r Z mlsconstrainadded_mlsconstrainsremoved_mlsconstrainsr/r$r$r%rBs"  z(ConstraintsDifference.diff_mlsconstrainscCs|jd||jdus&|jdur.||jdus@Jd|jdusRJd|dd|jtjDdd|jtjD\|_ |_ }dS)zDGenerate the difference in validatetrans rules between the policies.zMGenerating validatetrans differences from {0.left_policy} to {0.right_policy}Nrrcss|]}t|VqdSrrr!r$r$r%r&cr'z;ConstraintsDifference.diff_validatetrans..css|]}t|VqdSrrr!r$r$r%r&er') r(r)r*rrr+r,r Z validatetransadded_validatetransremoved_validatetransr/r$r$r%rUs"  z(ConstraintsDifference.diff_validatetranscCs|jd||jdus&|jdur.||jdus@Jd|jdusRJd|dd|jtjDdd|jtjD\|_ |_ }dS)zHGenerate the difference in MLS validatetrans rules between the policies.zPGenerating mlsvalidatetrans differences from {0.left_policy} to {0.right_policy}Nrrcss|]}t|VqdSrrr!r$r$r%r&vr'z>ConstraintsDifference.diff_mlsvalidatetrans..css|]}t|VqdSrrr!r$r$r%r&xr') r(r)r*rrr+r,r Zmlsvalidatetransadded_mlsvalidatetransremoved_mlsvalidatetransr/r$r$r%rhs"  z+ConstraintsDifference.diff_mlsvalidatetranscCstt|_|jd||jD]}|j|j |q&|j D] \}}|jdt ||qHtt|_ |jd||j D]}|j |j |q|j D] \}}|jdt ||q|jddS)z$Create rule lists for both policies.z.Building constraint lists from {0.left_policy}zLoaded {0} {1} rules.z/Building constraint lists from {0.right_policy}z)Completed building constraint rule lists.N)rlistrr(debugr*Z left_policy constraintsruletypeappenditemslenrZ right_policy)r0ruler;Zrulesr$r$r%r+~s  z-ConstraintsDifference._create_constrain_listscCsL|jdd|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ dS)z%Reset diff results on policy changes.z%Resetting all constraints differencesN) r(r9r-r.r2r3r4r5r6r7rrr0r$r$r% _reset_diffs z!ConstraintsDifference._reset_diff)__name__ __module__ __qualname____doc__rr-r.r2r3r4r5r6r7rrr r__annotations__rrrrrr+rAr$r$r$r%rs" rc@s<eZdZdZdZeddddZddZd d Zd d Z dS) r z#Wrap constraints for diff purposes.r;tclasspermsexprN)r?rcCs||_|j|_t|j|_z |j|_Wnty>d|_Yn0t||_g|_|j D]6}t |t r|j t dd|DqV|j |qVdS)Ncss|]}t|VqdSr)r)r"itemr$r$r%r&r'z-ConstraintWrapper.__init__..) originr;rrHrIAttributeErrorhashkeyrJZ expression isinstance frozensetr<)r0r?opr$r$r%__init__s       zConstraintWrapper.__init__cCs|jSrrOr@r$r$r%__hash__szConstraintWrapper.__hash__cCs |j|jkSrrTr0otherr$r$r%__lt__szConstraintWrapper.__lt__cCs0|j|jko.|j|jko.|j|jko.|j|jkSrrGrVr$r$r%__eq__s    zConstraintWrapper.__eq__) rBrCrDrE __slots__rrSrUrXrYr$r$r$r%r s r N) collectionsrtypingrrrrZ policyreprr r r r Z descriptorsr differencerrrZobjclassrrrr r$r$r$r%s