Commit Graph

67 Commits

Author SHA1 Message Date
Roland C. Dowdeswell
fb9a78223c We stop strnvisx(3)ing logs to FILE: by default.
Our logging framework used to strnvisx(3) each and every line
iff it is written to a FILE.  This is often unhelpful because
the line usually contains a number of elements that have already
been quoted and it makes the logs much more difficult to read in
this case.  An example if krb5_unparse_name() which will already
quote most characters that one cares about.

We change the behaviour to simply drop unprintable characters
rather than encoding them.  We thus rely on the rest of the
code to properly encode data elements written into the logs.
2019-12-05 00:05:56 -05:00
Roland C. Dowdeswell
84ffa22c93 Add an "EFILE:" target for logging.
This target will write to a file IFF it exists.
2019-11-10 17:47:36 -05:00
Roland C. Dowdeswell
e44c680d8e Make logging path definitions subject to token expansion. 2019-11-10 17:47:36 -05:00
Roland C. Dowdeswell
c7d4682aed Define log levels in docs and change default to 0-3.
We define the meaning of the various log levels in the man page
for krb5_openlog(3).  If logging configured and levels are not
specified, we change the default levels to 0-3 which should exclude
debugging messages which are generally only desired in exceptional
circumstances.

We also go through the KDC and adjust the levels to be appropriate.
2019-10-21 13:43:01 +01:00
Nicolas Williams
6a0f45c4d7 Use __attribute__ ((__name__)) form
Protect against macros named noreturn and so on.
2017-03-13 18:39:41 -04:00
Nicolas Williams
0306d70a91 Add --debug option to kgetcred 2015-04-13 16:59:20 -05:00
Jelmer Vernooij
70e43e9808 Fix some typos. 2014-04-25 02:42:17 +02:00
Jeffrey Altman
31a00d6647 ISPATHSEP and ISTILDE macros; Windows portability
Windows treats '\\' and '/' equivalently but we cannot control
the form that will be used by end users.  Introduce ISPATHSEP()
macro which tests only for '/' on UNIX and both on Windows.
Introduce ISTILDE() macro to test for '~'.   When testing for
'/' with strchr() or strrchr() add conditional checks for '\\' on
Windows.

Change-Id: Ia85e698fc88f15a6a71db649db5417f02ef7e5fe
2013-09-10 22:31:38 -04:00
Jeffrey Altman
5f138a16ef libkrb5: Add missing KRB5_LIB_FUNCTION/KRB5_LIB_CALL
KRB5_LIB_FUNCTION and KRB5_LIB_CALL are necessary even on private
functions that are exported.

Change-Id: Iccd0cfe87ff0a9d851e29890e9cb55b3ae517ce1
2013-06-22 21:17:32 -04:00
Love Hornquist Astrand
124ab6957c plug memory leak 2013-04-24 20:17:01 -07:00
Roland C. Dowdeswell
f0f07ff408 Use krb5_enomem() more consistently in lib/krb5. 2013-02-13 16:15:00 +08:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Asanka Herath
5dcc605f6b Fix calling conventions for Windows 2010-08-20 13:14:10 -04:00
Love Hornquist Astrand
0b2b9d9834 catch error from as.*printf 2010-05-30 14:12:39 -07:00
Love Hornquist Astrand
687db64c56 Patch from Secure Endpoints/Asanka Herath for windows support 2009-12-21 08:45:28 +01:00
Love Hornquist Astrand
926583be1e add _krb5_have_debug 2009-11-22 00:14:33 -08:00
Love Hornquist Astrand
5a3630ba00 Add _krb5_log() used for internal logging 2009-09-07 20:22:14 -07:00
Love Hornquist Astrand
51fbbf93e3 (log_file): use strvisx rightly 2009-07-19 17:52:53 -07:00
Love Hörnquist Åstrand
2b54af87e9 Add paranoid printing using strvisx.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25332 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-07-15 23:31:55 +00:00
Love Hörnquist Åstrand
942a821fab remove RCSID
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25171 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-04 06:17:40 +00:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
dddee52c0d N_()ify
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23787 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-07 21:28:19 +00:00
Love Hörnquist Åstrand
f05f1107ce catch error and return error from krb5_openlog().
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23505 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-08-11 10:00:24 +00:00
Love Hörnquist Åstrand
a165b922e8 set log file close on exec
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23443 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-07-27 12:07:25 +00:00
Love Hörnquist Åstrand
7fcd266fdd use krb5_set_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23316 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-23 04:32:32 +00:00
Love Hörnquist Åstrand
25514c9c3d use krb5_set_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23295 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-23 03:28:37 +00:00
Love Hörnquist Åstrand
473532da2a update (c)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19088 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-21 08:08:46 +00:00
Love Hörnquist Åstrand
b24395ffde (log_file): reset pointer to freed memory
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17214 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-24 15:09:27 +00:00
Love Hörnquist Åstrand
9be36e4522 (krb5_addlog_dest): free fn in case of error
Coverity, NetBSD CID#1882


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17038 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-10 09:41:26 +00:00
Love Hörnquist Åstrand
1708cc306c (krb5_addlog_dest): make string length match strings in strcasecmp.
Found by IBM checker.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16928 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-02 00:22:08 +00:00
Love Hörnquist Åstrand
7ab97d06cc rename variable time to timestr to avoid shadowing
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15468 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-06-17 04:25:05 +00:00
Love Hörnquist Åstrand
9176b9b05c rename close and log to avoid shadow warnings
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15391 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-06-15 03:14:05 +00:00
Love Hörnquist Åstrand
4fcc39ccbc (krb5_closelog): free all content in krb5_log_facility
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15364 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-06-11 00:14:28 +00:00
Love Hörnquist Åstrand
91351971f7 add KRB5_LIB_FUNCTION to all exported functions
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13863 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-05-25 21:46:46 +00:00
Love Hörnquist Åstrand
6e10f776c4 (log_realloc): increase len after realloc returns sucessfully
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12841 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-09-17 23:56:14 +00:00
Johan Danielsson
45cc9bab8d (krb5_vlog_msg): delay message formating till we know we need it
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11399 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-09-05 14:59:14 +00:00
Johan Danielsson
066ef11056 rename syslog_data to avoid name conflicts (from Mattias Amnefelt)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11148 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-08-20 09:49:09 +00:00
Johan Danielsson
6c5b4ca76c constify
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10914 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-04-18 09:19:44 +00:00
Johan Danielsson
23b57ae3cc (krb5_addlog_dest): reorganise syslog parsing
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10904 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-04-17 14:42:20 +00:00
Johan Danielsson
e59f3e6a3f (krb5_closelog): don't pass pointer to pointer (from Gombas Gabor)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10818 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-02-04 10:48:33 +00:00
Assar Westerlund
d27aa3b62e add some krb5_{set,clear}_error_string
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9937 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-05-14 06:14:52 +00:00
Assar Westerlund
b1c3af9c5c (krb5_vlog_msg): fix const-ness
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9057 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-09-17 21:46:07 +00:00
Assar Westerlund
e97f681ee5 (krb5_vlog_msg): log just the format string it we fail to allocate the
actual string to log, should at least provide some hint as to where
things went wrong


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9029 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-09-10 14:11:41 +00:00
Assar Westerlund
ce07d85131 (syslogvals): static-ize
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8992 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-08-24 22:23:30 +00:00
Johan Danielsson
13e58d4142 (krb5_vlog_msg): use krb5_format_time
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8490 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-06-29 08:24:33 +00:00
Johan Danielsson
c5b916ca6f remove advertising clause
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7464 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-12-02 17:05:13 +00:00
Johan Danielsson
f1a6ab665e add __attribute__
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5976 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-04-18 13:48:14 +00:00
Assar Westerlund
878753a0b8 (krb5_addlog_dest): more braces to make gcc happy
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5562 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-03-17 01:42:38 +00:00
Johan Danielsson
d802c7e57f Add log format to context.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4617 ec53bebd-3082-4978-b11e-865c3cabbd6b
1998-03-21 00:48:27 +00:00