[1551] in bugtraq
Re: chroot'ed environment?
daemon@ATHENA.MIT.EDU (Valdis.Kletnieks@vt.edu)
Thu Apr 20 06:04:12 1995
To: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
Cc: bugtraq@fc.net
In-Reply-To: Your message of "Wed, 19 Apr 1995 17:47:13 EDT."
<199504192147.RAA02401@Collatz.McRCIM.McGill.EDU>
From: Valdis.Kletnieks@vt.edu
Date: Thu, 20 Apr 1995 03:49:00 -0400
On Wed, 19 Apr 1995 17:47:13 EDT, you said:
> An idea which just occurred to me, not tested at all. If you can
> connect() an AF_UNIX SOCK_DGRAM socket (and I'm not sure you can), the
> association with its peer might survive a chroot that renders the
> original pathname inaccessible. If this is so, it could provide an
> answer.
Excerpted from 'man 3 openlog' on an AIX 3.2.5 system, but it should be
in any BSD4.3 system:
#include <syslog.h>
int openlog (ID, LogOption, Facility)
char *ID;
int LogOption, Facility;
...
LogOption Specifies a bit field that indicates logging options.
The values of LogOption are:
...
LOG_NDELAY Opens the connection to the syslogd command immediate-
ly, instead of when the first message is logged. This option is
useful for programs that need to manage the order in which file
descriptors are allocated.
...
So if you call openlog(argv[0],LOG_NDELAY,LOG_DAEMON); the LOG_NDELAY
will open /dev/log *now* (presumably before you chroot()). And as we all
know, open file descriptors are not affected by a chroot()....
Valdis Kletnieks
Computer Systems Engineer
Virginia Tech