+
    ,iB"  c                   s   a  R t0 t ^ RIHt ^ RIt^RIHtHtHtHtH	t	 ^RI
HtHt Rt] ^ k  ! R R]P                  ]P                  ]P                   4      tR# )	    )IterableN)	exceptionmixins	policyrepqueryutil)CriteriaDescriptorCriteriaSetDescriptorTERuleQueryc                   s  a  ] tR t^t o Rt]]P                  ,          ! ]P                  R7      t]	]P                  ,          ! RR4      tRtRt]	]P                  ,          ! RR4      tRtRt]	]P"                  ,          ! RR4      tRt]]P(                  ,          ! R	R
4      tRtRtRtRt]V 3R lR l4       t]P8                  V 3R lR l4       tV 3R lR ltV 3R ltRtV t R# )r	   a	  
Query the Type Enforcement rules.

Parameter:
policy            The policy to query.

Keyword Parameters/Class attributes:
ruletype          The list of rule type(s) to match.
source            The name of the source type/attribute to match.
source_indirect   If true, members of an attribute will be
                  matched rather than the attribute itself.
                  Default is true.
source_regex      If true, regular expression matching will
                  be used on the source type/attribute.
                  Obeys the source_indirect option.
                  Default is false.
target            The name of the target type/attribute to match.
target_indirect   If true, members of an attribute will be
                  matched rather than the attribute itself.
                  Default is true.
target_regex      If true, regular expression matching will
                  be used on the target type/attribute.
                  Obeys target_indirect option.
                  Default is false.
tclass            The object class(es) to match.
tclass_regex      If true, use a regular expression for
                  matching the rule's object class.
                  Default is false.
perms             The set of permission(s) to match.
perms_equal       If true, the permission set of the rule
                  must exactly match the permissions
                  criteria.  If false, any set intersection
                  will match.
                  Default is false.
perms_regex       If true, regular expression matching will be used
                  on the permission names instead of set logic.
                  Default is false.
perms_subset      If true, the rule matches if the permissions criteria
                  is a subset of the rule's permission set.
                  Default is false.
default           The name of the default type to match.
default_regex     If true, regular expression matching will be
                  used on the default type.
                  Default is false.
boolean           The set of boolean(s) to match.
boolean_regex     If true, regular expression matching will be
                  used on the booleans.
                  Default is false.
boolean_equal     If true, the booleans in the conditional
                  expression of the rule must exactly match the
                  criteria.  If false, any set intersection
                  will match.  Default is false.
)Z
enum_classsource_regexZlookup_type_or_attrFTtarget_regexdefault_regexboolean_regexZlookup_booleanNc                sB   < V ^8  d   QhRS[ P                  R,          /# )   returnN)r   XpermSetformat__classdict__   ":/usr/lib64/python3.14/site-packages/setools/terulequery.py__annotate__TERuleQuery.__annotate__W   s      	**T1     c                s    V P                   # N_xperms)selfs   &r   xpermsTERuleQuery.xpermsV   s    ||r   c                sX   < V ^8  d   QhRS[ S[S[S[3,          ,          R,          RR/# )r   valueNr   )r   tupleintr   r   r   r   r   [   s-        HU38_5<    r   c           	     s   V'       d   \         \        ,          ! 4       pV Fu  w  r4^ Tu;8:  d   R8:  g   M \        VR R24      h^ Tu;8:  d   R8:  g   M \        VR R24      hWC8  d   Y4r4VP                  R \	        W4^,           4       4       4       Kw  	  \
        P                  ! V4      V n        R# RV n        R# )r    i  z#07xz is not a valid ioctl.c              3   s$   "   T F  qx  K  	  R # 5ir   ) )Z.0Zi   & r   Z	<genexpr>Z%TERuleQuery.xperms.<locals>.<genexpr>i   s     %F1EAa1Es   N)Zsetr!   Z
ValueErrorZupdateZranger   r   r   )r   r   Zpending_xpermsZlowZhighs   &&   r   r   r   Z   s     XZN"	S*F*$Dz1G%HIIT+V+$T{2H%IJJ: ##%%%Fs1H1E%FF # %--n=DLDLr   c                sD   < V ^8  d   QhRS[ S[P                  ,          /# )r   r   )r   r   Z	AnyTERuler   r   r   r   r   o   s"     p p)"5"56 pr   c              #  s
  "   V P                   P                  RV P                   24       V P                   P                  RV P                  : 24       V P                   P                  RV P
                  : RV P                  : RV P                  : 24       V P                   P                  RV P                  : RV P                  : RV P                  : 24       V P                  V P                   4       V P                  V P                   4       V P                   P                  R	V P                  : R
V P                  : 24       V P                   P                  RV P                  : RV P                   : 24       V P                   P                  RV P"                  : RV P$                  : RV P&                  : 24       V P                  P)                  4        EF  pV P                  '       d   VP                  V P                  9  d   K3  V P
                  '       dJ   \*        P,                  ! VP
                  V P
                  V P                  V P                  4      '       g   K  V P                  '       dJ   \*        P,                  ! VP                  V P                  V P                  V P                  4      '       g   K  V P/                  V4      '       g   EK   V P0                  '       da   VP2                  '       dO   V P4                  '       d   \7        V P0                  4      ^8  d   EKW  VP8                  V P0                  9  d   EKu  MV P;                  V4      '       g   EK    V P                  '       dA   \*        P@                  ! VP0                  V P                  V P                  R4      '       g   EK  T P                  '       dC    \*        P,                  ! TP                  T P                  RT P                   4      '       g   EK7   T P"                  '       dW    \*        P@                  ! TPB                  PD                  T P"                  T P$                  T P&                  4      '       g   EK   Tx  EK  	  R#   \<        P>                   d     EK  i ; i  \<        P>                   d     EK  i ; i  \<        P>                   d     EK  i ; i  \<        PF                   d     EK  i ; i5i)z-Generator which yields all matching TE rules.z Generating TE rule results from zself.ruletype=zself.source=z, self.source_indirect=z, self.source_regex=zself.target=z, self.target_indirect=z, self.target_regex=zself.xperms=z, self.xperms_equal=zself.default=z, self.default_regex=zself.boolean=z, self.boolean_equal=z, self.boolean_regex=FTN)$ZlogZinfoZpolicyZdebugruletypesourcesource_indirectr
   targettarget_indirectr   Z_match_object_class_debugZ_match_perms_debugr   xperms_equaldefaultr   booleanboolean_equalr   Zterulesr   Zmatch_indirect_regexZ_match_object_classZpermsZextendedZperms_equalZlenZ
xperm_typeZ_match_permsr   ZRuleUseErrorZmatch_regex_or_setZconditionalZbooleansZRuleNotConditional)r   Zruler"   r   resultsZTERuleQuery.resultso   s    8FG.$--)*+,$++'?$*>*>)@@U4CTCTBVWX,$++'?$*>*>)@@U4CTCTBVWX&&txx0),$++'<$*;*;)=>?-$,,(>4+=+=*?@A-$,,(>4+=+=*??U$BTBTAVWXKK'')D }}}==5
 {{{4#<#<KKKK((%%	$' $'
 
 {{{4#<#<KKKK((%%	$' $'
 
 ++D11
:::$---'''C

Oa,? ! djj8  9**400 1	;;;t'>'>

))	( (
  |||  44 LL LL  ..	0 0
 !0 |||22 ,,55 LL .. ..	0 0
 !0 JI *f ))  )) " !--  !33 s   H#T &AT -T AT T !T %R7R	RR5T 8RT R.T 3R)<R)T <ST ,AS#=T R&!T %R&&T )S>T ST S T S  T #S=8T <S==T c                s   < V ^8  d   Qh/ S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[ ;R&   S[P                  R,          ;R	&   S[ ;R
&   # )r   r
   r%   r   r'   r   r   r+   Nr   r(   )Zboolr   r   r   r   r   r   r      s     t u v  w z { |  } @ A D E F G H $&-I J K r   r   )!Z__name__Z
__module__Z__qualname__Z__firstlineno__Z__doc__r   r   Z
TERuletyper#   r   Z
TypeOrAttrr$   r
   r%   r&   r   r'   ZTyper)   r   ZBooleanr*   r   r+   r   r(   Zpropertyr   Zsetterr,   Z__annotate_func__Z__static_attributes__Z__classdictcell__)r      @r   r	   r	      s     4l %Y%9%9:iFZFZ[H	 4 45nF[\FL O	 4 45nF[\FL O 0BWXGM#I$5$56HXYGMM)-GL  ]]   (p pA  r   c                s    V ^8  d   Qh/ ^ \         9   d,   \        P                  \        \        R3,          ,          ;R&   # )r   .__all__)__conditional_annotations__typingZFinalr    Zstr)r   s   "r   r   r      s+     $ $ : 9eCHo	& 9 %r   )r	   )r/   Zcollections.abcr   r0   Z r   r   r   r   r   Zdescriptorsr   r   r.   ZMatchObjClassZMatchPermissionZPolicyQueryr	   r   )r/   r-   r   <module>r1      sF    % $  7 7 B)9 9P&&&(>(>@Q@Q Pr   