Disable colors by default

"pcscd --debug" prints dark blue lines background, rendering them unreadable
on dark background.  The daemon has "-T" to enforce colored output, but no
switch to disable colors on TTYs.

Disable all detection logic such that "-T" is the only way to get colors.

OK sthen
This commit is contained in:
kn 2020-02-05 21:22:17 +00:00
parent 11520e40f3
commit 4dab7ffa2e
3 changed files with 50 additions and 1 deletions

View File

@ -1,8 +1,9 @@
# $OpenBSD: Makefile,v 1.48 2020/01/30 07:32:19 kn Exp $
# $OpenBSD: Makefile,v 1.49 2020/02/05 21:22:17 kn Exp $
COMMENT= resource manager for PC/SC
V= 1.8.26
REVISION= 0
DISTNAME= pcsc-lite-${V}
CATEGORIES= security

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-src_debug_c,v 1.1 2020/02/05 21:22:17 kn Exp $
Disable colors by default.
Index: src/debug.c
--- src/debug.c.orig
+++ src/debug.c
@@ -76,6 +76,7 @@ static void log_init(void)
if (e)
LogLevel = atoi(e);
+#if 0
/* log to stderr and stderr is a tty? */
if (isatty(fileno(stderr)))
{
@@ -99,6 +100,7 @@ static void log_init(void)
}
}
}
+#endif
} /* log_init */
void log_msg(const int priority, const char *fmt, ...)

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-src_debuglog_c,v 1.1 2020/02/05 21:22:17 kn Exp $
Disable colors by default.
Index: src/debuglog.c
--- src/debuglog.c.orig
+++ src/debuglog.c
@@ -255,6 +255,9 @@ void DebugLogSetLogType(const int dbgtype)
LogMsgType = DEBUGLOG_STDOUT_DEBUG;
}
+ if (DEBUGLOG_STDOUT_COLOR_DEBUG == LogMsgType)
+ LogDoColor = 1;
+#if 0
/* log to stdout and stdout is a tty? */
if ((DEBUGLOG_STDOUT_DEBUG == LogMsgType && isatty(fileno(stdout)))
|| (DEBUGLOG_STDOUT_COLOR_DEBUG == LogMsgType))
@@ -279,6 +282,7 @@ void DebugLogSetLogType(const int dbgtype)
}
}
}
+#endif
}
void DebugLogSetLevel(const int level)