On Mon, 2004-10-04 at 23:35 +0000, Brooks Davis wrote:
> brooks      2004-10-04 23:35:13 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     usr.sbin/newsyslog   newsyslog.8 newsyslog.c 
>   Log:
>   Add a new -d argument which is used to specify an alternate root for log
>   files similar to DESTDIR in the BSD make process.  This only affects log
>   file paths not config file (-f) or archive directory (-a) paths.

Excellent idea. This will cut down on a lot of verbosity in the
newsyslog.conf file. However, perhaps the accompanying patch is a better
implementation. It allows both relative and absolute path names to be
listed, so that logs which are stored in a chroot'd environment (think
BIND 9) can be specified along with logs specified with the -d option.
I'll admit right now that my C is nothing near as good as I'd like it to
be (though I have been reading my Deitel book), but I have tested this
and it does what I want it to do.

Also, while I'm here, is there any plan to port this to RELENG_5?
--- /usr/home/apeiron/newsyslog.c	Mon Oct  4 21:27:38 2004
+++ newsyslog.c	Mon Oct  4 21:44:11 2004
@@ -340,7 +340,7 @@
 	if (tempwork == NULL)
 		err(1, "malloc of conf_entry for %s", fname);
 
-	if (destdir == NULL)
+	if (destdir == NULL || fname[0] == '/')
 		tempwork->log = strdup(fname);
 	else
 		asprintf(&tempwork->log, "%s%s", destdir, fname);

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to