File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -98,16 +98,25 @@ def relink_initialworkdir(
9898 # directory, so therefore ineligable for being an output file.
9999 # Thus, none of our business
100100 continue
101- host_outdir_tgt = os .path .join (host_outdir , vol .target [len (container_outdir ) + 1 :])
101+ host_outdir_tgt = os .path .join (
102+ host_outdir , vol .target [len (container_outdir ) + 1 :]
103+ )
104+ mode = (
105+ os .stat (host_outdir_tgt ).st_mode
106+ | stat .S_IWUSR
107+ | stat .S_IWGRP
108+ | stat .S_IWOTH
109+ )
102110 if os .path .islink (host_outdir_tgt ) or os .path .isfile (host_outdir_tgt ):
103- subprocess . run ([ " chmod" , "777" , host_outdir_tgt ], check = True )
111+ os . chmod ( host_outdir_tgt , mode )
104112 os .remove (host_outdir_tgt )
105113 elif os .path .isdir (host_outdir_tgt ) and not vol .resolved .startswith ("_:" ):
106- subprocess . run ([ " chmod" , "777" , host_outdir_tgt ], check = True )
114+ os . chmod ( host_outdir_tgt , mode )
107115 shutil .rmtree (host_outdir_tgt )
108116 if not vol .resolved .startswith ("_:" ):
109117 os .symlink (vol .resolved , host_outdir_tgt )
110118
119+
111120def neverquote (string : str , pos : int = 0 , endpos : int = 0 ) -> Optional [Match [str ]]:
112121 return None
113122
You can’t perform that action at this time.
0 commit comments