#! /usr/local/bin/perl -wT # get local DCC parameters for DCC whitelist CGI scripts. # Copyright (c) 2006 by Rhyolite Software, LLC # # This agreement is not applicable to any entity which sells anti-spam # solutions to others or provides an anti-spam solution as part of a # security solution sold to other entities, or to a private network # which employs the DCC or uses data provided by operation of the DCC # but does not provide corresponding data to other users. # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # Parties not eligible to receive a license under this agreement can # obtain a commercial license to use DCC and permission to use # U.S. Patent 6,330,590 by contacting Commtouch at http://www.commtouch.com/ # or by email to nospam@commtouch.com. # # A commercial license would be for Distributed Checksum and Reputation # Clearinghouse software. That software includes additional features. This # free license for Distributed ChecksumClearinghouse Software does not in any # way grant permision to use Distributed Checksum and Reputation Clearinghouse # software # # THE SOFTWARE IS PROVIDED "AS IS" AND RHYOLITE SOFTWARE, LLC DISCLAIMS ALL # WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL RHYOLITE SOFTWARE, LLC # BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES # OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS # SOFTWARE. # Rhyolite Software DCC 1.3.50-1.69 $Revision$ # Generated automatically from common.in by configure. # check this file by running it separately use strict 'subs'; use integer; use 5.004; use Fcntl qw(:DEFAULT :flock); use POSIX qw(strftime); # quiet Perl taint checks with a path that should work everywhere for # the few commands these scripts use. $ENV{PATH}="/sbin:/bin:/usr/sbin:/usr/bin"; # so this file can be used with do('/usr/local/dcc/cgi-bin/common') # besides, check_user() must be called before html_head() return check_user(); sub debug_time { return if (!$query{debug}); my(@ts, $ts); require 'sys/syscall.ph'; $ts = pack("LL", ()); syscall(&SYS_gettimeofday, $ts, 0); @ts = unpack("LL", $ts); printf STDERR "%38s", $_[0]; print STDERR strftime(" %X", localtime($ts[0])); printf STDERR ".%03d", $ts[1]/1000; printf STDERR " %.3f", $_ foreach times; print STDERR "\n"; } # emit HTTP/HTML header sub html_head { my($title, # title of the web page $refresh_url) = @_; # next step in re-login sequence if not null print < $title EOF print "\n" if ($refresh_url); print <

Control DCC Log and Whitelist for $user at $hostname

EOF if (open(HEADER, "$user_dir/header") || open(HEADER, "/usr/local/dcc/cgi-bin/header")) { while (my $line =
) { print $line; } close(HEADER); } } sub html_footer { if (!open(FOOTER, "$user_dir/footer") && !open(FOOTER, "/usr/local/dcc/cgi-bin/footer")) { # complain to httpd-error.log print STDERR "open(/usr/local/dcc/cgi-bin/footer): $!\n"; return; } while (my $line =