+
    ,i  c                   s   a  R t0 t ^ RIt^ RIt^ RIHtHt ^ RIHt ^ RIt^RI	H
t
 ^RIHt ^RIHtHtHt / t] ^ k Rt] ^k  ! R R	]4      t ! R
 R]R7      tR# )i    N)ABCMetaabstractmethod)Mapping)InvalidCheckOption)SELinuxPolicy)CHECK_DESC_KEYCHECK_DISABLEGLOBAL_CONFIG_KEYSCheckerModulec                   s6   a a ] tR t^t oRtV 3R ltRtVtV ;t# )CheckRegistryzQChecker module registry metaclass.  This registers modules in the check registry.c                s  < VP                  R 4      pVP                  R4      pVR8w  d~   \        V\        4      '       g   \        RV R24      h\        V\        4      '       g   \        RV R24      hV\
        9   d)   \
        V,          P                  p\        RV RV 24      h\        SV `!  WW#4      pV'       d
   V\
        V&   V# )
check_typecheck_configr   zChecker module z does not set a check_type.z# does not set a valid check_config.z! conflicts with registered check )	getZ
isinstancestrZ	TypeError	frozensetCHECKER_REGISTRY__name__Zsuper__new__)	ZclsZclsnameZsuperclassesZattributedictr
   r   Zexisting_check_moduleZclassdef	__class__s	   &&&&    D/usr/lib64/python3.14/site-packages/setools/checker/checkermodule.pyr   ZCheckRegistry.__new__   s    "&&|4
$((8o%j#../':U VWWlI66/':] ^__--(8(D(M(M%%gY /((='>@A A 7?3M+3Z(     )	r   
__module____qualname____firstlineno____doc__r   __static_attributes____classdictcell__Z__classcell__)r   __classdict__s   @@r   r	   r	      s     [ r   r	   c                   s   a  ] tR t^4t o RtRt]P                  tV 3R lR lt	V 3R lR lt
V 3R lR ltV 3R	 lR
 lt]V 3R lR l4       tV 3R ltRtV tR# )r   z/Abstract base class for policy checker modules.Fc                sF   < V ^8  d   QhRS[ RS[RS[S[S[3,          RR/# )   policy	checknameconfigreturnN)r   r   r   formatr      "r   __annotate__CheckerModule.__annotate__K   s4     1 1} 1 1gcSVhFW 1\` 1r   c                sP   Wn         W n        \        P                  ! V P                  4      V n        \        V P                  ,          pV F#  pWT9  g   K  \        V P                   R V 24      h	  VP                  \        4      V n        VP                  \        4      V n        R# )z: Invalid option: N)r   r   loggingZ	getLoggerr   logr   r   r   r   r   descr   disable)selfr   r   r    Zvalid_optionsZks   &&&&  r   __init__ZCheckerModule.__init__K   s    "$$T__5 +T->->>A%(DNN+;;MaS)QRR 
 JJ~.	zz-0r   c                $   < V ^8  d   QhRS[ RR/# r   msgr!   Nr   r"   r$   r   r%   r&   Z   s      C D r   c                s    V P                   P                  V4       V P                   P                  R4       V P                  P                  V4       R# )z Output an informational message.
N)outputwriter(   debugr+   r/      &&r   log_infoZCheckerModule.log_infoZ   s6    #$sr   c                r-   r.   r0   r"   r$   r   r%   r&   `   s     ' '# '$ 'r   c                s    V P                   '       d    V P                  P                  RV R24       V P                  P	                  RV 24       R# )zn
Log findings that pass the check.  By default these messages are
suppressed unless self.log_passing is True.
zP   * r1   N)log_passingr2   r3   r(   r4   r5   r6   r   log_okZCheckerModule.log_ok`   sA    
 KKse2./u~&r   c                r-   r.   r0   r"   r$   r   r%   r&   i   s     ' 'C 'D 'r   c                s    V P                   P                  V P                  '       d   RMR RV R24       V P                  P	                  RV 24       R# )z!Log findings that fail the check.ZFZ z   * r1   zF   * N)r2   r3   r8   r(   r4   r5   r6   r   log_failZCheckerModule.log_faili   sE    D$4$4$4S#>eC5KLu~&r   c                s    < V ^8  d   QhRS[ /# )r   r!   )Zlistr"   r$   r   r%   r&   o   s      T r   c                s    R# )z|
Run the configured check on the policy.

Return:   List of failed items in the check.  If the check passes, list is empty.
Nr   )r+   s   &r   runZCheckerModule.runn   s     	r   c                s   < V ^8  d   Qh/ S[ P                  S[,          ;R&   S[ P                  S[S[,          ,          ;R&   S[ P                  S[,          ;R&   S[ P
                  ;R&   S[;R&   # )r   r
   r   r8   r2   r   )typingZClassVarr   r   ZboolZTextIOr   r"   r$   r   r%   r&   4   si      $$  //)C.11   &.! & MM&' * + r   )r   r)   r*   r(   r   N)r   r   r   r   r   r8   sysZstdoutr2   r,   r7   r9   r:   r   r;   Z__annotate_func__r   r   )r      @r   r   r   4   s^     9 */K  JJF1 1 ' '' '
  w  r   )Z	metaclassc                s    V ^8  d   Qh/ ^ \         9   d   \        \        \        3,          ;R&   ^\         9   d,   \        P
                  \        \        R3,          ,          ;R&   # )r   r   .__all__)__conditional_annotations__Zdictr   Ztyper<   ZFinalZtuple)r#   s   "r   r%   r%      sC    

 ' &$sDy/ &  < ;eCHo	& ; r   )r   )r@   r=   r'   Zabcr    r   Zcollections.abcr   r<   Z	exceptionr   Z	policyrepr   Z
globalkeysr   r   r   r   r?   r	   r   r%   )r@   r>   r   <module>rA      sR    
  ' #  * % I I %'  &); ;G :Am Ar   