/usr/lib64/python3.6/site-packages/setools/diff/__pycache__
NameSizeModeActions
bool.cpython-36.opt-1.pyc21750644editdlrm
bool.cpython-36.pyc21750644editdlrm
bounds.cpython-36.opt-1.pyc34980644editdlrm
bounds.cpython-36.pyc34980644editdlrm
commons.cpython-36.opt-1.pyc18660644editdlrm
commons.cpython-36.pyc18660644editdlrm
conditional.cpython-36.opt-1.pyc14570644editdlrm
conditional.cpython-36.pyc14570644editdlrm
constraints.cpython-36.opt-1.pyc71940644editdlrm
constraints.cpython-36.pyc71940644editdlrm
context.cpython-36.opt-1.pyc14870644editdlrm
context.cpython-36.pyc14870644editdlrm
default.cpython-36.opt-1.pyc29150644editdlrm
default.cpython-36.pyc29150644editdlrm
descriptors.cpython-36.opt-1.pyc10980644editdlrm
descriptors.cpython-36.pyc10980644editdlrm
difference.cpython-36.opt-1.pyc49460644editdlrm
difference.cpython-36.pyc51180644editdlrm
fsuse.cpython-36.opt-1.pyc27010644editdlrm
fsuse.cpython-36.pyc27010644editdlrm
genfscon.cpython-36.opt-1.pyc27940644editdlrm
genfscon.cpython-36.pyc27940644editdlrm
ibendportcon.cpython-36.opt-1.pyc28140644editdlrm
ibendportcon.cpython-36.pyc28140644editdlrm
ibpkeycon.cpython-36.opt-1.pyc27990644editdlrm
ibpkeycon.cpython-36.pyc27990644editdlrm
initsid.cpython-36.opt-1.pyc19000644editdlrm
initsid.cpython-36.pyc19000644editdlrm
mls.cpython-36.opt-1.pyc88220644editdlrm
mls.cpython-36.pyc88220644editdlrm
mlsrules.cpython-36.opt-1.pyc34840644editdlrm
mlsrules.cpython-36.pyc34840644editdlrm
netifcon.cpython-36.opt-1.pyc28230644editdlrm
netifcon.cpython-36.pyc28230644editdlrm
nodecon.cpython-36.opt-1.pyc27000644editdlrm
nodecon.cpython-36.pyc27000644editdlrm
objclass.cpython-36.opt-1.pyc24850644editdlrm
objclass.cpython-36.pyc24850644editdlrm
polcap.cpython-36.opt-1.pyc14700644editdlrm
polcap.cpython-36.pyc14700644editdlrm
portcon.cpython-36.opt-1.pyc27420644editdlrm
portcon.cpython-36.pyc27420644editdlrm
properties.cpython-36.opt-1.pyc13300644editdlrm
properties.cpython-36.pyc13300644editdlrm
rbacrules.cpython-36.opt-1.pyc49650644editdlrm
rbacrules.cpython-36.pyc49650644editdlrm
roles.cpython-36.opt-1.pyc24450644editdlrm
roles.cpython-36.pyc24450644editdlrm
terules.cpython-36.opt-1.pyc145900644editdlrm
terules.cpython-36.pyc145900644editdlrm
typeattr.cpython-36.opt-1.pyc25830644editdlrm
typeattr.cpython-36.pyc25830644editdlrm
types.cpython-36.opt-1.pyc31540644editdlrm
types.cpython-36.pyc31540644editdlrm
users.cpython-36.opt-1.pyc31260644editdlrm
users.cpython-36.pyc31260644editdlrm
__init__.cpython-36.opt-1.pyc20400644editdlrm
__init__.cpython-36.pyc20400644editdlrm
Edit: /usr/lib64/python3.6/site-packages/setools/diff/__pycache__/constraints.cpython-36.pyc (7194B)
3 ^"@stddlmZddlmZddlmZddlmZmZm Z ddl m Z ddl m Z Gd d d eZGd d d e Zd S)) namedtuple)ConstraintRuletype)DiffResultDescriptor) Difference SymbolWrapperWrapper)class_wrapper_factory)type_wrapper_factoryc@seZdZdZedZedZedZedZedZ edZ edZ edZ dZ dZdZdZdZdZdZdZddZd d Zd d Zd dZddZddZdS)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_mlsvalidatetransNcCs`|jjdj||jdks&|jdkr.|j|jdd|jDdd|jD\|_|_}dS)zAGenerate the difference in constraint rules between the policies.zJGenerating constraint differences from {0.left_policy} to {0.right_policy}Ncss|]}t|VqdS)N)ConstraintWrapper).0cr#/usr/lib64/python3.6/constraints.py Qsz8ConstraintsDifference.diff_constrains..css|]}t|VqdS)N)r)rrrrrrRs) loginfoformat_left_constrains_right_constrains_create_constrain_lists _set_diffadded_constrainsremoved_constrains)self_rrrr Gs z%ConstraintsDifference.diff_constrainscCs`|jjdj||jdks&|jdkr.|j|jdd|jDdd|jD\|_|_}dS)zEGenerate the difference in MLS constraint rules between the policies.zNGenerating MLS constraint differences from {0.left_policy} to {0.right_policy}Ncss|]}t|VqdS)N)r)rrrrrr_sz;ConstraintsDifference.diff_mlsconstrains..css|]}t|VqdS)N)r)rrrrrr`s) rrr_left_mlsconstrains_right_mlsconstrainsrradded_mlsconstrainsremoved_mlsconstrains)r r!rrrrTsz(ConstraintsDifference.diff_mlsconstrainscCs`|jjdj||jdks&|jdkr.|j|jdd|jDdd|jD\|_|_}dS)zDGenerate the difference in validatetrans rules between the policies.zMGenerating validatetrans differences from {0.left_policy} to {0.right_policy}Ncss|]}t|VqdS)N)r)rrrrrrmsz;ConstraintsDifference.diff_validatetrans..css|]}t|VqdS)N)r)rrrrrrns) rrr_left_validatetrans_right_validatetransrradded_validatetransremoved_validatetrans)r r!rrrrbsz(ConstraintsDifference.diff_validatetranscCs`|jjdj||jdks&|jdkr.|j|jdd|jDdd|jD\|_|_}dS)zHGenerate the difference in MLS validatetrans rules between the policies.zPGenerating mlsvalidatetrans differences from {0.left_policy} to {0.right_policy}Ncss|]}t|VqdS)N)r)rrrrrr{sz>ConstraintsDifference.diff_mlsvalidatetrans..css|]}t|VqdS)N)r)rrrrrr|s) rrr_left_mlsvalidatetrans_right_mlsvalidatetransrradded_mlsvalidatetransremoved_mlsvalidatetrans)r r!rrrrpsz+ConstraintsDifference.diff_mlsvalidatetranscCsZg|_g|_g|_g|_x|jjD]}|jtjkrB|jj |q$|jtj kr\|jj |q$|jtj krv|jj |q$|jtj kr|jj |q$|j jdj|jq$Wg|_g|_g|_g|_x|jjD]}|jtjkr|jj |q|jtj kr|jj |q|jtj kr"|jj |q|jtj kr>|jj |q|j jdj|jqWdS)z$Create rule lists for both policies.z/Unknown rule type: {0} (This is an SETools bug)N)rr"r&r*Z left_policyZ constraintsruletyperZ constrainappendZ mlsconstrainZ validatetransZmlsvalidatetransrerrorrrr#r'r+Z right_policy)r rulerrrrs<       z-ConstraintsDifference._create_constrain_listscCsp|jjdd|_d|_d|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_d|_dS)z%Reset diff results on policy changes.z%Resetting all constraints differencesN)rdebugrrr$r%r(r)r,r-rr"r&r*rr#r'r+)r rrr _reset_diffs" z!ConstraintsDifference._reset_diff)__name__ __module__ __qualname____doc__rrrr$r%r(r)r,r-rrr"r#r&r'r*r+r rrrrr3rrrrr s. $r c@s4eZdZdZdZddZdd Zd d Zd d ZdS)rz#Wrap constraints for diff purposes.r.tclasspermsexprc Cs||_|j|_t|j|_y |j|_Wntk r@d|_YnXt||_g|_x@|j D]6}t |t r|jj t dd|DqZ|jj |qZWdS)Ncss|]}t|VqdS)N)r)ritemrrrrsz-ConstraintWrapper.__init__..) originr.r r8r9AttributeErrorhashkeyr:Z expression isinstance frozensetr/)r r1oprrr__init__s      zConstraintWrapper.__init__cCs|jS)N)r?)r rrr__hash__szConstraintWrapper.__hash__cCs |j|jkS)N)r?)r otherrrr__lt__szConstraintWrapper.__lt__cCs0|j|jko.|j|jko.|j|jko.|j|jkS)N)r.r8r9r:)r rErrr__eq__s   zConstraintWrapper.__eq__N)r.r8r9r:) r4r5r6r7 __slots__rCrDrFrGrrrrrs rN) collectionsrZ policyreprZ descriptorsr differencerrr Zobjclassr typesr r rrrrrs