aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-01-02 22:50:45 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2010-01-02 22:50:45 +0200
commit663969c2cd1abc4a0681b2a02f7a8bf76dbe7da9 (patch)
treebc246be401da9aa3846b5b2821d4fc82fd0740a5
parente113d685f81852992a08b5dabab93dd97f0fee59 (diff)
downloadwydawca-663969c2cd1abc4a0681b2a02f7a8bf76dbe7da9.tar.gz
wydawca-663969c2cd1abc4a0681b2a02f7a8bf76dbe7da9.tar.bz2
Bugfixes.
* src/directive.c (run_check_script): Close stdin. Call shell as "sh".
-rw-r--r--src/directive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/directive.c b/src/directive.c
index 3d70fa8..401397d 100644
--- a/src/directive.c
+++ b/src/directive.c
@@ -446,13 +446,13 @@ run_check_script (const char *script, struct file_triplet *trp,
signal (SIGALRM, SIG_DFL);
efd = stderr_redirector (script_file);
if (efd == -1)
_exit (127);
- for (i = getdtablesize (); i > 0; i--)
+ for (i = getdtablesize (); i >= 0; i--)
{
if (i != p[1] && i != efd)
close (i);
}
if (p[1] != 1 && dup2 (p[1], 1) != 1)
@@ -475,13 +475,13 @@ run_check_script (const char *script, struct file_triplet *trp,
setenv ("WYDAWCA_URL", spool->url, 1);
setenv ("WYDAWCA_TRIPLET_BASE", trp->name, 1);
setenv ("WYDAWCA_DIST_FILE", trp->file[file_dist].name, 1);
chdir (temp_homedir);
- argv[0] = "-sh";
+ argv[0] = "sh";
argv[1] = script_file;
argv[2] = NULL;
execv ("/bin/sh", argv);
_exit (127);
}

Return to:

Send suggestions and report system problems to the System administrator.