mirror of
https://github.com/restic/restic.git
synced 2025-11-16 09:53:28 +00:00
Sanitize environment before starting backend processes (rclone, ssh)
The restic security model includes full trust of the local machine, so this should not fix any actual security problems, but it's better to be safe than sorry. Fixes #2192.
This commit is contained in:
@@ -6,10 +6,7 @@ import (
|
||||
"github.com/restic/restic/internal/errors"
|
||||
)
|
||||
|
||||
// StartForeground runs cmd in the foreground, by temporarily switching to the
|
||||
// new process group created for cmd. The returned function `bg` switches back
|
||||
// to the previous process group.
|
||||
func StartForeground(cmd *exec.Cmd) (bg func() error, err error) {
|
||||
func startForeground(cmd *exec.Cmd) (bg func() error, err error) {
|
||||
// just start the process and hope for the best
|
||||
err = cmd.Start()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user