From: kn Date: Sun, 9 Oct 2022 23:04:57 +0000 (+0000) Subject: Drop fattr promise unless file creation is allowed X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ad0375c2328ca86685178ac65521469240a360f2;p=openbsd 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 --- 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)