Skip to content

Commit

Permalink
Simplify root user check by only evaluating effective user ID
Browse files Browse the repository at this point in the history
  • Loading branch information
hmgle committed Jun 1, 2024
1 parent cccc91c commit ae28def
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion graftcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ int client_main(int argc, char **argv)
if (conf.username) {
struct passwd *pent;

if (getuid() != 0 || geteuid() != 0) {
if (geteuid() != 0) {
fprintf(stderr, "You must be root to use the -u option\n");
exit(1);
}
Expand Down

0 comments on commit ae28def

Please sign in to comment.