
    yfd                     "   S r SSKrSSKrSSKrSSKrSSKrSSKrSSKJr	  SSK
Jr  SSKJr  \" 5       rSSKJrJrJrJr  Sr\R                  R)                  S	5      (       a  \R*                  R-                  S
S5      r\R0                  " S\5      r\ Hj  r\R)                  S5      (       d  M  \" SS9r\R8                  " SS/\S9r\	" \R=                  S5      R1                  5       S   5      r\\	" S5      :  a  Sr  O   SS jr SS jr!SS jr"g)zPA basic extended attributes (xattr) implementation for Linux, FreeBSD and macOS.    N)parse   )prepare_subprocess_env)create_logger)	listxattrgetxattrsetxattrENOATTRFlinux
LD_PRELOAD z[ :]libfakerootT)systemfakerootz-v)envasciiz1.20.2c                 V   [         R                  " U SS9 nUR                  5       nSu  p4 [        X#U5         [        U5      nX5;  a
   SSS5        g[        X#5      U:H  sSSS5        $ ! [         a     SSS5        gf = f! [         a     SSS5        gf = f! , (       d  f       g= f)z4Determine if xattr is enabled on the filesystem
    zborg-tmp)dirprefix)s	   user.names   valueNF)tempfileNamedTemporaryFilefilenor	   OSErrorr   r   )pathffdnamevaluenamess         ,/usr/lib/python3/dist-packages/borg/xattr.py
is_enabledr"   )   s     
	$	$j	AQXXZ,	Ru%	bME  
B	A !U* 
B	A
  	 
B	A
	  	 
B	A	 
B	AsQ   BA*BBB*
A?4B>A??B
BBBB
B(c           	          [        U [        5      (       a  [        R                  " U 5      n 0 n [	        XS9nU H  n [        XUS9=(       d    SX$'   M     U$ ! [         aS  nUR                  [        4;   a   SnAMD  [        R                  SUR                  SS9[        U5      5         SnAMw  SnAff = f! [         a:  nUR                  [        R                  [        R                  4;   a   SnAU$ e SnAff = f)a  
Return all extended attributes on *path* as a mapping.

*path* can either be a path (str or bytes) or an open file descriptor (int).
*follow_symlinks* indicates whether symlinks should be followed
and only applies when *path* is not an open file descriptor.

The returned mapping maps xattr names (bytes) to values (bytes or None).
None indicates, as a xattr value, an empty value, i.e. a value of length zero.
follow_symlinksNz&when getting extended attribute %s: %sreplaceerrors)
isinstancestrosfsencoder   r   r   errnor
   loggerwarningdecodeENOTSUPEPERM)r   r%   resultr    r   es         r!   get_allr5   <   s     ${{4 F$@Dt  (OT\X\ , M!  t77wk) NN#KT[[`i[Mjlopqlrsst  77u}}ekk22  M sR   B9 AB9 
B6#B18B9 >-B1+B9 1B66B9 9
C=.C87C88C=c           	         [        U [        5      (       a  [        R                  " U 5      n SnUR	                  5        H  u  pE [        XU=(       d    SUS9  M     U$ ! [         a  nSnUR                  [        R                  :X  a  S[        U5      -  nOCUR                  [        R                  :X  a  S[        U5      [        U5      4-  nO[        U5      n[        R                  SUR                  SS	9U5         S
nAM  S
nAff = f)a  
Set all extended attributes on *path* from a mapping.

*path* can either be a path (str or bytes) or an open file descriptor (int).
*follow_symlinks* indicates whether symlinks should be followed
and only applies when *path* is not an open file descriptor.
*xattrs* is mapping maps xattr names (bytes) to values (bytes or None).
None indicates, as a xattr value, an empty value, i.e. a value of length zero.

Return warning status (True means a non-fatal exception has happened and was dealt with).
F    r$   Tz too big for this filesystem (%s)z/fs full or xattr too big? [xattr len = %d] (%s)z&when setting extended attribute %s: %sr&   r'   N)r)   r*   r+   r,   itemsr	   r   r-   E2BIGENOSPClenr.   r/   r0   )r   xattrsr%   r/   kvr4   err_strs           r!   set_allr@   e   s     ${{4 G	j Tah3H	 ( N  	jGww%++%<s1vEELL( LsSTvWZ[\W]N^^
 a&NNCQXXU^XE_ahii	js   A
D	(BDD	)N)F)#__doc__r-   r+   re
subprocesssysr   packaging.versionr   parse_versionhelpersr   r.   r   platformr   r   r	   r
   XATTR_FAKEROOT
startswithenvirongetr   splitpreloadspreloadr   check_outputfakeroot_outputr0   fakeroot_versionr"   r5   r@    r7   r!   <module>rT      s    V  	 	  
  4 + !	 < < <<7##b1Jxx
+Hm,,(5C(55z46HcRO,_-C-CG-L-R-R-TUW-XY=#:: "& +&&R#r7   