From ad0375c2328ca86685178ac65521469240a360f2 Mon Sep 17 00:00:00 2001 From: kn Date: Sun, 9 Oct 2022 23:04:57 +0000 Subject: [PATCH] Drop fattr promise unless file creation is allowed This is only required for the single fchmod(2) ensuring default permissions which only happens in the -c code path. OK millert --- usr.sbin/tftpd/tftpd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/tftpd/tftpd.c b/usr.sbin/tftpd/tftpd.c index 049f6f20c05..168df85e049 100644 --- a/usr.sbin/tftpd/tftpd.c +++ b/usr.sbin/tftpd/tftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tftpd.c,v 1.49 2022/10/04 23:33:22 kn Exp $ */ +/* $OpenBSD: tftpd.c,v 1.50 2022/10/09 23:04:57 kn Exp $ */ /* * Copyright (c) 2012 David Gwynne @@ -399,7 +399,7 @@ main(int argc, char *argv[]) if (pledge("stdio rpath wpath cpath fattr dns inet", NULL) == -1) lerr(1, "pledge"); } else if (canwrite) { - if (pledge("stdio rpath wpath fattr dns inet", NULL) == -1) + if (pledge("stdio rpath wpath dns inet", NULL) == -1) lerr(1, "pledge"); } else { if (pledge("stdio rpath dns inet", NULL) == -1) -- 2.20.1