-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add INETD support #6
base: master
Are you sure you want to change the base?
Conversation
With the new option "-I" it could be run from the (x)inetd service.
Hi @rofl0r , I've mimic the "--inetd" option of this recent redir implementation from: https://github.com/troglobit/redir I hope you want to merge it. |
Dear @rofl0r <<< ping! |
if(fd != -1) { | ||
copyloop(c.fd, fd); | ||
close(fd); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens in case of error ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rofl0r ,
Yes! Thank you for noticing it. Now, it returns an error exit code. I prefer to not print a message, because in the Inet mode it doesn't have sense. You agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i never used inetd so i dont really know. i guess it's ok now...
i'll read up about inetd next couple days and revise this PR. thanks for the clean work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rofl0r ,
You can test it in any standard Unix like system: using inted
or xinted
daemons. It's very simple. But in fact, you can check in another way: using netcat
(or ncat
or nc
) in listening mode. Because the idea is simple: it reads from the STDIN for the incoming connection.
Regards.
When the tool can't stablish the connection then quit with an error code in the inet mode.
With the new option "-I" it could be run from the (x)inetd service.