mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
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) git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1136 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -18,6 +18,11 @@ public:
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user