Skip to content

Commit ae16b96

Browse files
Merge pull request #8 from macadmins/check_for_root
Bail if we're root
2 parents 911e71a + c8302b3 commit ae16b96

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ func setDefault(identifier string) error {
3838
return fmt.Errorf("identifier cannot be empty")
3939
}
4040

41+
// Todo: actually run as the logged in user if run as root. For now just bail
42+
if os.Geteuid() == 0 {
43+
return fmt.Errorf("this tool must be run as the logged in user")
44+
}
45+
4146
c, err := client.NewClient()
4247
if err != nil {
4348
return err

0 commit comments

Comments
 (0)