#!/usr/bin/perl
-# $Id: ud-fingerserv,v 1.4 1999/10/16 21:44:30 tausq Exp $
+# $Id: ud-fingerserv,v 1.6 1999/10/17 01:36:33 tausq Exp $
# (c) 1999 Randolph Chung. Licensed under the GPL. <tausq@debian.org>
-#use lib '/home/randolph/projects/userdir-ldap/web';
+use lib '/home/randolph/projects/userdir-ldap/web';
use strict vars;
#use Apache::Registry;
use IO::Handle;
# Global settings...
my %config = &Util::ReadConfigFile;
my %opts;
-getopt("iqh", \%opts);
+getopts("iqhv", \%opts);
my $use_inetd = $config{use_inetd} || $opts{i};
$| = 1;
my $ldap = Net::LDAP->new($config{ldaphost}) || die $1;
$ldap->bind;
-if ($use_inetd == 0) {
+if (!$use_inetd) {
&log("Binding to port 79") if (defined($opts{v}));
my $server = IO::Socket::INET->new(Proto => 'tcp',
LocalPort => 'finger(79)',
$client->close;
}
} else { # inetd
- $opts{q} = 1; # Temp, until i figure out wth tcpd doesn't pass parameters to this program properly
&log("inetd mode");
my $sockaddr = getpeername(STDIN);
my ($port, $addr) = unpack_sockaddr_in(getpeername(STDIN));