@@ -79,7 +79,7 @@ static int dev_exist(const char *dev)
if (dfd < 0)
return 0;
- fd = openat(dfd, dev, O_RDONLY);
+ fd = openat(dfd, dev, O_RDONLY|O_NOCTTY);
close(dfd);
if (fd < 0)
@@ -79,7 +79,7 @@ static void set_console(void)
return;
}
while (tty!=NULL) {
- f = open(tty, O_RDONLY);
+ f = open(tty, O_RDONLY|O_NOCTTY);
if (f >= 0) {
close(f);
break;
@@ -203,6 +203,8 @@ int patch_fd(const char *device, int fd, int flags)
{
int dfd, nfd;
+ flags |= O_NOCTTY;
+
if (device == NULL)
device = "/dev/null";
The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. Disable the use of implicit controlling TTYs. They will be enabled on demand. This fixes a bug where 2 or more consecutive Ctrl-C at the login prompt triggers a reboot of the device. Closes: https://github.com/openwrt/openwrt/issues/11306 Signed-off-by: Markus Gothe <markus.gothe@genexis.eu> --- inittab.c | 2 +- state.c | 2 +- utils/utils.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-)