feat(server): activate projected authentication safely
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
//go:build linux
|
||||
|
||||
package backup
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
)
|
||||
|
||||
var restoreProjectionEffectiveUID = os.Geteuid
|
||||
|
||||
func requireAuthProjectionRestorePrivilege() error {
|
||||
if restoreProjectionEffectiveUID() != 0 {
|
||||
return errors.New("projected authentication restore requires root")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user