From: op Date: Fri, 3 Nov 2023 13:38:28 +0000 (+0000) Subject: cast tv_usec to long for *printf X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8c71974ff112aa1e1bc5bfd2ce009f0f7e729cd1;p=openbsd cast tv_usec to long for *printf mostly for -portable; on darwin suseconds_t is an int. ok tb@ --- diff --git a/usr.sbin/smtpd/lka_filter.c b/usr.sbin/smtpd/lka_filter.c index c67b7ba4df9..e53b161969b 100644 --- a/usr.sbin/smtpd/lka_filter.c +++ b/usr.sbin/smtpd/lka_filter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka_filter.c,v 1.73 2023/07/07 14:52:00 op Exp $ */ +/* $OpenBSD: lka_filter.c,v 1.74 2023/11/03 13:38:28 op Exp $ */ /* * Copyright (c) 2018 Gilles Chehade @@ -916,13 +916,13 @@ filter_protocol_query(struct filter *filter, uint64_t token, uint64_t reqid, con n = io_printf(lka_proc_get_io(filter->proc), "filter|%s|%lld.%06ld|smtp-in|%s|%016"PRIx64"|%016"PRIx64"|%s|%s\n", PROTOCOL_VERSION, - (long long)tv.tv_sec, tv.tv_usec, + (long long)tv.tv_sec, (long)tv.tv_usec, phase, reqid, token, fs->rdns, param); else n = io_printf(lka_proc_get_io(filter->proc), "filter|%s|%lld.%06ld|smtp-in|%s|%016"PRIx64"|%016"PRIx64"|%s\n", PROTOCOL_VERSION, - (long long)tv.tv_sec, tv.tv_usec, + (long long)tv.tv_sec, (long)tv.tv_usec, phase, reqid, token, param); if (n == -1) fatalx("failed to write to processor"); @@ -940,7 +940,7 @@ filter_data_query(struct filter *filter, uint64_t token, uint64_t reqid, const c "filter|%s|%lld.%06ld|smtp-in|data-line|" "%016"PRIx64"|%016"PRIx64"|%s\n", PROTOCOL_VERSION, - (long long)tv.tv_sec, tv.tv_usec, + (long long)tv.tv_sec, (long)tv.tv_usec, reqid, token, line); if (n == -1) fatalx("failed to write to processor"); @@ -1357,7 +1357,7 @@ report_smtp_broadcast(uint64_t reqid, const char *direction, struct timeval *tv, va_start(ap, format); if (io_printf(lka_proc_get_io(rp->name), "report|%s|%lld.%06ld|%s|%s|%016"PRIx64"%s", - PROTOCOL_VERSION, (long long)tv->tv_sec, tv->tv_usec, + PROTOCOL_VERSION, (long long)tv->tv_sec, (long)tv->tv_usec, direction, event, reqid, format[0] != '\n' ? "|" : "") == -1 || io_vprintf(lka_proc_get_io(rp->name), format, ap) == -1) diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index ca21c5b86d4..7848ece404a 100644 --- a/usr.sbin/smtpd/smtp_session.c +++ b/usr.sbin/smtpd/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.436 2023/10/09 20:55:32 millert Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.437 2023/11/03 13:38:28 op Exp $ */ /* * Copyright (c) 2008 Gilles Chehade @@ -2279,7 +2279,7 @@ smtp_auth_failure_pause(struct smtp_session *s) tv.tv_sec = 0; tv.tv_usec = arc4random_uniform(1000000); log_trace(TRACE_SMTP, "smtp: timing-attack protection triggered, " - "will defer answer for %lu microseconds", tv.tv_usec); + "will defer answer for %lu microseconds", (long)tv.tv_usec); evtimer_set(&s->pause, smtp_auth_failure_resume, s); evtimer_add(&s->pause, &tv); }