From 50a48d025ffc961c3f5e48f521b406d7c49681bb Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 6 Sep 2012 21:25:37 +1000 Subject: - dtucker@cvs.openbsd.org 2012/09/06 04:37:39 [clientloop.c log.c ssh.1 log.h] Add ~v and ~V escape sequences to raise and lower the logging level respectively. Man page help from jmc, ok deraadt jmc --- log.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'log.c') diff --git a/log.c b/log.c index ad5a10b47..7f4a1b9c6 100644 --- a/log.c +++ b/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.42 2011/06/17 21:44:30 djm Exp $ */ +/* $OpenBSD: log.c,v 1.43 2012/09/06 04:37:39 dtucker Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -329,6 +329,21 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr) #endif } +void +log_change_level(LogLevel new_log_level) +{ + /* no-op if log_init has not been called */ + if (argv0 == NULL) + return; + log_init(argv0, new_log_level, log_facility, log_on_stderr); +} + +int +log_is_on_stderr(void) +{ + return log_on_stderr; +} + #define MSGBUFSIZ 1024 void -- cgit v1.2.3 From 63b4bcd04e1c57b77eabb4e4d359508a4b2af685 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 20 Mar 2013 12:55:14 +1100 Subject: - (djm) [configure.ac log.c scp.c sshconnect2.c openbsd-compat/vis.c] [openbsd-compat/vis.h] FreeBSD's strnvis isn't compatible with OpenBSD's so mark it as broken. Patch from des AT des.no --- ChangeLog | 5 +++++ configure.ac | 5 +++-- log.c | 2 +- openbsd-compat/vis.c | 2 +- openbsd-compat/vis.h | 4 ++-- scp.c | 2 +- sshconnect2.c | 2 +- 7 files changed, 14 insertions(+), 8 deletions(-) (limited to 'log.c') diff --git a/ChangeLog b/ChangeLog index 502d85c3b..80429f849 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20120318 + - (djm) [configure.ac log.c scp.c sshconnect2.c openbsd-compat/vis.c] + [openbsd-compat/vis.h] FreeBSD's strnvis isn't compatible with OpenBSD's + so mark it as broken. Patch from des AT des.no + 20120317 - (tim) [configure.ac] OpenServer 5 wants lastlog even though it has none of the bits the configure test looks for. diff --git a/configure.ac b/configure.ac index 5d835c93d..88dd29e9d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.517 2013/03/17 03:55:47 tim Exp $ +# $Id: configure.ac,v 1.518 2013/03/20 01:55:15 djm Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.517 $) +AC_REVISION($Revision: 1.518 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -721,6 +721,7 @@ mips-sony-bsd|mips-sony-newsos4) AC_CHECK_HEADER([net/if_tap.h], , AC_DEFINE([SSH_TUN_NO_L2], [1], [No layer 2 tunnel support])) AC_DEFINE([BROKEN_GLOB], [1], [FreeBSD glob does not do what we need]) + AC_DEFINE([BROKEN_STRNVIS], [1], [FreeBSD strnvis does not do what we need]) ;; *-*-bsdi*) AC_DEFINE([SETEUID_BREAKS_SETUID]) diff --git a/log.c b/log.c index 7f4a1b9c6..d69154a67 100644 --- a/log.c +++ b/log.c @@ -45,7 +45,7 @@ #include #include #include -#if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) +#if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) # include #endif diff --git a/openbsd-compat/vis.c b/openbsd-compat/vis.c index 3a087b341..f6f5665c1 100644 --- a/openbsd-compat/vis.c +++ b/openbsd-compat/vis.c @@ -31,7 +31,7 @@ /* OPENBSD ORIGINAL: lib/libc/gen/vis.c */ #include "includes.h" -#if !defined(HAVE_STRNVIS) +#if !defined(HAVE_STRNVIS) || defined(BROKEN_STRNVIS) #include #include diff --git a/openbsd-compat/vis.h b/openbsd-compat/vis.h index 3898a9e70..d1286c99d 100644 --- a/openbsd-compat/vis.h +++ b/openbsd-compat/vis.h @@ -35,7 +35,7 @@ /* OPENBSD ORIGINAL: include/vis.h */ #include "includes.h" -#if !defined(HAVE_STRNVIS) +#if !defined(HAVE_STRNVIS) || defined(BROKEN_STRNVIS) #ifndef _VIS_H_ #define _VIS_H_ @@ -92,4 +92,4 @@ ssize_t strnunvis(char *, const char *, size_t) #endif /* !_VIS_H_ */ -#endif /* !HAVE_STRNVIS */ +#endif /* !HAVE_STRNVIS || BROKEN_STRNVIS */ diff --git a/scp.c b/scp.c index 08587b5f2..645d7403b 100644 --- a/scp.c +++ b/scp.c @@ -103,7 +103,7 @@ #include #include #include -#if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) +#if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) #include #endif diff --git a/sshconnect2.c b/sshconnect2.c index a306447b3..d6af0b940 100644 --- a/sshconnect2.c +++ b/sshconnect2.c @@ -40,7 +40,7 @@ #include #include #include -#if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) +#if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) #include #endif -- cgit v1.2.3