summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xnocompile/bin/AOEU5
-rwxr-xr-xnocompile/bin/aoeu5
-rwxr-xr-xnocompile/bin/ident.sh2
-rwxr-xr-xnocompile/libexec/gopherd.sh3
-rw-r--r--src/libexec/httpd.c2
-rw-r--r--src/libexec/peerip.c10
6 files changed, 22 insertions, 5 deletions
diff --git a/nocompile/bin/AOEU b/nocompile/bin/AOEU
new file mode 100755
index 0000000..dec1983
--- /dev/null
+++ b/nocompile/bin/AOEU
@@ -0,0 +1,5 @@
+#!/usr/bin/tail -n4
+~ ! @ # $ % ^ & * ( ) { }
+ " < > P Y F G C R L ? + |
+ A O E U I D H T N S _
+ : Q J K X B M W V Z
diff --git a/nocompile/bin/aoeu b/nocompile/bin/aoeu
new file mode 100755
index 0000000..e426faf
--- /dev/null
+++ b/nocompile/bin/aoeu
@@ -0,0 +1,5 @@
+#!/usr/bin/tail -n4
+` 1 2 3 4 5 6 7 8 9 0 [ ]
+ ' , . p y f g c r l / = \
+ a o e u i d h t n s -
+ ; q j k x b m w v z
diff --git a/nocompile/bin/ident.sh b/nocompile/bin/ident.sh
new file mode 100755
index 0000000..5a44253
--- /dev/null
+++ b/nocompile/bin/ident.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+printf "$2 , $3\r\n" | nc $1 113 | tr -d '\r'
diff --git a/nocompile/libexec/gopherd.sh b/nocompile/libexec/gopherd.sh
index 0b87223..9d3ba5c 100755
--- a/nocompile/libexec/gopherd.sh
+++ b/nocompile/libexec/gopherd.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+export PATH=$PATH:/usr/local/bin
#set these two variables if you have your server behind DMZ
read -t 10 req
base="$1"
@@ -9,7 +10,7 @@ if grep -v "^${base}" <<< "${realpath}" > /dev/null;then
echo ${realpath}
exit 1
fi
-myIP=$(/usr/local/bin/hop0 $(/usr/local/libexec/peerip))
+myIP=$(hop0 $(/usr/local/libexec/peerip | head -n1))
hostname=$(rdns ${myIP})
if [ ! "${hostname}" ]; then
hostname=${myIP}
diff --git a/src/libexec/httpd.c b/src/libexec/httpd.c
index cd44446..22d9b2b 100644
--- a/src/libexec/httpd.c
+++ b/src/libexec/httpd.c
@@ -87,7 +87,7 @@ int main(int argc,char *argv[]) {
printf("HTTP/1.1 500 Internal Server Error\r\n");
standard_headers();
printf("Content-type: text/html\r\n\r\ncouldn't chdir(\"%s\");",SITES_ROOT);
- //wtf? not sites dir???
+ //wtf? no sites dir???
exit(2);
}
}
diff --git a/src/libexec/peerip.c b/src/libexec/peerip.c
index d35aca7..9298f87 100644
--- a/src/libexec/peerip.c
+++ b/src/libexec/peerip.c
@@ -6,8 +6,12 @@ int main(int argc,char *argv[]) {
int i;
struct sockaddr sa;
int sl=sizeof(sa);
- char host[256];
+ char h[NI_MAXHOST], s[NI_MAXSERV];
getpeername(0,&sa,&sl);
- getnameinfo(&sa,sl,host,256,0,0,NI_NUMERICHOST);
- puts(host);
+ if(getnameinfo(&sa,sl,h,sizeof(h),s,sizeof(s),NI_NUMERICHOST|NI_NUMERICSERV)) {
+ return 1;
+ }
+ puts(h);
+ puts(s);
+ return 0;
}