← Commit list

49015a60c

Denys Vlasenko
Denys Vlasenko
2018-04-03
SUCCESS Duration: 143s

Subject

hush: fix mishandling of "true | f() { echo QWE; }"

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/hush.c+9 -0
@@ -7705,6 +7705,15 @@ static void pseudo_exec(nommu_save_t *nommu_save,
struct command *command,
char **argv_expanded)
{
+#if ENABLE_HUSH_FUNCTIONS
+ if (command->cmd_type == CMD_FUNCDEF) {
+ /* Ignore funcdefs in pipes:
+ * true | f() { cmd }
+ */
+ _exit(0);
+ }
+#endif
+
if (command->argv) {
pseudo_exec_argv(nommu_save, command->argv,
command->assignment_cnt, argv_expanded);