Server commander
#11
"Massive security hole v0.1" ?
You could try redirecting the output using "./malware > out.txt < in.txt 2>&1", which should work both in linux and windows.
Although, i have no idea why it would deadlock except for the command not terminating.
Reply
Thanks given by: JuliB
#12
Actually it's a problem with how Linux handles creating new processes. It does so by using fork(), which duplicates the current process, and then exec(), which replaces the current binary with another binary. It works pretty well for traditional programs, but doesn't cooperate too well with threads - only the thread calling the fork() function is copied, the rest of the threads are thrown away in the copy of the executable, which means that if any of those threads held any mutexes, those mutexes will be locked forever in the child process. If one of those mutexes just happens to be something important, such as CRT's mutex for memory allocations, we're in trouble.
Reply
Thanks given by: jan64 , JuliB
#13
@jan64 Yes, absolutely, but I expect this to be used for private matters instead of using it publicly.
Reply
Thanks given by:
#14
Is there any other way to communicate with the OS? I believe creating a file is enough. After a server restart the server script can detect the file and react (Plan B).
Reply
Thanks given by:
#15
Creating a file should be easy enough - use Lua's built-in IO library.

Another option would be to use an external process listening on a socket to actually execute the commands. You'd lose the possibility of IO redirection and waiting for process end, but it would work. Also, not too platform-independent.
Reply
Thanks given by: JuliB
#16
(12-23-2015, 08:25 PM)JuliB Wrote: And how can I use the IO library? Is it like C++ with ofstream? Sry, I'm a total newbie...

Maybe it is better if I get it out myself Wink
But thank you for help me ! (correct english?)
Reply
Thanks given by:




Users browsing this thread: 6 Guest(s)