(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
This commit is contained in:
@@ -356,17 +356,22 @@ krb5_vlog_msg(krb5_context context,
|
|||||||
__attribute__((format (printf, 5, 0)))
|
__attribute__((format (printf, 5, 0)))
|
||||||
{
|
{
|
||||||
char *msg;
|
char *msg;
|
||||||
|
char *actual;
|
||||||
char buf[64];
|
char buf[64];
|
||||||
time_t t;
|
time_t t;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
vasprintf(&msg, fmt, ap);
|
vasprintf(&msg, fmt, ap);
|
||||||
|
if (msg != NULL)
|
||||||
|
actual = msg;
|
||||||
|
else
|
||||||
|
actual = fmt;
|
||||||
t = time(NULL);
|
t = time(NULL);
|
||||||
krb5_format_time(context, t, buf, sizeof(buf), TRUE);
|
krb5_format_time(context, t, buf, sizeof(buf), TRUE);
|
||||||
for(i = 0; i < fac->len; i++)
|
for(i = 0; i < fac->len; i++)
|
||||||
if(fac->val[i].min <= level &&
|
if(fac->val[i].min <= level &&
|
||||||
(fac->val[i].max < 0 || fac->val[i].max >= level))
|
(fac->val[i].max < 0 || fac->val[i].max >= level))
|
||||||
(*fac->val[i].log)(buf, msg, fac->val[i].data);
|
(*fac->val[i].log)(buf, actual, fac->val[i].data);
|
||||||
*reply = msg;
|
*reply = msg;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user