1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 17:44:56 +09:00

su: Refuse to run if stdin is not a TTY

This commit is contained in:
Andreas Kling 2020-11-08 14:52:33 +01:00
parent 46cd9157cd
commit 6e592fb5c3
Notes: sideshowbarker 2024-07-19 01:30:46 +09:00

View file

@ -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;