diff options
Diffstat (limited to 'src/firejail/fs_dev.c')
-rw-r--r-- | src/firejail/fs_dev.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/firejail/fs_dev.c b/src/firejail/fs_dev.c index b2fa60f63..2f0067c93 100644 --- a/src/firejail/fs_dev.c +++ b/src/firejail/fs_dev.c | |||
@@ -41,6 +41,7 @@ typedef enum { | |||
41 | DEV_TV, | 41 | DEV_TV, |
42 | DEV_DVD, | 42 | DEV_DVD, |
43 | DEV_U2F, | 43 | DEV_U2F, |
44 | DEV_INPUT | ||
44 | } DEV_TYPE; | 45 | } DEV_TYPE; |
45 | 46 | ||
46 | 47 | ||
@@ -89,6 +90,7 @@ static DevEntry dev[] = { | |||
89 | {"/dev/hidraw8", RUN_DEV_DIR "/hidraw8", DEV_U2F}, | 90 | {"/dev/hidraw8", RUN_DEV_DIR "/hidraw8", DEV_U2F}, |
90 | {"/dev/hidraw9", RUN_DEV_DIR "/hidraw9", DEV_U2F}, | 91 | {"/dev/hidraw9", RUN_DEV_DIR "/hidraw9", DEV_U2F}, |
91 | {"/dev/usb", RUN_DEV_DIR "/usb", DEV_U2F}, // USB devices such as Yubikey, U2F | 92 | {"/dev/usb", RUN_DEV_DIR "/usb", DEV_U2F}, // USB devices such as Yubikey, U2F |
93 | {"/dev/input", RUN_DEV_DIR "/input", DEV_INPUT}, | ||
92 | {NULL, NULL, DEV_NONE} | 94 | {NULL, NULL, DEV_NONE} |
93 | }; | 95 | }; |
94 | 96 | ||
@@ -103,7 +105,8 @@ static void deventry_mount(void) { | |||
103 | (dev[i].type == DEV_VIDEO && arg_novideo == 0) || | 105 | (dev[i].type == DEV_VIDEO && arg_novideo == 0) || |
104 | (dev[i].type == DEV_TV && arg_notv == 0) || | 106 | (dev[i].type == DEV_TV && arg_notv == 0) || |
105 | (dev[i].type == DEV_DVD && arg_nodvd == 0) || | 107 | (dev[i].type == DEV_DVD && arg_nodvd == 0) || |
106 | (dev[i].type == DEV_U2F && arg_nou2f == 0)) { | 108 | (dev[i].type == DEV_U2F && arg_nou2f == 0) || |
109 | (dev[i].type == DEV_INPUT && arg_noinput == 0)) { | ||
107 | 110 | ||
108 | int dir = is_dir(dev[i].run_fname); | 111 | int dir = is_dir(dev[i].run_fname); |
109 | if (arg_debug) | 112 | if (arg_debug) |
@@ -386,3 +389,12 @@ void fs_dev_disable_u2f(void) { | |||
386 | i++; | 389 | i++; |
387 | } | 390 | } |
388 | } | 391 | } |
392 | |||
393 | void fs_dev_disable_input(void) { | ||
394 | int i = 0; | ||
395 | while (dev[i].dev_fname != NULL) { | ||
396 | if (dev[i].type == DEV_INPUT) | ||
397 | disable_file_or_dir(dev[i].dev_fname); | ||
398 | i++; | ||
399 | } | ||
400 | } | ||