Hi,
We are trying to encrypt a data file and have built a batch file to do this.
Calling the batch via CFEXECUTE just produces an empty output file each time
whereas calling the script from the command line produces the correct data.
<CFEXECUTE
NAME="/bin/sh"
TIMEOUT="60"
ARGUMENTS="/tmp/shell.1"
OUTPUTFILE="/tmp/output.1"
>
</CFEXECUTE>
The command /bin/sh /tmp/shell.1 outputs the correct data in /tmp/output.1 and
we have altered the permissions on the shell and clear text files to ensure
they are not causing a problem
Is there something obvious we are missing?
This is runing 7.0.2 on Linux
Giles B - 29 Nov 2006 20:41 GMT
just a thought - the value for 'name' should be the absolute path of the application you are wanting to execute - is what you are trying to run /bin/sh or /bin/sh/tmp/shell.1 ?
cdsdave - 30 Nov 2006 14:54 GMT
The solution!
Coldfusion was running under a user that did not have the capability to login
to /bin/sh this for some reason means that it can successfully create the
output file output.1 but not actually manage to put any content within it.
To resolve I edited /etc/passwd to change the nologin option to /bin/sh
This enabled us to then login to "su - username" and then execute "/bin/sh
/tmp/shell.1" This produced the desired output to the command line. On
reloading the coldfusion page the output was now generated within the page.
Giles> Thanks for your help the full command was actually /bin/sh /tmp/shell.1
so I passed the shell command as an argument rather than it being a complete
file name.
Dave