 |
 | found 2 bugs in the code matt.ratus | 1:03 27 Sep '07 |
|
 |
Built this under VS2003 and am running it on XP SP2. I've incorporated the edits from yaseeen's mail to get it compiling ok. I've gone with all the options set on the original project, except swapped to using /MTd (i.e. no .dll required)
So then it runs ok, but quite often just does not execute a request from rsh.
So: one problem is the use of tmpnam() - which, if you read the comments only guarantees to work in a single run of a process upto TMP_MAX times - which can be as low as 26. After that anything can happen -ie it does not guarantee to get you a unique filename. Well, obviously not much good in a daemon process which could be processing n,1000 requests per session - and you can see the error with creating temp files is output in the rshd.log file... So in CRshdSocket::ExecCommand I've replaced it with:
char TempFile[256], TempErr[256]; char* TempDir = getenv("TEMP");
CStr ComBuff = Command; memset(TempFile, 0, sizeof(TempFile)); memset(TempErr, 0, sizeof(TempErr)); if(!TempDir) { strcpy(TempFile, "."); } GetTempFileName(TempDir, "rsh", 0, TempFile);
ComBuff += " >"; ComBuff += TempFile;
if (m_pRshd->GetWinOSVersion()) { if(TempDir) { strcpy(TempErr, "."); } GetTempFileName(TempDir, "rse", 0, TempErr);
}
That improves it quite alot - but there were *still* problems, in that it was still ignoring commands occasionally - this time without error indication in the log - it was particularly bad when running a series of rsh commands from a bat file. I tracked down where the error was manifesting itself and have a fix, but, quite frankly I don't really know why it's a problem.
The problem is in CRshdSocket::OpenTempSocket() - and in here it occasionally loses the command (stored in Buff + i) - it just gets reset to an empty string. However I found that if i change the code from:
Buff[0] = 0; if (Send(Buff, 1) < 1)
TO:
char XBuff[10]; XBuff[0] = 0; if (Send(XBuff, 1) < 1)
then it all works fine - but I don't know why! In theory the old code should work (although the way it's written is a bit obscure), and most of the time it does work. So I suspect that there is a race condition due to the multithreading and my "fix" is just hiding the real issue. But I'm not wasting more time on this for now - it works for me, and I've got other things to do. Anyone who finds out what the real problem is, please post back (or: maybe just a link to another rshd program that is more robust then this one).
|
|
|
|
 |
 | No EXE files in download rswain | 9:49 12 Nov '06 |
|
 |
Hi, There are no .exe files in the download demo version. How do you build them as I don't have a compiler. The documentation implies that there are .exe files included.
Many Thanks
Richard Swain
|
|
|
|
 |
 | Executable on Win 2k? Bert Cohen | 10:31 26 Jun '06 |
|
 |
Hi,
Is it possible to get a copy of the executable for Win2K?
Thanks Bert
|
|
|
|
 |
 | RSH using pure C joefsg | 4:09 3 Jun '06 |
|
 |
hi there,
my name is joe and i am interested in your rsh source code. Since some weeks i am looking for a telnet\rlogin client source. My problem is, that i am not realy into socket programming and i am tryn to get a telnet\rlogin written in C only. I am actualy developing a not-commercial video-game and thats what i need a rsh\telnet code for. I ve already tryed to port your rsh code into my but it wont work. Since i am using the "Quake 3 engine " i would need a c implementation anyway. So you may have a another code, maybe written in c, that i can build into my own c code??
thank you,
Joe
|
|
|
|
 |
 | binaries 993tt | 11:33 11 May '06 |
|
 |
Hi. Could you please send me the binaries to run on Win2K server? Thanks.
Tom
|
|
|
|
 |
 | compile on Visual Studio .NET 2003 ?? yaseeen | 0:00 5 May '06 |
|
 |
Hello,
i can't compile the Demo on VS .NET 2003. It doesn't work.
fatal error C1083: Cannot open include file: 'fstream.h': No such file or directory fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory
Can you help?
regards
Demir
|
|
|
|
 |
|
 |
Ok i find it
Compile works on VS .NET 2003.
you have to delete the extension <***.h> at <iostream.h> and <fstream.h>. Then you need "using namespace std;"
That looks like so:
---rsh.cpp--- #include <iostream> #include <stdio.h> #include <process.h>
using namespace std;
---Confile.cpp--- #include <windows.h> #include <io.h> #include <fstream> #include <stdio.h> using namespace std;
#include "Confile.h"
in List.h you have to put typename's
---list.h---
template<class TYPE, class ARG_TYPE> typename List<TYPE, ARG_TYPE>::CNode* List<TYPE, ARG_TYPE>::NewNode(typename List::CNode* pPrev,typename List::CNode* pNext)
and
template<class TYPE, class ARG_TYPE> void List<TYPE, ARG_TYPE>::FreeNode(typename List::CNode* pNode)
Confile.cpp change to:
// Log error ofstream fLogFile (m_LogFile, ios::app); //deleted filebuff::openprot fLogFile << szDate << " , " << szTime << endl; if (Function) { fLogFile << "Function: " << Function << endl; fLogFile << "Index: " << nLine << endl; } fLogFile << m_LogText << endl; fLogFile << "-------------------------------------------------------" << endl; Unlock();
---------------
now you could compile
regards
Demir
|
|
|
|
 |
 | How to compile in VS 2005 ratass2002 | 8:58 21 May '06 |
|
 |
First of all follow all the above steps.
Secondly you have to do the following.
Add "wd 4430" to "Configuration Properties | C/C++ | Command Line"to avoid error 4430 - missing type specifier. Add this change to the project with this problem. I think Rsh and Utility projects have this problem.
Small change From:
len = (int)pow(2, i);
To:
len = (int)pow(2.0f, i); //it was complaining it was ambiguous
Great project!
|
|
|
|
 |
|
 |
I forgot to mention that you need to do the following
"Configuration Properties | C/C++ | Code Generation" Under "RunTime library" select the "Multi-Threaded Debug /MTd" or "Multi-Threaded /MT" according to your compiler setting (i.e.: debug or release).
VS 2005 selects /MD and /MDd by default which makes your output binaries small (you might like that) but your program might not run successfully on all platforms. Basically you don't want the DLL dependencies to be on the client machine but rather in your binaries. If you use "/MT" and "/MT" the resulting files are bigger but they won't have dependencies.
When I first loaded the project I saw that "/MT" (usually for release mode) was applied to my debug build and it was complaining something is already defined in some .lib file. Usually this is a library linking problem (linking debug and release together for example or order of linkage). When all the correct libraries (are being used) are linked in the correct order and you still get an error there is actually one command to ignore this problem but I can't remember what it is (i'll post back when I find it).
|
|
|
|
 |
 | Regarding Problem using Demo Project ntimesc | 21:18 2 Apr '06 |
|
 |
hi, i had tried a lot to run the demo project on WIndows XP but it is not running. so could u just explain me how to run this project on windows xp...
The Only Way To Get Smarter is By Playing Smarter Opponent
|
|
|
|
 |
 | PASSWORD?? joefsg | 23:53 25 Mar '06 |
|
 |
why there is no password authentification===?????
when i try to login to my FreeBSD Server, is says @Login incorrect all the time!!
Joe
|
|
|
|
 |
 | Binaries too eeggaa | 6:15 22 Mar '06 |
|
 |
Could you send me the executable files, please
Emilio Gutierrez
|
|
|
|
 |
 | Compile error URBANPROJECT | 6:35 3 Feb '06 |
|
 |
Hi, Could you send me the binaries files because I can´t compile the rshd source
Thanks, Laurent
|
|
|
|
 |
 | Binaries Too! silo_xtreme | 12:32 1 Feb '06 |
|
 |
Hi can i please have the binaries (someone), I am having troubles compiling
|
|
|
|
 |
 | Did anyone get copies of the binaries? -- I want too, please... paulbeam | 16:41 11 Jul '05 |
|
 |
I don't have access to a compiler.
Thanks much.
|
|
|
|
 |
 | rcp from other machine : invalid port number Michel GIRARD_TA | 23:11 15 Jun '05 |
|
 |
Hello,
First of all, I highly appreciated your hwole job (good source files, good VisualStudio workspace, good explanations) ! I generated the binaries very quickly (one shot !). I successfully remote execute "dir c:\" for example, from a Linux machine. using rsh. My problem is that, when I try to copy a file from the linux machine to the PC (under Windows XP Pro) using the following command : rcp filetocopy MyPC:filecopied" , rshd writes the following message (in rshd.log) : "Client port (0) out of the 513-1023 range" (I slightly changed rshd.cpp so it tells the incriminated port number).
I also tried to copy a file from the PC to the PC using the following coommand : "rcp MyPC:filetocopy filecopied" I alternatively get the following messages (in the cmd window) : "Connection timeout" and "Wrong error number". Nota : the above messages are translated from french, so they might slightly differ from the real ones.
I hope this message will reach and interest you.
Thank you in advance.
P.S My brief profile : Michel GIRARD, 49 years old, leaving and working in south of France, interested in software (C++, ...)
|
|
|
|
 |
 | Binaries too! cesarsouza | 13:48 31 Mar '05 |
|
 |
I'm unable to compile your program in recent versions of VC, borland, gcc mingw and whatever compiler I found near me...
So can you please send me these binaries?
thanks in advance Cesar
|
|
|
|
 |
 | Binaries jairorod | 11:46 5 Jan '05 |
|
 |
Could you send me the executable files , I can´t compile the source
thanks in advances,
Jairo J. Rodriguez U.
|
|
|
|
 |
 | no execute johnsevillano33 | 14:26 16 Sep '04 |
|
 |
I do it all I copy files in c:\Rs rsh.exe rshd.exe rshd.ini and the others mi .rhost file is configure as
host user name jsevillano jsevillano
then I start rshd.exe and from the prompt type rsh jsevillano -l jsevillano dir c:\ but nothing results display
mi log file display this
******************************************************* C:\RS\rshd.log LOG FILE jueves, 16 de septiembre de 2004 , 18:30:03 Software version: Version 1.02 ******************************************************* jueves, 16 de septiembre de 2004 , 18:30:11 Function: CheckClienInfo Index: 0 Remote host name = jsevillano.reniecperu.net ------------------------------------------------------- jueves, 16 de septiembre de 2004 , 18:30:11 Function: OpenTempSocket Index: 0 Remote user name 'jsevillano' is accesing the Rshd service ------------------------------------------------------- jueves, 16 de septiembre de 2004 , 18:30:11 Function: OpenTempSocket Index: 4 Host name = 'jsevillano.reniecperu.net' : user name = 'jsevillano' have something wrong -------------------------------------------------------
when i try with user remote is the same
somebody can help me
DSKJHDLdlhahd
|
|
|
|
 |
|
 |
I think your host name is jsevillano.reniecperu.net. So try jsevillano.reniecperu.net instead of jsevillano.
Dr. Yuantu Huang
|
|
|
|
 |
 | binary Deepak Mahbubani | 23:07 1 Jul '04 |
|
 |
Could you please mail me the binaries.
|
|
|
|
 |
|
 |
Hi Deepak,
How can I get your email address to send you the binary files. I think the easy way is to compile the source code using VC 6.0.
Yuantu
|
|
|
|
 |
 | no error and no output; log: "have something wrong" Mark2 | 23:59 20 Jun '04 |
|
 |
hello,
I tried two NT4 workstations with SP6a. What I did was: 1. on server I create a directory C:\RS and copied all files from your bin directory into 2. on server started rshd.exe, console closes immediately 3. rshd.exe is running, shown by taskmanager 4. on client (named asterix) I started rsh server dir c:\ but I got no output 5. checked logfile on server: Function: CheckClienInfo Remote host name = ASTERIX Function: OpenTempSocket Remote user name 'Administrator' is accesing the Rshd service Function: OpenTempSocket Host name = 'ASTERIX' : user name = 'Administrator' have something wrong
Do you have an idea ?
thanks for your efforts regards Mark
|
|
|
|
 |
|
 |
Hi Mark,
Do you add a line containing remote host name and user name? If not, please add it in. I think it will fix your problem
Yuantu
|
|
|
|
 |
|
 |
Hi Yuantu,
thanks for answering! it helps, but now I got an error on client: --------------------------------------------- C:\RS>rsh Troubadix Administrator The error output socket is trapping in accept Can not accept the error output socket --------------------------------------------- and the server log contains: --------------------------------------------- Function: OpenErrorSocket Errorcode: WSAEADDRINUSE --------------------------------------------- which ip adress/port you are using? can I specify anotherone on startup?
thanks and regards Mark
PS: sorry if you got this twice
|
|
|
|
 |