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:
psychon
2008-07-17 10:30:32 +00:00
parent 0003c28f7b
commit 27c1a76cf8

View File

@@ -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);