1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 02:27:43 +00:00

Kernel: Added TIOCSTI ioctl placeholder (#6037)

Added a dummy TIOCSTI ioctl placeholder. This is a dangerous ioctl that
can be used to inject input into a tty. Added for compatibility. Always
fails with EIO.
This commit is contained in:
Baitinq 2021-03-31 22:58:41 +02:00 committed by GitHub
parent 6718941715
commit 19c578024b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -414,6 +414,8 @@ int TTY::ioctl(FileDescription&, unsigned request, FlatPtr arg)
case TIOCSCTTY: case TIOCSCTTY:
current_process.set_tty(this); current_process.set_tty(this);
return 0; return 0;
case TIOCSTI:
return -EIO;
case TIOCNOTTY: case TIOCNOTTY:
current_process.set_tty(nullptr); current_process.set_tty(nullptr);
return 0; return 0;

View file

@ -55,6 +55,7 @@ enum IOCtlNumber {
TCFLSH, TCFLSH,
TIOCGWINSZ, TIOCGWINSZ,
TIOCSCTTY, TIOCSCTTY,
TIOCSTI,
TIOCNOTTY, TIOCNOTTY,
TIOCSWINSZ, TIOCSWINSZ,
FB_IOCTL_GET_SIZE_IN_BYTES, FB_IOCTL_GET_SIZE_IN_BYTES,
@ -81,6 +82,7 @@ enum IOCtlNumber {
#define TCFLSH TCFLSH #define TCFLSH TCFLSH
#define TIOCGWINSZ TIOCGWINSZ #define TIOCGWINSZ TIOCGWINSZ
#define TIOCSCTTY TIOCSCTTY #define TIOCSCTTY TIOCSCTTY
#define TIOCSTI TIOCSTI
#define TIOCNOTTY TIOCNOTTY #define TIOCNOTTY TIOCNOTTY
#define TIOCSWINSZ TIOCSWINSZ #define TIOCSWINSZ TIOCSWINSZ
#define FB_IOCTL_GET_SIZE_IN_BYTES FB_IOCTL_GET_SIZE_IN_BYTES #define FB_IOCTL_GET_SIZE_IN_BYTES FB_IOCTL_GET_SIZE_IN_BYTES