~ubuntu-branches/ubuntu/lucid/openssh/lucid

« back to all changes in this revision

Viewing changes to log.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-09-30 23:09:58 UTC
  • mfrom: (1.13.3 upstream) (29 hardy)
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: james.westby@ubuntu.com-20080930230958-o6vsgn8c4mm959s0
Tags: 1:5.1p1-3
* Remove unnecessary ssh-vulnkey output in non-verbose mode when no
  compromised or unknown keys were found (closes: #496495).
* Configure with --disable-strip; dh_strip will deal with stripping
  binaries and will honour DEB_BUILD_OPTIONS (thanks, Bernhard R. Link;
  closes: #498681).
* Fix handling of zero-length server banners (thanks, Tomas Mraz; closes:
  #497026).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $OpenBSD: log.c,v 1.39 2006/08/18 09:13:25 deraadt Exp $ */
 
1
/* $OpenBSD: log.c,v 1.41 2008/06/10 04:50:25 dtucker Exp $ */
2
2
/*
3
3
 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4
4
 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
44
44
#include <string.h>
45
45
#include <syslog.h>
46
46
#include <unistd.h>
 
47
#include <errno.h>
47
48
#if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H)
48
49
# include <vis.h>
49
50
#endif
114
115
        return SYSLOG_FACILITY_NOT_SET;
115
116
}
116
117
 
 
118
const char *
 
119
log_facility_name(SyslogFacility facility)
 
120
{
 
121
        u_int i;
 
122
 
 
123
        for (i = 0;  log_facilities[i].name; i++)
 
124
                if (log_facilities[i].val == facility)
 
125
                        return log_facilities[i].name;
 
126
        return NULL;
 
127
}
 
128
 
117
129
LogLevel
118
130
log_level_number(char *name)
119
131
{
126
138
        return SYSLOG_LEVEL_NOT_SET;
127
139
}
128
140
 
 
141
const char *
 
142
log_level_name(LogLevel level)
 
143
{
 
144
        u_int i;
 
145
 
 
146
        for (i = 0; log_levels[i].name != NULL; i++)
 
147
                if (log_levels[i].val == level)
 
148
                        return log_levels[i].name;
 
149
        return NULL;
 
150
}
 
151
 
129
152
/* Error messages that should be logged. */
130
153
 
131
154
void
315
338
        char fmtbuf[MSGBUFSIZ];
316
339
        char *txt = NULL;
317
340
        int pri = LOG_INFO;
 
341
        int saved_errno = errno;
318
342
 
319
343
        if (level > log_level)
320
344
                return;
375
399
                closelog();
376
400
#endif
377
401
        }
 
402
        errno = saved_errno;
378
403
}