1 /*
2 * SPDX-License-Identifier: GPL-2.0-or-later
3 *
4 * test_tiocsti - test security of TIOCSTI
5 *
6 * Written by Federico Bento <up201407890@alunos.dcc.fc.up.pt>
7 */
8
9 #include <stdlib.h>
10 #include <sys/ioctl.h>
11
12 int main(void)
13 {
14 int rc = 0;
15 char *cmd = "id -u -n\n";
16
17 while(*cmd)
18 rc += ioctl(0, TIOCSTI, cmd++);
19
20 exit(rc ? EXIT_FAILURE : EXIT_SUCCESS);
21 }