Bug 15654 - The traceon() function in routed does not create a logfile
Summary: The traceon() function in routed does not create a logfile
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: routed
Version: 6.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Eido Inoue
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-08-07 16:22 UTC by Dale Chayes
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-08-07 16:22:10 UTC
Embargoed:


Attachments (Terms of Use)

Description Dale Chayes 2000-08-07 16:22:09 UTC
'routed' uses a function called traceon() to log data to a log file. The
plausible place for the log file is /var/log/routed/some-log-file.  It
appears that the base name of the file is defined in

pathnames.h:#define _PATH_LOGDIR    "/var/log/routed/"

and the actual file name is created from an unflagged command line
argument.

However, the code in trace.c function traceon() is doing a  string compare
(strncmp) and failing to generate a useful file name so no log data is
emitted.

I commented out the compare and scabbed  in a (very ugly) temporary fix as
I am a bit short of time these days (who's not?):

	/*
	 * Trace file requests could come from anywhere...
	 */
        
/* 	if (strncmp(file, logdir, strlen(logdir)) || strstr(file, "/../")) */
/*	{  */
/*		syslog(LOG_ERR, "Cannot log to %s: not under %s\n",  */
/*		       file, logdir); */
/*		return; */
/*	} */
           

/*	fd = open(file, O_WRONLY|O_APPEND|O_CREAT|O_EXCL|O_NDELAY, 0600); */


	fd = open("/var/log/routed/stuff.log",
O_WRONLY|O_APPEND|O_CREAT|O_EXCL|O_NDELAY, 0600); 
	

and I get the routed messages in /var/log/routed/stuff.log.

I worked from the SRPM that came w/ the RH 6.2 distribution and applied the
fork and jdbf patches first....

-Dale

Comment 1 Eido Inoue 2001-07-16 16:32:30 UTC
This appears to have been addressed in the 0.17 sources which are in the current
RPMs.


Note You need to log in before you can comment on or make changes to this bug.