-/* $OpenBSD: ftpd.c,v 1.233 2023/03/08 04:43:05 guenther Exp $ */
+/* $OpenBSD: ftpd.c,v 1.234 2024/05/09 08:35:03 florian Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
int len;
if ((statfd >= 0) && (getcwd(dir, sizeof(dir)) != NULL)) {
+ char *cnow;
+
time(&now);
+ cnow = ctime(&now);
vpw = malloc(strlen(guest ? guestpw : pw->pw_name) * 4 + 1);
if (vpw == NULL)
len = snprintf(buf, sizeof(buf),
"%.24s %lld %s %lld %s %c %s %c %c %s ftp %d %s %s\n",
- ctime(&now), (long long)(now - start + (now == start)),
+ cnow ? cnow : "?",
+ (long long)(now - start + (now == start)),
vremotehost, (long long)size, vpath,
((type == TYPE_A) ? 'a' : 'b'), "*" /* none yet */,
'o', ((guest) ? 'a' : 'r'),
-/* $OpenBSD: mail.local.c,v 1.42 2023/06/05 08:07:18 op Exp $ */
+/* $OpenBSD: mail.local.c,v 1.43 2024/05/09 08:35:03 florian Exp $ */
/*-
* Copyright (c) 1996-1998 Theo de Raadt <deraadt@theos.com>
FILE *fp = NULL;
time_t tval;
int fd, eline = 1;
- char *tbuf, *line = NULL;
+ char *tbuf, *line = NULL, *cnow;
size_t linesize = 0;
ssize_t linelen;
free(tbuf);
(void)time(&tval);
- (void)fprintf(fp, "From %s %s", from, ctime(&tval));
+ cnow = ctime(&tval);
+ (void)fprintf(fp, "From %s %s", from, cnow ? cnow : "?\n");
while ((linelen = getline(&line, &linesize, stdin)) != -1) {
if (line[linelen - 1] == '\n')
-/* $OpenBSD: spamd.c,v 1.162 2024/04/01 21:09:44 millert Exp $ */
+/* $OpenBSD: spamd.c,v 1.163 2024/05/09 08:35:03 florian Exp $ */
/*
* Copyright (c) 2015 Henning Brauer <henning@openbsd.org>
NI_NUMERICHOST);
if (error)
strlcpy(cp->addr, "<unknown>", sizeof(cp->addr));
+ memset(ctimebuf, 0, sizeof(ctimebuf));
ctime_r(&t, ctimebuf);
ctimebuf[sizeof(ctimebuf) - 2] = '\0'; /* nuke newline */
snprintf(cp->obuf, cp->osize, "220 %s ESMTP %s; %s\r\n",