18 lines
293 B
Go
18 lines
293 B
Go
//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
|
|
}
|