
    l
jh$                        d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZm	Z	  ej                         d k(  r ed        e j                  d       	 ej                  d   Ze j                   j#                  d e       ej                   j%                  ed      Z e	j(                  d	d
j%                  e j                         d       dZ ej,                  dej.                  e      Zej3                  dddd       ej3                  dddd       ej3                  ddddd       ej5                         Zej8                  rdej                  d<   d dlZej<                  re j>                  jA                  dd       ejB                  raej                  jE                  d       Z#e#De#jI                  d!      Z%d"e%v r/e%jM                  d"       d!j%                  e%      ej                  d <   d dl'Z' e'jP                         Z)ejT                  r# e'jV                         s e j                  d        e jX                  dd= d#gZ-ejB                  s9 e	j\                  d$      re-j#                  d d%       nej8                  r ed&       	 d dl/Z/ e/j`                          e-j#                  d d'       ejl                  rCejl                  e-v rejl                  Z7n- ed*ejl                  z          e j                  d       ne-d    Z7e7ej                  d+<   e7d,v r=e7d'k(  r	 ed-       n ed.       	 d dl8Z8 e j                   e8jr                                y ed/       d dl;Z;	 ej                  d0   Z<d2 Z=	  ej|                  ej~                  j                  d      ZAeAej                  jE                  d3      ZA e=eA      ZB	  ej                  ej~                  j                  d      ZDeDj                  d5d6d5d7ddej                  j                  d8d	      ZHeHeHd    ZInej                  jE                  d9      ZI e=eI      ZJg ZKeKd;gz  ZKeKg d<z  ZKeKd=d>gz  ZKeKd?e<d@z   e<d@z   gz  ZKeKdAe<dBz   e<dBz   gz  ZKeKdCdDgz  ZKeKdEeBeBgz  ZKeKdFeJeJgz  ZK e	j                         ZMeKdAeMeMgz  ZKej                   j%                   e	j                         dG      ZOeKdAeOeOgz  ZKeKg dHz  ZKeKdIgz  ZKeKdJegz  ZKd ZP	 eKD  cg c]#  } | j                  dK e'j                               % c} ZSej8                  rK e         edLj%                  eSddM       j                  dNdO              edLj%                  eSdMd              	  ej                  eS      j                  ZPePe;j                  k7  rn	  e j                  eP       y# e$ r  ed        ed       Y iw xY w# e1$ rZ2ej8                  r ed(       Y dZ2[2?dZ2[2we/jf                  $ r(Z2ej8                  r ed) e4e2      z         Y dZ2[2tdZ2[2we5$ r Y w xY w# e:$ r$Z2 ee2        e j                  d       Y dZ2[2ydZ2[2ww xY w# e$ r d1 ej                         z  Z<Y w xY w# e:$ r(Z2 ed4e2z          e j                  d       Y dZ2[2dZ2[2ww xY w# e:$ rZ2 ed:e2z         Y dZ2[2dZ2[2ww xY wc c} w # ej                  $ r&Z2 edP e4e2             e2j                  ZPY dZ2[2adZ2[2weX$ r Y lw xY w)Q    N)Path)GioGLibzAWarpinator should not be run as root. Please run it in user mode.   WARPINATOR_PATHz1WARPINATOR_PATH missing from environment, exitingzwarpinator.py
PYTHONPATH;TaM  
Modes:

Warpinator can isolate the incoming folder so that files being received will be unable
to 'escape' (for instance, using relative symbolic links).

landlock: only available with kernel >= 5.13, and only if enabled. Warpinator will run like normal,
but individual transfers will be locked inside the incoming folder. You can see if it's enabled on your
system by running `cat /sys/kernel/security/lsm | grep landlock`.

bubblewrap: requires the bwrap command. This is usually in a package called 'bubblewrap' but that may
vary. Warpinator will run in a sandbox (similar to Flatpaks). Only the incoming folder will be writable.
Other locations will be read-only, including the user's home. Changing the incoming folder location will
require a program restart. This mode is not available in the Flatpak version

legacy: Warpinator will run without any sort of protection, though some effort will still be made to
detect relative links.

Warpinator ordinarily will choose which mode to use automatically, depending on what's available. It
will always prefer landlock over bubblewrap, with legacy as a last resort.

Flatpak users: If you can't use Landlock, you'll have to manage hardening yourself by adjusting runtime
permissions. See https://github.com/linuxmint/warp/blob/master/README.md#folder-isolation for information
on how to accomplish this.

z)Send and Receive Files across the Network)descriptionformatter_classepilogz-dz--debugzPrint debugging information.
store_true)helpactionz-az--autostartzBExit if (dconf) org.x.warpinator.preferences 'autostart' is false.z-mz--modez>Specify a sandbox method instead of letting Warpinator decide.store)legacy
bubblewraplandlock)r   r   choices1WARPINATOR_DEBUGgoogleGTK3_MODULES:zxapp-gtk3-moduler   bwrapr   zBubblewrap (bwrap) not foundr   zkLandlock support unavailable - landlock python module not found (https://github.com/Edward-Knight/landlock)z Landlock support unavailable: %szH'%s' mode is not available, see `warpinator --help` for more informationWARPINATOR_SANDBOX_MODEzlegacy, landlockz*Using landlock for incoming file isolationz'Running without incoming file isolationzzUsing bubblewrap for incoming file isolation. Write access for the application will be limited to the save directory only.XDG_RUNTIME_DIRz/run/user/%dc                 L    t        j                  d|       j                  d      S )Nz%unix:(?:path|abstract)=(\/.+?)(?:,|$)r   )researchgroup)addrs    ,/usr/libexec/warpinator/warpinator-launch.pypath_from_bus_addrr#      s    yyA4HNNqQQ    DBUS_SESSION_BUS_ADDRESSz/Could not retrieve the session dbus address: %szorg.a11y.Busz/org/a11y/bus
GetAddressAT_SPI_BUS_ADDRESSzRCould not retrieve the AT_SPI bus address, accessibility features may not work: %sz/usr/bin/bwrap)	--ro-bind/r*   z--devz/dev--bindz/dconfz
--bind-tryz/gvfsdz--tmpfsz/tmpr)   z--ro-bind-trycaja)r+   #save_path#r-   z--die-with-parentz/usr/bin/python3r-    z--z
--zError launching warpinator: %s)Ysysosr   argparse
subprocesspathlibr   gi.repositoryr   r   getuidprintexitenvironsrcKeyErrorpathinsertjoinwarpinator_pathsetenv	mode_helpArgumentParserRawDescriptionHelpFormatterparseradd_argument
parse_argsargsdebugconfigbundle_grpcmodulespopFLATPAK_BUILDgetmods_strsplitmodsremoveprefsSecureModePrefsBlockerenforcer	autostartget_should_autostartargvsupported_modesfind_program_in_pathr   landlock_abi_versionModuleNotFoundErroreSyscallErrorstr
ValueErrormodesandbox_mode
warpinatormain	Exceptionmiscrundirr#   dbus_address_get_for_bus_syncBusTypeSESSIONsession_socket_addrsession_pathbus_get_syncconn	call_syncDBusCallFlagsNONEresa11y_socket_addr	a11y_pathlaunch_argsget_user_cache_dircacheget_user_config_dir	caja_confretreplaceget_save_path	real_argsrun
returncodeEXIT_CODE_RESTART_BWRAPCalledProcessErrorKeyboardInterrupt)args   0r"   <module>r      sD    	 	    # 299;!	
MNCHHQK
**&
'C
 3 '',,sO4 L#((388,d 3	6 
!	 	 -X191U1U^g
i   D)*H'  )   D-.r'  )   D()i",P  R::%(BJJ!"  
KKOOHd# 
zz~~n-H~~c"%KK*+),$BJJ~& '5'')>>%5%%'HHQRL
 * t  )q,/::01	!H!!#1j) 99yyO#yyX[_[d[dde"1%L(4

$ % &'z!:;78"# 
  G  H.-.R?c??@S@SUYZ&"$**..1K"L)*=>
hs 3 3T:nn^,+)!4 ..33' ?"1v!zz~~.BC&'78	 K$%%K``KG00KH():\bem\mnnKL():\bem\mnnKI00KK\hiiKO\effK
 $D##%EL\abbK5T557@IL\effKjjK'((K &_==K
C
 S^^3S[[0C0C0C0EF^	::G#((9Sb>*224@A#((9RS>*+	 *..+66C d222 3 * CHHSMw  	
=>Gt  }zz{| ;zz03q69: 		8  a  .)"))+-.  ?!CD(  hbeffgghF _ ,, 	2CF;,,C  		s   V2 'W ,%X1 Y 2AY= ?A?Z- .([1+[ 2W
WX.W--X.?X""X.-X.1Y6YYY:9Y:=Z*Z%%Z*-[2[[\\  \\