Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add INETD support #6

wants to merge 2 commits into from

Conversation

lars18th
Copy link

With the new option "-I" it could be run from the (x)inetd service.

With the new option "-I" it could be run from the (x)inetd service.
@lars18th
Copy link
Author

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.

@lars18th
Copy link
Author

Dear @rofl0r <<< ping!

if(fd != -1) {
copyloop(c.fd, fd);
close(fd);
}
Copy link
Owner

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 ?

Copy link
Author

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?

Copy link
Owner

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!

Copy link
Author

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants