From owner-freebsd-hackers Thu Dec 19 6:11:37 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3630137B401 for ; Thu, 19 Dec 2002 06:11:35 -0800 (PST) Received: from ussenterprise.ufp.org (ussenterprise.ufp.org [208.185.30.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3C66243EA9 for ; Thu, 19 Dec 2002 06:11:34 -0800 (PST) (envelope-from bicknell@ussenterprise.ufp.org) Received: (from bicknell@localhost) by ussenterprise.ufp.org (8.11.1/8.11.1) id gBJEBXd17531 for freebsd-hackers@freebsd.org; Thu, 19 Dec 2002 09:11:33 -0500 (EST) (envelope-from bicknell) Date: Thu, 19 Dec 2002 09:11:33 -0500 From: Leo Bicknell To: freebsd-hackers@freebsd.org Subject: Re: Perl issue on freebsd 4.x? Message-ID: <20021219141133.GA17261@ussenterprise.ufp.org> Mail-Followup-To: freebsd-hackers@freebsd.org References: <20021219022152.GA6708@ussenterprise.ufp.org> <20021219073640.B4F204633@bert.kts.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline In-Reply-To: <20021219073640.B4F204633@bert.kts.org> Organization: United Federation of Planets Reply-By: Thu Dec 26 08:57:54 EST 2002 X-Message-Flag: Put no trust in cryptic comments. X-PGP-Key: http://www.ufp.org/~bicknell/ Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In a message written on Thu, Dec 19, 2002 at 08:36:40AM +0100, Hellmuth Mic= haelis wrote: > Syslogd on the machine listens on an "*.syslog" udp4 socket. The machine > is multihomed. The "-s" flag to syslogd is explained as "Do not log=20 > messages from remote machines" - perhaps the perl process is considered > to be remote ?=20 % uname -r 4.7-RELEASE % ps ax | grep syslog 76 ?? Ss 0:04.80 /usr/sbin/syslogd -s % cat syslogtest #!/usr/bin/perl use Sys::Syslog qw(:DEFAULT setlogsock); setlogsock('unix'); openlog('syslogtest', 'cons,pid', 'mail') || warn "openlog: $!"; syslog('info', 'this should go into the mail log') || warn "syslog: $!"; closelog() || warn "closelog: $!"; setlogsock('inet'); openlog('syslogtest', 'cons,pid', 'mail') || warn "openlog: $!"; syslog('info', 'this should go into the mail log') || warn "syslog: $!"; closelog() || warn "closelog: $!"; % ./syslogtest openlog: at ./syslogtest line 6. closelog: Bad file descriptor at ./syslogtest line 8. openlog: Bad file descriptor at ./syslogtest line 11. closelog: Bad file descriptor at ./syslogtest line 13. I get the exact same behavior on another machine, which insted of -s uses the -a feature (access list) allowing 127.0.0.1, the machine's own IP, and several remote IP's. My test box (that I could run syslog without -s on) is down for the moment, I'll poke at it as soon as it's fixed. That said, everything else on both of these machines syslogs just fine, and since the failure seems to be in openlog (which I believe just creates a unix domain or UDP socket, both of which should succeed even if syslog isn't running) I don't think the security makes a difference. I also find it odd that I can get no error out of openlog, and when I dig into it with the perl debugger I can't tell anything other than it's call to create the socket fails, but I have no idea why. --=20 Leo Bicknell - bicknell@ufp.org - CCIE 3440 PGP keys at http://www.ufp.org/~bicknell/ Read TMBG List - tmbg-list-request@tmbg.org, www.tmbg.org --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE+AdOVNh6mMG5yMTYRAky9AJ9DLf/tr3DU6MtSjE7dffxXLvXH1wCfc6XP OisXHBsviZFt01EsD5pWBy4= =hijr -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message