diff options
author | Damien Miller <djm@mindrot.org> | 1999-11-25 00:26:21 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-11-25 00:26:21 +1100 |
commit | 95def09838fc61b37b6ea7cd5c234a465b4b129b (patch) | |
tree | 042744f76f40a326b873cb1c3690a6d7d966bc3e /log-client.c | |
parent | 4d2f15f895f4c795afc008aeff3fd2ceffbc44f4 (diff) |
- Merged very large OpenBSD source code reformat
- OpenBSD CVS updates
- [channels.c cipher.c compat.c log-client.c scp.c serverloop.c]
[ssh.h sshd.8 sshd.c]
syslog changes:
* Unified Logmessage for all auth-types, for success and for failed
* Standard connections get only ONE line in the LOG when level==LOG:
Auth-attempts are logged only, if authentication is:
a) successfull or
b) with passwd or
c) we had more than AUTH_FAIL_LOG failues
* many log() became verbose()
* old behaviour with level=VERBOSE
- [readconf.c readconf.h ssh.1 ssh.h sshconnect.c sshd.c]
tranfer s/key challenge/response data in SSH_SMSG_AUTH_TIS_CHALLENGE
messages. allows use of s/key in windows (ttssh, securecrt) and
ssh-1.2.27 clients without 'ssh -v', ok: niels@
- [sshd.8]
-V, for fallback to openssh in SSH2 compatibility mode
- [sshd.c]
fix sigchld race; cjc5@po.cwru.edu
Diffstat (limited to 'log-client.c')
-rw-r--r-- | log-client.c | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/log-client.c b/log-client.c index 63cc79445..4d40cf268 100644 --- a/log-client.c +++ b/log-client.c | |||
@@ -1,21 +1,21 @@ | |||
1 | /* | 1 | /* |
2 | 2 | * | |
3 | log-client.c | 3 | * log-client.c |
4 | 4 | * | |
5 | Author: Tatu Ylonen <ylo@cs.hut.fi> | 5 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
6 | 6 | * | |
7 | Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 7 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
8 | All rights reserved | 8 | * All rights reserved |
9 | 9 | * | |
10 | Created: Mon Mar 20 21:13:40 1995 ylo | 10 | * Created: Mon Mar 20 21:13:40 1995 ylo |
11 | 11 | * | |
12 | Client-side versions of debug(), log(), etc. These print to stderr. | 12 | * Client-side versions of debug(), log(), etc. These print to stderr. |
13 | This is a stripped down version of log-server.c. | 13 | * This is a stripped down version of log-server.c. |
14 | 14 | * | |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "includes.h" | 17 | #include "includes.h" |
18 | RCSID("$Id: log-client.c,v 1.2 1999/11/11 06:57:39 damien Exp $"); | 18 | RCSID("$Id: log-client.c,v 1.3 1999/11/24 13:26:22 damien Exp $"); |
19 | 19 | ||
20 | #include "xmalloc.h" | 20 | #include "xmalloc.h" |
21 | #include "ssh.h" | 21 | #include "ssh.h" |
@@ -23,27 +23,26 @@ RCSID("$Id: log-client.c,v 1.2 1999/11/11 06:57:39 damien Exp $"); | |||
23 | static LogLevel log_level = SYSLOG_LEVEL_INFO; | 23 | static LogLevel log_level = SYSLOG_LEVEL_INFO; |
24 | 24 | ||
25 | /* Initialize the log. | 25 | /* Initialize the log. |
26 | av0 program name (should be argv[0]) | 26 | * av0 program name (should be argv[0]) |
27 | level logging level | 27 | * level logging level |
28 | */ | 28 | */ |
29 | 29 | ||
30 | void | 30 | void |
31 | log_init(char *av0, LogLevel level, SyslogFacility ignored1, int ignored2) | 31 | log_init(char *av0, LogLevel level, SyslogFacility ignored1, int ignored2) |
32 | { | 32 | { |
33 | switch (level) | 33 | switch (level) { |
34 | { | 34 | case SYSLOG_LEVEL_QUIET: |
35 | case SYSLOG_LEVEL_QUIET: | 35 | case SYSLOG_LEVEL_ERROR: |
36 | case SYSLOG_LEVEL_ERROR: | 36 | case SYSLOG_LEVEL_FATAL: |
37 | case SYSLOG_LEVEL_FATAL: | 37 | case SYSLOG_LEVEL_INFO: |
38 | case SYSLOG_LEVEL_INFO: | 38 | case SYSLOG_LEVEL_VERBOSE: |
39 | case SYSLOG_LEVEL_CHAT: | 39 | case SYSLOG_LEVEL_DEBUG: |
40 | case SYSLOG_LEVEL_DEBUG: | 40 | log_level = level; |
41 | log_level = level; | 41 | break; |
42 | break; | 42 | default: |
43 | default: | 43 | /* unchanged */ |
44 | /* unchanged */ | 44 | break; |
45 | break; | 45 | } |
46 | } | ||
47 | } | 46 | } |
48 | 47 | ||
49 | #define MSGBUFSIZE 1024 | 48 | #define MSGBUFSIZE 1024 |
@@ -51,13 +50,13 @@ log_init(char *av0, LogLevel level, SyslogFacility ignored1, int ignored2) | |||
51 | void | 50 | void |
52 | do_log(LogLevel level, const char *fmt, va_list args) | 51 | do_log(LogLevel level, const char *fmt, va_list args) |
53 | { | 52 | { |
54 | char msgbuf[MSGBUFSIZE]; | 53 | char msgbuf[MSGBUFSIZE]; |
55 | 54 | ||
56 | if (level > log_level) | 55 | if (level > log_level) |
57 | return; | 56 | return; |
58 | if (level == SYSLOG_LEVEL_DEBUG) | 57 | if (level == SYSLOG_LEVEL_DEBUG) |
59 | fprintf(stderr, "debug: "); | 58 | fprintf(stderr, "debug: "); |
60 | vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); | 59 | vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); |
61 | fprintf(stderr, "%s", msgbuf); | 60 | fprintf(stderr, "%s", msgbuf); |
62 | fprintf(stderr, "\r\n"); | 61 | fprintf(stderr, "\r\n"); |
63 | } | 62 | } |