diff contrib/whoisd/whoisd.pl @ 1143:ca4d35064aa2 draft

fixed the ns.whois.ano thing... don't remember what I did to whoisd.pl. Oh well.
author epoch <epoch@hacking.allowed.org>
date Mon, 28 Oct 2013 04:16:16 +0000
parents 58130f5eecf2
children da853b90f62b
line wrap: on
line diff
--- a/contrib/whoisd/whoisd.pl	Sat Oct 26 12:22:53 2013 +0000
+++ b/contrib/whoisd/whoisd.pl	Mon Oct 28 04:16:16 2013 +0000
@@ -6,11 +6,17 @@
 
 use strict;
 
+#maybe chroot this whoisd?
 my $RESDB = "/services/resdb/resdb";
 
 my $HACK=0;
 my $QUERY=<stdin>;
 $QUERY =~ s/\r\n//g;
+$QUERY =~ s/\///g;
+if($QUERY eq '') {
+ printf "%% error. no query. wtf?";
+ exit 0;
+}
 my $out;
 my $title;
 my $value;
@@ -97,7 +103,7 @@
 }
 
 # default to assuming it is a name.
-printf "%% user section for %s\n", $QUERY unless $HACK;
+printf "%% user section for '%s'\n", $QUERY unless $HACK;
 
 chdir("$RESDB/db/usr") || die "%% error";
 if(chdir($QUERY)) {