Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

Commit

Permalink
Retrieve root's name after user's name
Browse files Browse the repository at this point in the history
  • Loading branch information
xyb3rt committed Oct 9, 2013
1 parent df19cca commit 76ea7fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.c
Expand Up @@ -135,14 +135,14 @@ int main(int argc, char **argv) {
set_sysrq_state(SYSRQ_PATH, 0);
}

get_uname(&root, 0);
if (options->user) {
user.name = options->user;
} else {
uid = getuid();
get_uname(&user, uid);
}

get_uname(&root, 0);
get_pwhash(&root);
only_root = strcmp(user.name, root.name) == 0;
if (!only_root) {
Expand Down

0 comments on commit 76ea7fb

Please sign in to comment.