From 0c1f8293fd080c38eee115a508287b70d641d47e Mon Sep 17 00:00:00 2001 From: naddy Date: Fri, 26 Jan 2018 16:40:14 +0000 Subject: [PATCH] Handle the transfer size option when faking up /etc/random.seed. Without this, clients that queried the size would receive 0 as response. ok jca@ --- usr.sbin/tftpd/tftpd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/tftpd/tftpd.c b/usr.sbin/tftpd/tftpd.c index 8536cf59048..b3c708b9e3e 100644 --- a/usr.sbin/tftpd/tftpd.c +++ b/usr.sbin/tftpd/tftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tftpd.c,v 1.40 2017/11/07 14:15:38 jca Exp $ */ +/* $OpenBSD: tftpd.c,v 1.41 2018/01/26 16:40:14 naddy Exp $ */ /* * Copyright (c) 2012 David Gwynne @@ -973,6 +973,8 @@ validate_access(struct tftp_client *client, const char *requested) buf = client->buf + sizeof(client->buf) - 512; arc4random_buf(buf, 512); + if (options != NULL && options[OPT_TSIZE].o_request) + options[OPT_TSIZE].o_reply = 512; client->file = fmemopen(buf, 512, "r"); if (client->file == NULL) return (errno + 100); -- 2.20.1