From ed8e0cd55272bb5c400a8efa1e8eec062ad3892d Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 9 Dec 2007 17:06:03 +0000 Subject: [PATCH] (execute): Clients can't reliably detect where a redirection ends because the server doesn't send C_PROMPT. The client simply rejects such redirections since servcmd.c rev. 1.42. Before it didn't, but incorrectly extended the redirection until the end of the script, and screwed up when there was more than one redirection in the execute. Make the server reject such redirections as well, because that's probably more useful and certainly less painful than documenting this mess. --- src/lib/player/player.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lib/player/player.c b/src/lib/player/player.c index 70ea2fe7..9814ceb8 100644 --- a/src/lib/player/player.c +++ b/src/lib/player/player.c @@ -237,7 +237,6 @@ status(void) } /* - * actually a command; redirection and piping ignored. * XXX This whole mess should be redone; execute block should * start with "exec start", and should end with "exec end". * We'll wait until 1.2 I guess. @@ -252,7 +251,6 @@ execute(void) char scanspace[1024]; failed = 0; - redir = NULL; if (player->comtail[1]) p = player->comtail[1]; @@ -270,16 +268,17 @@ execute(void) failed = 1; continue; } - if (redir == NULL) - pr("\nExecute : %s\n", buf); - if (dispatch(buf, redir) < 0) + pr("\nExecute : %s\n", buf); + if (redir) { + pr("Execute : redirection not supported\n"); + failed = 1; + } else if (dispatch(buf, NULL) < 0) failed = 1; } if (failed) { while (recvclient(buf, sizeof(buf)) >= 0) ; } - if (redir == NULL) - pr("Execute : %s\n", failed ? "aborted" : "terminated"); + pr("Execute : %s\n", failed ? "aborted" : "terminated"); player->eof = 0; return RET_OK; }