samuraictf / gatekeeper

GATEKEEPER: Inline and on-target defense
119 stars 15 forks source link

test over xinetd #1

Closed bool101 closed 8 years ago

zachriggle commented 9 years ago

xinetd doesn't make any changes such that something that works on stdin and stdout won't work

bool101 commented 9 years ago

True, but at the very least I am currently dup2(1,2) to redirect stderr to stdout and changing stdio to non buffered mode on the server side. So, it's still good to do a simple test.

zachriggle commented 9 years ago

Captured from Slack

10:13 PM] cseagle: bool getpeername(0, ...) should work fine in an inetd program that was launched from xinetd
[10:13 PM] cseagle: need to check error code and ignore failures when you are just running from the command line for testing
[10:13 PM] cseagle: because getpeername(0, ...)  will fail with ENOTSOCK
zachriggle commented 9 years ago

Ping. This gatekeeper branch needs tests. I'd recommend using bats: https://github.com/sstephenson/bats