X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fsystem.c;h=71a812d5b7a2e01c3e94ee1e6fc2e472e949b1a5;hb=d30babc23b4f25be970ada2e63a50220a3672281;hp=94142336ef6d021868836cf94a97720ee9d20429;hpb=4aa85f09e755fc827cd5ab6225f20c83cd42245d;p=debian%2Ftar diff --git a/src/system.c b/src/system.c index 94142336..71a812d5 100644 --- a/src/system.c +++ b/src/system.c @@ -1,6 +1,7 @@ /* System-dependent calls for tar. - Copyright 2003-2008, 2010, 2013-2014 Free Software Foundation, Inc. + Copyright 2003-2008, 2010, 2013-2014, 2016 Free Software Foundation, + Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -26,13 +27,14 @@ static _Noreturn void xexec (const char *cmd) { - struct wordsplit ws; + char *argv[4]; - ws.ws_env = (const char **) environ; - if (wordsplit (cmd, &ws, (WRDSF_DEFFLAGS | WRDSF_ENV) & ~WRDSF_NOVAR)) - FATAL_ERROR ((0, 0, _("cannot split string '%s': %s"), - cmd, wordsplit_strerror (&ws))); - execvp (ws.ws_wordv[0], ws.ws_wordv); + argv[0] = (char *) "/bin/sh"; + argv[1] = (char *) "-c"; + argv[2] = (char *) cmd; + argv[3] = NULL; + + execv ("/bin/sh", argv); exec_fatal (cmd); } @@ -330,6 +332,7 @@ sys_child_open_for_compress (void) pid_t grandchild_pid; pid_t child_pid; + signal (SIGPIPE, SIG_IGN); xpipe (parent_pipe); child_pid = xfork ();