From: naddy Date: Fri, 26 Jan 2018 16:40:14 +0000 (+0000) Subject: Handle the transfer size option when faking up /etc/random.seed. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0c1f8293fd080c38eee115a508287b70d641d47e;p=openbsd 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@ --- 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);