--- zzzz-none-000/linux-5.4.213/scripts/kconfig/conf.c 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/scripts/kconfig/conf.c 2024-08-14 09:02:15.000000000 +0000 @@ -38,6 +38,7 @@ static int indent = 1; static int tty_stdio; +static int valid_stdin = 1; static int sync_kconfig; static int conf_cnt; static char line[PATH_MAX]; @@ -70,6 +71,16 @@ *p-- = 0; } +static void check_stdin(void) +{ + if (!valid_stdin) { + printf("aborted!\n\n"); + printf("Console input/output is redirected. "); + printf("Run 'make oldconfig' to update configuration.\n\n"); + exit(1); + } +} + /* Helper function to facilitate fgets() by Jean Sacren. */ static void xfgets(char *str, int size, FILE *in) { @@ -104,6 +115,7 @@ printf("%s\n", def); return 0; } + check_stdin(); /* fall through */ case oldaskconfig: fflush(stdout); @@ -298,6 +310,7 @@ printf("%d\n", cnt); break; } + check_stdin(); /* fall through */ case oldaskconfig: fflush(stdout); @@ -626,6 +639,7 @@ } no_conf_write = 1; } + valid_stdin = tty_stdio; } switch (input_mode) {