mirror of
https://github.com/borgbackup/borg.git
synced 2025-03-09 13:53:09 +00:00
Merge pull request #7915 from ThomasWaldmann/fix-subcommand-env-1.2
create --*-from-command: run subcommands with a clean environment
This commit is contained in:
commit
4e349cf3fa
1 changed files with 4 additions and 2 deletions
|
@ -533,7 +533,8 @@ class Archiver:
|
|||
if not dry_run:
|
||||
try:
|
||||
try:
|
||||
proc = subprocess.Popen(args.paths, stdout=subprocess.PIPE, preexec_fn=ignore_sigint)
|
||||
env = prepare_subprocess_env(system=True)
|
||||
proc = subprocess.Popen(args.paths, stdout=subprocess.PIPE, env=env, preexec_fn=ignore_sigint)
|
||||
except (FileNotFoundError, PermissionError) as e:
|
||||
self.print_error('Failed to execute command: %s', e)
|
||||
return self.exit_code
|
||||
|
@ -552,7 +553,8 @@ class Archiver:
|
|||
paths_sep = eval_escapes(args.paths_delimiter) if args.paths_delimiter is not None else '\n'
|
||||
if args.paths_from_command:
|
||||
try:
|
||||
proc = subprocess.Popen(args.paths, stdout=subprocess.PIPE, preexec_fn=ignore_sigint)
|
||||
env = prepare_subprocess_env(system=True)
|
||||
proc = subprocess.Popen(args.paths, stdout=subprocess.PIPE, env=env, preexec_fn=ignore_sigint)
|
||||
except (FileNotFoundError, PermissionError) as e:
|
||||
self.print_error('Failed to execute command: %s', e)
|
||||
return self.exit_code
|
||||
|
|
Loading…
Add table
Reference in a new issue