diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/firecfg/firecfg.config | 10 | ||||
-rw-r--r-- | src/firejail/util.c | 29 |
2 files changed, 29 insertions, 10 deletions
diff --git a/src/firecfg/firecfg.config b/src/firecfg/firecfg.config index 4cfbb5480..e9ecab925 100644 --- a/src/firecfg/firecfg.config +++ b/src/firecfg/firecfg.config | |||
@@ -111,6 +111,7 @@ calligrawords | |||
111 | cameramonitor | 111 | cameramonitor |
112 | cantata | 112 | cantata |
113 | catfish | 113 | catfish |
114 | cawbird | ||
114 | celluloid | 115 | celluloid |
115 | checkbashisms | 116 | checkbashisms |
116 | cheese | 117 | cheese |
@@ -136,6 +137,7 @@ code | |||
136 | code-oss | 137 | code-oss |
137 | com.github.dahenson.agenda | 138 | com.github.dahenson.agenda |
138 | com.github.johnfactotum.Foliate | 139 | com.github.johnfactotum.Foliate |
140 | com.gitlab.newsflash | ||
139 | conkeror | 141 | conkeror |
140 | conky | 142 | conky |
141 | conplay | 143 | conplay |
@@ -238,6 +240,7 @@ freemind | |||
238 | freeoffice-planmaker | 240 | freeoffice-planmaker |
239 | freeoffice-presentations | 241 | freeoffice-presentations |
240 | freeoffice-textmaker | 242 | freeoffice-textmaker |
243 | freetube | ||
241 | freshclam | 244 | freshclam |
242 | frogatto | 245 | frogatto |
243 | frozen-bubble | 246 | frozen-bubble |
@@ -333,6 +336,7 @@ hedgewars | |||
333 | hexchat | 336 | hexchat |
334 | highlight | 337 | highlight |
335 | hitori | 338 | hitori |
339 | homebank | ||
336 | host | 340 | host |
337 | hugin | 341 | hugin |
338 | hyperrogue | 342 | hyperrogue |
@@ -436,6 +440,7 @@ mate-calculator | |||
436 | mate-color-select | 440 | mate-color-select |
437 | mate-dictionary | 441 | mate-dictionary |
438 | mathematica | 442 | mathematica |
443 | mattermost-desktop | ||
439 | mcabber | 444 | mcabber |
440 | mediainfo | 445 | mediainfo |
441 | mediathekview | 446 | mediathekview |
@@ -448,6 +453,7 @@ meteo-qt | |||
448 | midori | 453 | midori |
449 | min | 454 | min |
450 | mindless | 455 | mindless |
456 | minecraft-launcher | ||
451 | minetest | 457 | minetest |
452 | mirrormagic | 458 | mirrormagic |
453 | mocp | 459 | mocp |
@@ -502,6 +508,7 @@ neverball | |||
502 | neverputt | 508 | neverputt |
503 | newsbeuter | 509 | newsbeuter |
504 | newsboat | 510 | newsboat |
511 | newsflash | ||
505 | nheko | 512 | nheko |
506 | nicotine | 513 | nicotine |
507 | nitroshare | 514 | nitroshare |
@@ -536,7 +543,7 @@ orage | |||
536 | ostrichriders | 543 | ostrichriders |
537 | out123 | 544 | out123 |
538 | palemoon | 545 | palemoon |
539 | pandoc | 546 | #pandoc |
540 | parole | 547 | parole |
541 | patch | 548 | patch |
542 | pavucontrol | 549 | pavucontrol |
@@ -778,6 +785,7 @@ xfburn | |||
778 | xfce4-dict | 785 | xfce4-dict |
779 | xfce4-mixer | 786 | xfce4-mixer |
780 | xfce4-notes | 787 | xfce4-notes |
788 | xfce4-screenshooter | ||
781 | xiphos | 789 | xiphos |
782 | xlinks | 790 | xlinks |
783 | xmms | 791 | xmms |
diff --git a/src/firejail/util.c b/src/firejail/util.c index 6bfc80903..3aa0584d6 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c | |||
@@ -957,16 +957,27 @@ int remove_overlay_directory(void) { | |||
957 | return 0; | 957 | return 0; |
958 | } | 958 | } |
959 | 959 | ||
960 | // flush stdin if it is connected to a tty and has input | ||
960 | void flush_stdin(void) { | 961 | void flush_stdin(void) { |
961 | if (isatty(STDIN_FILENO)) { | 962 | if (!isatty(STDIN_FILENO)) |
962 | int cnt = 0; | 963 | return; |
963 | int rv = ioctl(STDIN_FILENO, FIONREAD, &cnt); | 964 | |
964 | if (rv == 0 && cnt) { | 965 | int cnt = 0; |
965 | fwarning("removing %d bytes from stdin\n", cnt); | 966 | int rv = ioctl(STDIN_FILENO, FIONREAD, &cnt); |
966 | rv = ioctl(STDIN_FILENO, TCFLSH, TCIFLUSH); | 967 | if (rv != 0 || cnt == 0) |
967 | (void) rv; | 968 | return; |
968 | } | 969 | |
969 | } | 970 | fwarning("removing %d bytes from stdin\n", cnt); |
971 | |||
972 | // If this process is backgrounded, below ioctl() will trigger | ||
973 | // SIGTTOU and stop us. We avoid this by ignoring SIGTTOU for | ||
974 | // the duration of the ioctl. | ||
975 | sighandler_t hdlr = signal(SIGTTOU, SIG_IGN); | ||
976 | rv = ioctl(STDIN_FILENO, TCFLSH, TCIFLUSH); | ||
977 | signal(SIGTTOU, hdlr); | ||
978 | |||
979 | if (rv) | ||
980 | fwarning("Flushing stdin failed: %s\n", strerror(errno)); | ||
970 | } | 981 | } |
971 | 982 | ||
972 | // return 1 if new directory was created, else return 0 | 983 | // return 1 if new directory was created, else return 0 |