aboutsummaryrefslogtreecommitdiff
path: root/src/senddata.cc
diff options
context:
space:
mode:
authortradke <tradke@83718e91-0e4f-0410-abf4-91180603181f>2006-08-16 14:48:39 +0000
committertradke <tradke@83718e91-0e4f-0410-abf4-91180603181f>2006-08-16 14:48:39 +0000
commit7ba07fd91cd11fc06504e07475314ab0cb80793f (patch)
tree977ace4cccfa68bf320557f27db21df0a6454cd2 /src/senddata.cc
parent29bf3eb2b8ad0ad8ecddcfe8c8c03a5690279355 (diff)
Fix problems for (t)csh login-shell users with stdin/stdout/stderr redirection
in system commands: explicitely use /bin/sh to execute these commands. git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@114 83718e91-0e4f-0410-abf4-91180603181f
Diffstat (limited to 'src/senddata.cc')
-rw-r--r--src/senddata.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/senddata.cc b/src/senddata.cc
index 0022749..ad227f1 100644
--- a/src/senddata.cc
+++ b/src/senddata.cc
@@ -123,8 +123,8 @@ namespace Formaline
// Make the script executable
ostringstream chmodbuf;
- chmodbuf << "chmod a+x " << scriptfilenamestr
- << " < /dev/null > /dev/null 2> /dev/null";
+ chmodbuf << "/bin/sh -c 'chmod a+x " << scriptfilenamestr
+ << " < /dev/null > /dev/null 2> /dev/null'";
string const chmodstr = chmodbuf.str();
char const * const chmod = chmodstr.c_str();
system (chmod);
@@ -238,13 +238,15 @@ namespace Formaline
ostringstream cmdbuf;
if (my_use_relay_host)
{
- cmdbuf << "ssh -x " << my_relay_host << " '"
+ cmdbuf << "ssh -x " << my_relay_host << " \"/bin/sh -c '"
<< "cd " << cwd << " && ";
+ } else {
+ cmdbuf << "/bin/sh -c '";
}
- cmdbuf << scriptfilenamestr << " < /dev/null > /dev/null 2> /dev/null";
+ cmdbuf << scriptfilenamestr << " < /dev/null > /dev/null 2> /dev/null'";
if (my_use_relay_host)
{
- cmdbuf << "'";
+ cmdbuf << "\"";
}
string const cmdstr = cmdbuf.str();
char const * const cmd = cmdstr.c_str();