#! /bin/sh -e
## 01_suppress_verbose_debug_msg.dpatch by Masayuki Hatta <mhatta@debian.org>
##
## All lines beginning with \`## DP:' are a description of the patch.
## DP: Suppress verbose debug messages.

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
        -patch) patch -f --no-backup-if-mismatch --dry-run -p1 < $0 && patch -f --no-backup-if-mismatch -p1 < $0
;;
        -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0

diff -urN ebnetd-1.0.orig/ebnetd/ebnetd.c ebnetd-1.0/ebnetd/ebnetd.c
--- ebnetd-1.0.orig/ebnetd/ebnetd.c	2006-10-08 12:22:15.000000000 +0900
+++ ebnetd-1.0/ebnetd/ebnetd.c	2006-10-08 12:24:40.000000000 +0900
@@ -228,7 +228,7 @@
      */
     set_fakelog_name(invoked_name);
     set_fakelog_mode(FAKELOG_TO_SYSLOG);
-    set_fakelog_level(LOG_DEBUG);
+    set_fakelog_level(LOG_INFO);
 
     /*
      * Open syslog.
diff -urN ebnetd-1.0.orig/lib/fakelog.c ebnetd-1.0/lib/fakelog.c
--- ebnetd-1.0.orig/lib/fakelog.c	2006-10-08 12:22:15.000000000 +0900
+++ ebnetd-1.0/lib/fakelog.c	2006-10-08 12:24:18.000000000 +0900
@@ -270,7 +270,8 @@
     /*
      * Output the message to syslog.
      */
-    if (log_mode == FAKELOG_TO_SYSLOG || log_mode == FAKELOG_TO_BOTH) {
+    if ((log_mode == FAKELOG_TO_SYSLOG || log_mode == FAKELOG_TO_BOTH)
+	&& log_flag ) {
 #if (defined(HAVE_VPRINTF) || defined(HAVE_DOPRNT)) && defined(HAVE_VSYSLOG)
 	vsyslog(priority, message, ap);
 #else /* not (defined(HAVE_VPRINTF) || ... */
