@@ -66,7 +66,7 @@ private static function writeWithSudo(string $filename, string $content): void
6666 self ::copyOwnership ($ filename , $ tempFilename );
6767 }
6868
69- Process::run ([Sudo::find (), 'mv ' , $ tempFilename , $ filename ]);
69+ Process::run ([Sudo::find (), 'mv ' , $ tempFilename , $ filename ], timeout: Process:: SHORT_TIMEOUT );
7070 }
7171
7272 /**
@@ -77,18 +77,18 @@ private static function copyOwnership(string $sourceFile, string $targetFile): v
7777 {
7878 try {
7979 // GNU chmod supports `--reference`, so try this first
80- Process::run ([Sudo::find (), 'chmod ' , '--reference= ' . $ sourceFile , $ targetFile ]);
80+ Process::run ([Sudo::find (), 'chmod ' , '--reference= ' . $ sourceFile , $ targetFile ], timeout: Process:: SHORT_TIMEOUT );
8181
8282 return ;
8383 } catch (ProcessFailedException ) {
8484 // Fall back to using `stat` to determine uid/gid
8585 try {
8686 // Try using GNU stat (-c) first
87- $ userAndGroup = Process::run (['stat ' , '-c ' , '%u:%g ' , $ sourceFile ], timeout: 2 );
87+ $ userAndGroup = Process::run (['stat ' , '-c ' , '%u:%g ' , $ sourceFile ]);
8888 } catch (ProcessFailedException ) {
8989 try {
9090 // Fall back to using OSX stat (-f)
91- $ userAndGroup = Process::run (['stat ' , '-f ' , '%u:%g ' , $ sourceFile ], timeout: 2 );
91+ $ userAndGroup = Process::run (['stat ' , '-f ' , '%u:%g ' , $ sourceFile ]);
9292 } catch (ProcessFailedException ) {
9393 return ;
9494 }
@@ -98,7 +98,7 @@ private static function copyOwnership(string $sourceFile, string $targetFile): v
9898 return ;
9999 }
100100
101- Process::run ([Sudo::find (), 'chown ' , $ userAndGroup , $ targetFile ]);
101+ Process::run ([Sudo::find (), 'chown ' , $ userAndGroup , $ targetFile ], timeout: Process:: SHORT_TIMEOUT );
102102 }
103103 }
104104}
0 commit comments