|
Mailing Lists
|
Home /
Groups /
ColdFusion Linux (CF-Linux)
Problem with ColdFusion EXecute
Ok folks, I have a difficult problem and googling does not seem to help. IMark Kruger 01/28/10 10:42 P And CF runs as the nobody user, correct?rex 01/29/10 06:07 A Rex,Mark Kruger 01/29/10 08:43 A > <cfexecute name="#pathToImageMagick##executableFile#"Tom Chiverton 01/29/10 09:36 A Tom,Mark Kruger 01/29/10 09:42 A Tom,Mark Kruger 01/29/10 03:02 P Have you tried to capture the output to see whats happening?Ian Tait 01/29/10 08:52 A Ian,Mark Kruger 01/29/10 08:57 A If you haven't already - try capturing those 2 vars - you might seeIan Tait 01/29/10 08:59 A Ian,Mark Kruger 01/29/10 09:04 A > Yes... I did that in order to construct the exact command line string. MyDave Watts 01/29/10 11:23 A Its quite possible.Ian Tait 01/29/10 09:12 A Ok.. Do you know how to solve that issue? How do I make sure that nobodyMark Kruger 01/29/10 09:16 A Ian,Mark Kruger 01/29/10 09:20 A You can probably see by doing a cat of /etc/passwd (depending on yourIan Tait 01/29/10 09:19 A You've got a firewall, right? :-)Ian Tait 01/29/10 09:22 A Ian,Mark Kruger 01/29/10 09:25 A Ok folks, I have a difficult problem and googling does not seem to help. I have the following code that uses Cfexecute to run the "/conver/" script of the open source "image magic" code. I've successfull installed imagemagic from source. Here's the code: <cfexecute name="#pathToImageMagick##executableFile#" arguments="#replace(actionString, '"', '', "All")#" timeout="#timeout#"> </cfexecute> This produces the following command line.... /usr/local/bin/convert /var/www/clients/site.com/html/userpics/1979385/p1010022.jpg -geometry 80x80+0+0> /var/www/clients/site.com/html/userpics/1979385/sm/p1010022.jpg The name part is "/usr/local/bin/convert" and the rest is the "arguments" part (watch for wrapping). I took this command string and ran it from the command line as root and it worked. I then used "sudo -u nobody" to run it again successfully... so the code is correct - or at least it works from the command line. I've tried fooling with the ownership of the /userpics directory but I don't really think that's the problem because the CFFILE action works fine and creates the initial file. Anyway - does anyone have any advice about working with the cfexecute tag? What should I be looking for? -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com <http://www.cfwebtools.com/> www.coldfusionmuse.com <http://www.coldfusionmuse.com/> <http://www.necfug.com/> www.necfug.com And CF runs as the nobody user, correct? Try running CF as root and see if that works. If it does, it's a permission issue with the nobody user (maybe nobody has permissions to execute convert). If it does not, it may be an issue with cfexecute or something else. Mark Kruger wrote: ----- Excess quoted text cut - see Original Post for more ----- Rex, Ok.... But wouldn't "sudo -u nobody" from the command line show me if "nobody" did not have permissions? It's seems to work fine from the command line (and yes - cf is running as nobody). -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com And CF runs as the nobody user, correct? Try running CF as root and see if that works. If it does, it's a permission issue with the nobody user (maybe nobody has permissions to execute convert). If it does not, it may be an issue with cfexecute or something else. Mark Kruger wrote: ----- Excess quoted text cut - see Original Post for more ----- command line. ----- Excess quoted text cut - see Original Post for more ----- > <cfexecute name="#pathToImageMagick##executableFile#" > arguments="#replace(actionString, '"', '', "All")#" > timeout="#timeout#"> > </cfexecute> Try this instead. <cfexecute name="/bin/bash" arguments='-c "#pathToImageMagick##executableFile# #replace(actionString, '"', '', "All")#"' variable="output" timeout="30" /> Then write 'output' to a file with CFFILE. -- Helping to vitalistically exploit B2C services as part of the IT team of the year 2010, '09 and '08 **************************************************** This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word ?partner? to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.co Tom, Excellent... I'll give it a shot. Thanks Tom. -mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com > <cfexecute name="#pathToImageMagick##executableFile#" > arguments="#replace(actionString, '"', '', "All")#" > timeout="#timeout#"> > </cfexecute> Try this instead. <cfexecute name="/bin/bash" arguments='-c "#pathToImageMagick##executableFile# #replace(actionString, '"', '', "All")#"' variable="output" timeout="30" /> Then write 'output' to a file with CFFILE. -- Helping to vitalistically exploit B2C services as part of the IT team of the year 2010, '09 and '08 **************************************************** This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word "partner" to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.co Tom, That actually did the trick... Thanks very much! -mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com > <cfexecute name="#pathToImageMagick##executableFile#" > arguments="#replace(actionString, '"', '', "All")#" > timeout="#timeout#"> > </cfexecute> Try this instead. <cfexecute name="/bin/bash" arguments='-c "#pathToImageMagick##executableFile# #replace(actionString, '"', '', "All")#"' variable="output" timeout="30" /> Then write 'output' to a file with CFFILE. -- Helping to vitalistically exploit B2C services as part of the IT team of the year 2010, '09 and '08 **************************************************** This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word "partner" to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500. For more information about Halliwells LLP visit www.halliwells.co Have you tried to capture the output to see whats happening? <cfexecute name="#pathToImageMagick##executableFile#" arguments="#replace(actionString, '"', '', "All")#" timeout="#timeout#" variable="LOCAL.output" errorVariable="LOCAL.error" /> Ian Rex, Ok.... But wouldn't "sudo -u nobody" from the command line show me if "nobody" did not have permissions? It's seems to work fine from the command line (and yes - cf is running as nobody). -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com And CF runs as the nobody user, correct? Try running CF as root and see if that works. If it does, it's a permission issue with the nobody user (maybe nobody has permissions to execute convert). If it does not, it may be an issue with cfexecute or something else. Mark Kruger wrote: ----- Excess quoted text cut - see Original Post for more ----- "arguments" > part (watch for wrapping). > > I took this command string and ran it from the command line as root > and it worked. I then used "sudo -u nobody" to run it again > successfully... so the code is correct - or at least it works from the command line. > > I've tried fooling with the ownership of the /userpics directory but I > don't really think that's the problem because the CFFILE action works > fine and creates the initial file. Anyway - does anyone have any > advice about working with the cfexecute tag? What should I be looking for? ----- Excess quoted text cut - see Original Post for more ----- Ian, Yes... I use <cfsavecontent> around it (actually this was already a part of the tag) but there does not appear to be any result. -mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Have you tried to capture the output to see whats happening? <cfexecute name="#pathToImageMagick##executableFile#" arguments="#replace(actionString, '"', '', "All")#" timeout="#timeout#" variable="LOCAL.output" errorVariable="LOCAL.error" /> Ian Rex, Ok.... But wouldn't "sudo -u nobody" from the command line show me if "nobody" did not have permissions? It's seems to work fine from the command line (and yes - cf is running as nobody). -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com And CF runs as the nobody user, correct? Try running CF as root and see if that works. If it does, it's a permission issue with the nobody user (maybe nobody has permissions to execute convert). If it does not, it may be an issue with cfexecute or something else. Mark Kruger wrote: ----- Excess quoted text cut - see Original Post for more ----- "arguments" > part (watch for wrapping). > > I took this command string and ran it from the command line as root > and it worked. I then used "sudo -u nobody" to run it again > successfully... so the code is correct - or at least it works from the command line. > > I've tried fooling with the ownership of the /userpics directory but I > don't really think that's the problem because the CFFILE action works > fine and creates the initial file. Anyway - does anyone have any > advice about working with the cfexecute tag? What should I be looking for? ----- Excess quoted text cut - see Original Post for more ----- If you haven't already - try capturing those 2 vars - you might see something different than in savecontent. Ian Ian, Yes... I use <cfsavecontent> around it (actually this was already a part of the tag) but there does not appear to be any result. -mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Have you tried to capture the output to see whats happening? <cfexecute name="#pathToImageMagick##executableFile#" arguments="#replace(actionString, '"', '', "All")#" timeout="#timeout#" variable="LOCAL.output" errorVariable="LOCAL.error" /> Ian Rex, Ok.... But wouldn't "sudo -u nobody" from the command line show me if "nobody" did not have permissions? It's seems to work fine from the command line (and yes - cf is running as nobody). -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com And CF runs as the nobody user, correct? Try running CF as root and see if that works. If it does, it's a permission issue with the nobody user (maybe nobody has permissions to execute convert). If it does not, it may be an issue with cfexecute or something else. Mark Kruger wrote: ----- Excess quoted text cut - see Original Post for more ----- "arguments" > part (watch for wrapping). > > I took this command string and ran it from the command line as root > and it worked. I then used "sudo -u nobody" to run it again > successfully... so the code is correct - or at least it works from the command line. > > I've tried fooling with the ownership of the /userpics directory but I > don't really think that's the problem because the CFFILE action works > fine and creates the initial file. Anyway - does anyone have any > advice about working with the cfexecute tag? What should I be looking for? ----- Excess quoted text cut - see Original Post for more ----- Ian, Yes... I did that in order to construct the exact command line string. My thought was there is no default shell assigned to "nobody" - what do you think of that idea? -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com If you haven't already - try capturing those 2 vars - you might see something different than in savecontent. Ian Ian, Yes... I use <cfsavecontent> around it (actually this was already a part of the tag) but there does not appear to be any result. -mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Have you tried to capture the output to see whats happening? <cfexecute name="#pathToImageMagick##executableFile#" arguments="#replace(actionString, '"', '', "All")#" timeout="#timeout#" variable="LOCAL.output" errorVariable="LOCAL.error" /> Ian Rex, Ok.... But wouldn't "sudo -u nobody" from the command line show me if "nobody" did not have permissions? It's seems to work fine from the command line (and yes - cf is running as nobody). -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com And CF runs as the nobody user, correct? Try running CF as root and see if that works. If it does, it's a permission issue with the nobody user (maybe nobody has permissions to execute convert). If it does not, it may be an issue with cfexecute or something else. Mark Kruger wrote: ----- Excess quoted text cut - see Original Post for more ----- "arguments" > part (watch for wrapping). > > I took this command string and ran it from the command line as root > and it worked. I then used "sudo -u nobody" to run it again > successfully... so the code is correct - or at least it works from the command line. > > I've tried fooling with the ownership of the /userpics directory but I > don't really think that's the problem because the CFFILE action works > fine and creates the initial file. Anyway - does anyone have any > advice about working with the cfexecute tag? What should I be looking for? ----- Excess quoted text cut - see Original Post for more ----- > Yes... I did that in order to construct the exact command line string. My > thought was there is no default shell assigned to "nobody" - what do you > think of that idea? If nobody has no shell, it won't be able to execute shell commands - which is exactly what CFEXECUTE does. Other things won't work either, which is why the docs mention having a shell for nobody, if I recall correctly. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite. Its quite possible. Ian Ian, Yes... I did that in order to construct the exact command line string. My thought was there is no default shell assigned to "nobody" - what do you think of that idea? -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com If you haven't already - try capturing those 2 vars - you might see something different than in savecontent. Ian Ian, Yes... I use <cfsavecontent> around it (actually this was already a part of the tag) but there does not appear to be any result. -mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Have you tried to capture the output to see whats happening? <cfexecute name="#pathToImageMagick##executableFile#" arguments="#replace(actionString, '"', '', "All")#" timeout="#timeout#" variable="LOCAL.output" errorVariable="LOCAL.error" /> Ian Rex, Ok.... But wouldn't "sudo -u nobody" from the command line show me if "nobody" did not have permissions? It's seems to work fine from the command line (and yes - cf is running as nobody). -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com And CF runs as the nobody user, correct? Try running CF as root and see if that works. If it does, it's a permission issue with the nobody user (maybe nobody has permissions to execute convert). If it does not, it may be an issue with cfexecute or something else. Mark Kruger wrote: ----- Excess quoted text cut - see Original Post for more ----- "arguments" > part (watch for wrapping). > > I took this command string and ran it from the command line as root > and it worked. I then used "sudo -u nobody" to run it again > successfully... so the code is correct - or at least it works from the command line. > > I've tried fooling with the ownership of the /userpics directory but I > don't really think that's the problem because the CFFILE action works > fine and creates the initial file. Anyway - does anyone have any > advice about working with the cfexecute tag? What should I be looking for? ----- Excess quoted text cut - see Original Post for more ----- Ok.. Do you know how to solve that issue? How do I make sure that nobody has a shell? Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Its quite possible. Ian Ian, Yes... I did that in order to construct the exact command line string. My thought was there is no default shell assigned to "nobody" - what do you think of that idea? -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Ian, Actually - I don't really WANT nobody to have a shell do I? Doesn't that mean a user could login via SSH as nobody with no password? -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Ok.. Do you know how to solve that issue? How do I make sure that nobody has a shell? Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Its quite possible. Ian Ian, Yes... I did that in order to construct the exact command line string. My thought was there is no default shell assigned to "nobody" - what do you think of that idea? -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com You can probably see by doing a cat of /etc/passwd (depending on your system) Its been a while since I've played with Linux - things may have changed :-) Ian Ok.. Do you know how to solve that issue? How do I make sure that nobody has a shell? Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Its quite possible. Ian Ian, Yes... I did that in order to construct the exact command line string. My thought was there is no default shell assigned to "nobody" - what do you think of that idea? -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com You've got a firewall, right? :-) Have you tried starting coldfusion as root to see if this is the issue (as someone else mentioned)? Ian Ian, Actually - I don't really WANT nobody to have a shell do I? Doesn't that mean a user could login via SSH as nobody with no password? -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Ok.. Do you know how to solve that issue? How do I make sure that nobody has a shell? Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Its quite possible. Ian Ian, Yes... I did that in order to construct the exact command line string. My thought was there is no default shell assigned to "nobody" - what do you think of that idea? -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Ian, That's next on my list .... I have to look up the syntax for everything though. Linux just isn't second nature to me yet :) -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com You've got a firewall, right? :-) Have you tried starting coldfusion as root to see if this is the issue (as someone else mentioned)? Ian Ian, Actually - I don't really WANT nobody to have a shell do I? Doesn't that mean a user could login via SSH as nobody with no password? -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Ok.. Do you know how to solve that issue? How do I make sure that nobody has a shell? Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Its quite possible. Ian Ian, Yes... I did that in order to construct the exact command line string. My thought was there is no default shell assigned to "nobody" - what do you think of that idea? -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com
|
May 21, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||