* Bug or feature? syslog connection is lost after a chroot()
@ 1994-07-20 17:26 Jyke Jokinen
0 siblings, 0 replies; only message in thread
From: Jyke Jokinen @ 1994-07-20 17:26 UTC (permalink / raw)
- My problem:
I'm running wu-ftpd v2.4 in OSF1/V2.0(240) environment.
I noticed that the syslog messages generated by anonymous users were
not the same as earlier on a SUN host. When I traced the code I
noticed that all the syslog messages were lost after the ftpd does
a call to chroot() system call.
- Test:
I wrote the following test program:
------------------------------------------------------------------------------
#include <stdio.h>
#include <syslog.h>
main()
{
openlog( "jyketest", LOG_ODELAY, LOG_DAEMON );
syslog( LOG_NOTICE, "first" );
fprintf( stderr, "first\n" );
fflush( stderr );
if( chroot( "/tmp" ) != 0 ) {
perror( "chroot" );
exit( 1 );
}
syslog( LOG_NOTICE, "second" );
fprintf( stderr, "second\n" );
fflush( stderr );
exit( 0 );
}
------------------------------------------------------------------------------
when I run it as root it displays both fprintfs but only the first
syslog messages comes through.
- What I think is happening?
The syslogd daemon uses UNIX-domain socket /dev/log to get the
messages from programs. Now that socket is opened BEFORE the chroot()
call and I think that the chroot() CLOSES that descriptor because it
references outside the new file-tree. This is not the case in
SunOS4.x. The chroot() manual page doesn't mention anything about this.
- Question:
So my question is Does the OSF1/2.0 chroot() work correctly or is this
a bug? (Someone should try out this test in their host).
- And finally the solution:
I have a workaround for this problem: I have a syslog-caster which
listens a UNIX-domain socket (/tmp/dev/log with the test program)
and resends all the syslog messages to the real syslog.
*** Jyke ***
--
Jyke Jokinen, Software Systems Laboratory,
Tampere University of Technology, Finland.
[email: jyke@cs.tut.fi or jyke@cc.tut.fi].
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1994-07-20 17:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-07-20 17:26 Bug or feature? syslog connection is lost after a chroot() Jyke Jokinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox