+
    iw  c                   s    R t ^ RIt^ RItRR.tR tR t ! R R]4      t ! R R4      t ! R	 R4      t	]
R
8X  d   ]! ]	! 4       4       R# R# )z-An object-oriented interface to .netrc files.NnetrcNetrcParseErrorc                  sX    \         P                  R 8H  ;'       d    \        \         R4      # )Zposixgetuid)osZnameZhasattr     /usr/lib64/python3.14/netrc.py_can_security_checkr   
   s     77g77'"h"77r   c                 st     ^ RI pVP                  V 4      ^ ,          #   \        \        3 d	    RT  2u # i ; i)    Nzuid )pwdZgetpwuidZImportErrorZLookupError)Zuidr	      & r   	_getpwuidr      s>    ||C ##% cU|s    77c                   s4   a  ] tR t^t o RtRR ltR tRtV tR# )r   z5Exception raised on syntax errors in the .netrc file.Nc                sT    W n         W0n        Wn        \        P	                  W4       R # N)filenamelinenomsg	Exception__init__)selfr   r   r   s   &&&&r   r   ZNetrcParseError.__init__   s     4%r   c                sZ    V P                   : R V P                  : RV P                  : R2# )z (z, line Z))r   r   r   )r   s   &r   __str__ZNetrcParseError.__str__   s    %)XXt}}dkkJJr   )r   r   r   )NN)	__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes____classdictcell__Z__classdict__   @r   r   r      s     ?&K Kr   c                   s8   a  ] tR t^#t o R tR tR tR tRtV t	R# )	_netrclexc                s<    ^V n         Wn        RV n        . V n        R# )   z
	 N)r   instream
whitespacepushback)r   fp   &&r   r   Z_netrclex.__init__$   s    #r   c                s|    V P                   P                  ^4      pVR8X  d   V ;P                  ^,          un        V# )r   
)r   Zreadr   )r   chr
   r   
_read_charZ_netrclex._read_char*   s0    ]]":KK1K	r   c                s   V P                   '       d   V P                   P                  ^ 4      # Rp\        V P                  R4      pV F  pW0P                  9   d   K  VR8X  d8   V F/  pVR8X  d   Vu u # VR8X  d   V P                  4       pW,          pK1  	  KS  VR8X  d   V P                  4       pW,          pV F8  pW0P                  9   d   Vu u # VR8X  d   V P                  4       pW,          pK:  	  K  	  V# )r    Z"Z\)r!   ZpopZiterr&   r    )r   tokenZfiterr%   s   &   r   	get_tokenZ_netrclex.get_token0   s    =====$$Q''T__b)B__$SyBSy$t!__.KE   :*BB__,$t!__.KE   ( r   c                s<    V P                   P                  V4       R # r   )r!   append)r   r(   r#   r   
push_tokenZ_netrclex.push_tokenK   s    U#r   )r   r   r!   r    N)
r   r   r   r   r   r&   r)   r+   r   r   r   r   r   r   r   #   s     6$ $r   r   c                   sB   a  ] tR t^Ot o RR ltR tR tR tR tRt	V t
R# )	r    Nc                s   VR J pVf>   \         P                  P                  \         P                  P                  R4      R4      p/ V n        / V n         \        VRR7      ;_uu_ 4       pV P                  WV4       R R R 4       R #   + '       g   i     R # ; i  \         dJ    \        TRR7      ;_uu_ 4       pT P                  YT4       R R R 4        R #   + '       g   i      R # ; ii ; i)NZ~z.netrczutf-8)ZencodingZlocale)	r   ZpathZjoinZ
expanduserhostsmacrosZopen_parseZUnicodeDecodeError)r   filedefault_netrcr"   s   &&  r   r   Znetrc.__init__P   s    <77<< 2 23 7BD
	5dW--Dm4 .---! 	5dX.."Dm4 /...	5sH   B *B=B B	B B  C/;CC/C+$C/+C/c                sX   \        V4      p VP                  pVP                  4       ;rgV'       g   R# V^ ,          R8X  d>   VP                  V8X  d+   \        V4      ^8X  d   VP                  P                  4        Ks  VR8X  d   VP                  4       pMVR8X  d   RpMVR8X  d   VP                  4       p. V P                  V&    VP                  P                  4       p	V	'       g   \        RWP                  4      hV	R8X  d   M$V P                  V,          P                  V	4       Ke  EK#  \        RV,          WP                  4      hV'       g   \        RV,          WP                  4      hR	;p
;r/ V P                  V&    VP                  pVP                  4       pVP                  R4      '       d.   VP                  V8X  d   VP                  P                  4        Ka  VR9   d$   WV3V P                  V&   VP                  V4       MoVR
8X  g   VR8X  d   VP                  4       p
K  VR8X  d   VP                  4       pK  VR8X  d   VP                  4       pK  \        RV,          WP                  4      hV P                  W#V P                  V,          ^ ,          4       EK  )r   Z#machinedefaultmacdefz.Macro definition missing null line terminator.r$   zbad toplevel token %rzmissing %r namer'   loginuseraccountpasswordzbad follower token %rN>   r'   r3   r2   r1   )r   r   r)   Zlenr   Zreadliner-   r   r*   r,   Z
startswithr+   _security_check)r   r/   r"   r0   ZlexerZsaved_linenoZtoplevelZttZ	entrynameliner4   r6   r7   Zprev_linenos   &&&&          r   r.   Znetrc._parse]   s:   " <<L!OO--HA#<<</CGqLNN++-y!OO-	y%	x!OO-	)+I& >>224D-L ,,0 0 t| KK	*11$7%+b0$F F %&7"&<dLLQQ *,+E+G$&DJJy!#ll__&==%%||{2//1==-2X,FDJJy)$$R(7]bFl!OO-E9_#oo/G:%$0H)*AB*F*.> >  DJJy4I!4LMr   c                s   \        4       '       d   V'       d   VR 8w  d   \        P                  ! VP                  4       4      p\        P                  ! 4       pVP
                  V8w  d3   \        VP
                  4      p\        V4      p\        RV RV R24      hVP                  \        P                  \        P                  ,          ,          '       d   \        R4      hR# R# R# R# )Z	anonymousz~/.netrc file owner (z, z) does not match current userzY~/.netrc access too permissive: access permissions must restrict access to only the ownerN)r   r   ZfstatZfilenor   Zst_uidr   r   Zst_modestatZS_IRWXGZS_IRWXO)r   r"   r0   r4   ZpropZcurrent_user_idZfownerr5   s   &&&&    r   r8   Znetrc._security_check   s      ]u7K88BIIK(D iikO{{o-"4;;/ 1%,VHBtf =% %' ' t|| ;<<%!" " = 8L] r   c                s    WP                   9   d   V P                   V,          # RV P                   9   d   V P                   R,          # R# )z8Return a (user, account, password) tuple for given host.r2   N)r,   )r   hostr#   r   authenticatorsZnetrc.authenticators   s9    ::::d##$**$::i((r   c                s   RpV P                   P                  4        Fd  pV P                   V,          pVRV RV^ ,           R2,          pV^,          '       d   VRV^,           R2,          pVRV^,           R2,          pKf  	  V P                  P                  4        F;  pVRV R2,          pV P                  V,           F  pW,          pK  	  VR,          pK=  	  V# )z3Dump the class data in the format of a .netrc file.r'   zmachine z
	login r$   z		account z
	password zmacdef )r,   Zkeysr-   )r   Zrepr;   ZattrsZmacror9   s   &     r   __repr__Znetrc.__repr__   s    JJOO%DJJt$EXdV:eAhZr::CQxxE!H:R00[q
"--C & [[%%'EWUG2&&CE** +4KC	 (
 
r   )r,   r-   r   )r   r   r   r   r   r.   r8   r<   r=   r   r   r   r   r   r    r    O   s%     5>N@"  r   Z__main__)r   r   r:   Z__all__r   r   r   r   r   r    r   Zprintr   r   r   <module>r>      s`    3 %
&8
	Ki 	K)$ )$Xu un z	%'N r   