From: <ps...@us...> - 2008-07-17 10:30:38
|
Revision: 1136 http://znc.svn.sourceforge.net/znc/?rev=1136&view=rev Author: psychon Date: 2008-07-17 10:30:32 +0000 (Thu, 17 Jul 2008) Log Message: ----------- Shell module: Don't give any stdin to executed apps We now close the write end of the pipe that serves as stdin for the apps we run. This means that any read attempts will return EOD (read() returns 0) which should hopefully tell our apps that we don't have stdin for them. Sadly vim doesn't care... (Only thing I tested that still broke) Modified Paths: -------------- trunk/modules/shell.cpp Modified: trunk/modules/shell.cpp =================================================================== --- trunk/modules/shell.cpp 2008-07-17 10:16:40 UTC (rev 1135) +++ trunk/modules/shell.cpp 2008-07-17 10:30:32 UTC (rev 1136) @@ -18,6 +18,11 @@ EnableReadLine(); m_pParent = pShellMod; m_pClient = pClient; + + // Get rid of that write fd, we aren't going to use it + // (And clients expecting input will fail this way). + close(GetWSock()); + SetWSock(open("/dev/null", O_WRONLY)); } // These next two function's bodies are at the bottom of the file since they reference CShellMod virtual void ReadLine(const CString& sData); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |