[syslog-ng]type error fix

Balazs Scheidler bazsi@balabit.hu
Mon, 22 Oct 2001 21:31:18 +0200


Hi,

The patch below hopefully fixes the "Type Error" problems reported in
1.5.12. I'd appreciate feedback whether it really fixes the bug.
(if it does, expect a new version shortly)

Thanks for the cooperation for those who helped me to track this issue.

diff -urN syslog-ng-1.5.12/src/affile.c syslog-ng-1.5.12-fixed/src/affile.c
--- syslog-ng-1.5.12/src/affile.c	Sat Oct 20 15:03:59 2001
+++ syslog-ng-1.5.12-fixed/src/affile.c	Mon Oct 22 21:22:18 2001
@@ -118,7 +118,7 @@
 		struct resource_node *res;
 
 		lseek(fd, 0, SEEK_END);
-		self->src = io_read(make_io_fd(cfg->backend, fd, self->name), 
+		self->src = io_read(make_io_fd(cfg->backend, fd, ol_string_use(self->name)), 
 			make_log_reader(0, c), 
 			NULL);
 		res = REMEMBER_RESOURCE(cfg->resources, &self->src->super.super);
@@ -218,7 +219,7 @@
 	                 self->owner->flags & AFFILE_CREATE_DIRS, &fd)) {
 
 		self->dest = 
-			io_write(make_io_fd(cfg->backend, fd, self->expanded_fname), 
+			io_write(make_io_fd(cfg->backend, fd, ol_string_use(self->expanded_fname)), 
 				 make_pkt_buffer_ext(self->owner->sync_freq, 
 				                     MAX(self->owner->super.log_fifo_size + 1, 
 					                 self->owner->sync_freq)),


-- 
Bazsi