mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
su: Refuse to run if stdin is not a TTY
This commit is contained in:
parent
46cd9157cd
commit
6e592fb5c3
|
@ -36,6 +36,11 @@ extern "C" int main(int, char**);
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (!isatty(STDIN_FILENO)) {
|
||||
warnln("{}: standard in is not a terminal", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char* user = nullptr;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
|
|
Loading…
Reference in a new issue