Mailing List Archive

[openssh] 01/01: logging is now macros, remove function pointers
This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit f9ea6515202b59a1e2d5b885cafc1b12eff33016
Author: Damien Miller <djm@mindrot.org>
Date: Sat Oct 17 11:51:20 2020 +1100

logging is now macros, remove function pointers
---
openbsd-compat/port-linux.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c
index f46094fa..89915eb8 100644
--- a/openbsd-compat/port-linux.c
+++ b/openbsd-compat/port-linux.c
@@ -182,7 +182,7 @@ ssh_selinux_change_context(const char *newname)
{
int len, newlen;
char *oldctx, *newctx, *cx;
- void (*switchlog) (const char *fmt,...) = logit;
+ LogLevel log_level = SYSLOG_LEVEL_INFO;

if (!ssh_selinux_enabled())
return;
@@ -193,7 +193,7 @@ ssh_selinux_change_context(const char *newname)
}
if ((cx = index(oldctx, ':')) == NULL || (cx = index(cx + 1, ':')) ==
NULL) {
- logit ("%s: unparsable context %s", __func__, oldctx);
+ logit("%s: unparsable context %s", __func__, oldctx);
return;
}

@@ -203,7 +203,7 @@ ssh_selinux_change_context(const char *newname)
*/
if (strncmp(cx, SSH_SELINUX_UNCONFINED_TYPE,
sizeof(SSH_SELINUX_UNCONFINED_TYPE) - 1) == 0)
- switchlog = debug3;
+ log_level = SYSLOG_LEVEL_DEBUG3;

newlen = strlen(oldctx) + strlen(newname) + 1;
newctx = xmalloc(newlen);
@@ -215,8 +215,8 @@ ssh_selinux_change_context(const char *newname)
debug3("%s: setting context from '%s' to '%s'", __func__,
oldctx, newctx);
if (setcon(newctx) < 0)
- switchlog("%s: setcon %s from %s failed with %s", __func__,
- newctx, oldctx, strerror(errno));
+ do_log2(log_level, "%s: setcon %s from %s failed with %s",
+ __func__, newctx, oldctx, strerror(errno));
free(oldctx);
free(newctx);
}

--
To stop receiving notification emails like this one, please contact
djm@mindrot.org.
_______________________________________________
openssh-commits mailing list
openssh-commits@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-commits