Module Name:    src
Committed By:   riz
Date:           Wed Jun  9 21:55:42 UTC 2010

Modified Files:
        src/usr.sbin/syslogd: Makefile extern.h syslogd.c

Log Message:
Allow syslogd to compile when MKCRYPTO=no.  No promises as to whether
it works or not, as this has been broken since late 2008, when the
"encrypted connections" support was added to syslogd.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/syslogd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/syslogd/extern.h
cvs rdiff -u -r1.99 -r1.100 src/usr.sbin/syslogd/syslogd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/syslogd/Makefile
diff -u src/usr.sbin/syslogd/Makefile:1.22 src/usr.sbin/syslogd/Makefile:1.23
--- src/usr.sbin/syslogd/Makefile:1.22	Wed Apr 22 15:23:08 2009
+++ src/usr.sbin/syslogd/Makefile	Wed Jun  9 21:55:42 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.22 2009/04/22 15:23:08 lukem Exp $
+#	$NetBSD: Makefile,v 1.23 2010/06/09 21:55:42 riz Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
 .include <bsd.own.mk>
 
@@ -26,6 +26,8 @@
 
 .if ${MKCRYPTO} != "no"
 LDADD+=	-lssl -lcrypto
+.else
+CPPFLAGS+=-DDISABLE_TLS -DDISABLE_SIGN
 .endif
 
 .include <bsd.prog.mk>

Index: src/usr.sbin/syslogd/extern.h
diff -u src/usr.sbin/syslogd/extern.h:1.2 src/usr.sbin/syslogd/extern.h:1.3
--- src/usr.sbin/syslogd/extern.h:1.2	Fri Nov  7 07:36:38 2008
+++ src/usr.sbin/syslogd/extern.h	Wed Jun  9 21:55:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.2 2008/11/07 07:36:38 minskim Exp $	*/
+/*	$NetBSD: extern.h,v 1.3 2010/06/09 21:55:42 riz Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -74,7 +74,9 @@
 extern void	schedule_event(struct event **, struct timeval *,
     void (*)(int, short, void *), void *);
 extern char    *make_timestamp(time_t *, bool);
+#ifndef DISABLE_TLS
 extern struct filed *get_f_by_conninfo(struct tls_conn_settings *conn_info);
+#endif
 extern bool	message_queue_remove(struct filed *, struct buf_queue *);
 extern void	buf_msg_free(struct buf_msg *msg);
 extern void	message_queue_freeall(struct filed *);

Index: src/usr.sbin/syslogd/syslogd.c
diff -u src/usr.sbin/syslogd/syslogd.c:1.99 src/usr.sbin/syslogd/syslogd.c:1.100
--- src/usr.sbin/syslogd/syslogd.c:1.99	Fri Feb  6 21:09:46 2009
+++ src/usr.sbin/syslogd/syslogd.c	Wed Jun  9 21:55:42 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: syslogd.c,v 1.99 2009/02/06 21:09:46 mschuett Exp $	*/
+/*	$NetBSD: syslogd.c,v 1.100 2010/06/09 21:55:42 riz Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)syslogd.c	8.3 (Berkeley) 4/4/94";
 #else
-__RCSID("$NetBSD: syslogd.c,v 1.99 2009/02/06 21:09:46 mschuett Exp $");
+__RCSID("$NetBSD: syslogd.c,v 1.100 2010/06/09 21:55:42 riz Exp $");
 #endif
 #endif /* not lint */
 
@@ -2114,7 +2114,7 @@
 	int e = 0, len = 0;
 	size_t msglen, linelen, tlsprefixlen, prilen;
 	char *p, *line = NULL, *lineptr = NULL;
-#ifndef DISABLE_TLS
+#ifndef DISABLE_SIGN
 	bool newhash = false;
 #endif
 #define REPBUFSIZE 80
@@ -3248,8 +3248,8 @@
 	struct filed *f, *newf, **nextp, *f2;
 	char *p;
 	sigset_t newmask, omask;
-	char *tls_status_msg = NULL;
 #ifndef DISABLE_TLS
+	char *tls_status_msg = NULL;
 	struct peer_cred *cred = NULL;
 #endif /* !DISABLE_TLS */
 
@@ -3818,8 +3818,10 @@
 		break;
 
 	case '|':
+#ifndef DISABLE_SIGN
 		if (GlobalSign.sg == 3)
 			f->f_flags |= FFLAG_SIGN;
+#endif
 		f->f_un.f_pipe.f_pid = 0;
 		(void) strlcpy(f->f_un.f_pipe.f_pname, p + 1,
 		    sizeof(f->f_un.f_pipe.f_pname));
@@ -4200,6 +4202,7 @@
 #define SQ_CHUNK_SIZE 250
 	size_t cnt = 0;
 
+#ifndef DISABLE_TLS
 	if (f->f_type == F_TLS) {
 		/* use a flag to prevent recursive calls to send_queue() */
 		if (f->f_un.f_tls.tls_conn->send_queue)
@@ -4209,6 +4212,7 @@
 	}
 	DPRINTF((D_DATA|D_CALL), "send_queue(f...@%p with %zu msgs, "
 		"c...@%p = %zu)\n", f, f->f_qelements, &cnt, cnt);
+#endif /* !DISABLE_TLS */
 
 	while ((qentry = STAILQ_FIRST(&f->f_qhead))) {
 #ifndef DISABLE_TLS
@@ -4246,8 +4250,11 @@
 			break;
 		}
 	}
+#ifndef DISABLE_TLS
 	if (f->f_type == F_TLS)
 		f->f_un.f_tls.tls_conn->send_queue = false;
+#endif
+
 }
 
 /*

Reply via email to