diff options
author | djm@openbsd.org <djm@openbsd.org> | 2020-10-16 13:26:13 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-10-17 00:43:17 +1100 |
commit | 793b583d097381730adaf6f68bed3c343139a013 (patch) | |
tree | 37026343eaf098e281b54fe0d0b632b348585ba7 /readconf.c | |
parent | 752250caabda3dd24635503c4cd689b32a650794 (diff) | |
download | openssh-git-793b583d097381730adaf6f68bed3c343139a013.tar.gz |
upstream: LogVerbose keyword for ssh and sshd
Allows forcing maximum debug logging by file/function/line pattern-
lists.
ok markus@
OpenBSD-Commit-ID: c294c25732d1b4fe7e345cb3e044df00531a6356
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.338 2020/10/07 02:18:45 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.339 2020/10/16 13:26:13 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -152,7 +152,7 @@ typedef enum { oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts, oBatchMode, oCheckHostIP, oStrictHostKeyChecking, oCompression, oTCPKeepAlive, oNumberOfPasswordPrompts, - oLogFacility, oLogLevel, oCiphers, oMacs, + oLogFacility, oLogLevel, oLogVerbose, oCiphers, oMacs, oPubkeyAuthentication, oKbdInteractiveAuthentication, oKbdInteractiveDevices, oHostKeyAlias, oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, @@ -263,6 +263,7 @@ static struct { { "numberofpasswordprompts", oNumberOfPasswordPrompts }, { "syslogfacility", oLogFacility }, { "loglevel", oLogLevel }, + { "logverbose", oLogVerbose }, { "dynamicforward", oDynamicForward }, { "preferredauthentications", oPreferredAuthentications }, { "hostkeyalgorithms", oHostKeyAlgorithms }, @@ -901,7 +902,7 @@ process_config_line_depth(Options *options, struct passwd *pw, const char *host, int linenum, int *activep, int flags, int *want_final_pass, int depth) { char *s, **charptr, *endofnumber, *keyword, *arg, *arg2; - char **cpptr, fwdarg[256]; + char **cpptr, ***cppptr, fwdarg[256]; u_int i, *uintptr, max_entries = 0; int r, oactive, negated, opcode, *intptr, value, value2, cmdline = 0; int remotefwd, dynamicfwd; @@ -1349,6 +1350,18 @@ parse_keytypes: *log_facility_ptr = (SyslogFacility) value; break; + case oLogVerbose: + cppptr = &options->log_verbose; + uintptr = &options->num_log_verbose; + if (*activep && *uintptr == 0) { + while ((arg = strdelim(&s)) != NULL && *arg != '\0') { + *cppptr = xrecallocarray(*cppptr, *uintptr, + *uintptr + 1, sizeof(**cppptr)); + (*cppptr)[(*uintptr)++] = xstrdup(arg); + } + } + return 0; + case oLocalForward: case oRemoteForward: case oDynamicForward: @@ -2004,6 +2017,8 @@ initialize_options(Options * options) options->num_remote_forwards = 0; options->log_facility = SYSLOG_FACILITY_NOT_SET; options->log_level = SYSLOG_LEVEL_NOT_SET; + options->num_log_verbose = 0; + options->log_verbose = NULL; options->preferred_authentications = NULL; options->bind_address = NULL; options->bind_interface = NULL; @@ -2839,6 +2854,8 @@ dump_client_config(Options *o, const char *host) dump_cfg_strarray_oneline(oUserKnownHostsFile, o->num_user_hostfiles, o->user_hostfiles); dump_cfg_strarray(oSendEnv, o->num_send_env, o->send_env); dump_cfg_strarray(oSetEnv, o->num_setenv, o->setenv); + dump_cfg_strarray_oneline(oLogVerbose, + o->num_log_verbose, o->log_verbose); /* Special cases */ |