File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,8 +15,7 @@ import (
1515)
1616
1717func (proxy * Proxy ) dropPrivilege (userStr string , fds []* os.File ) {
18- currentUser , err := user .Current ()
19- if err != nil && currentUser .Uid != "0" {
18+ if os .Geteuid () != 0 {
2019 dlog .Fatal ("Root privileges are required in order to switch to a different user. Maybe try again with 'sudo'" )
2120 }
2221 userInfo , err := user .Lookup (userStr )
Original file line number Diff line number Diff line change @@ -17,8 +17,7 @@ import (
1717)
1818
1919func (proxy * Proxy ) dropPrivilege (userStr string , fds []* os.File ) {
20- currentUser , err := user .Current ()
21- if err != nil && currentUser .Uid != "0" {
20+ if os .Geteuid () != 0 {
2221 dlog .Fatal ("Root privileges are required in order to switch to a different user. Maybe try again with 'sudo'" )
2322 }
2423 userInfo , err := user .Lookup (userStr )
You can’t perform that action at this time.
0 commit comments