diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2023-11-09 18:19:00 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2023-11-09 18:19:00 +0000 |
commit | 652ccf2f3bd8f5bf84917f681404b36ab48364db (patch) | |
tree | 43b666e1647821eb63ed31cc8b373896a44def99 /usr.bin | |
parent | 1b3c1df8fefb73bc704a94823903f47ba66cb377 (diff) |
-C/resume without "proc exec"
ftp(1) has "proc exec" to run sh(1) on interactive ! commands and filenames
starting with "|"; this is orthogonal to continuing transfers using the
existing file size as offsets.
There seems to be no case where a) the argument is an URL, i.e. we pledge,
and b) a shell is spawned somehow, so avoid these promises when resuming.
bsd.port.mk(5) FETCH_CMD uses -C by default.
OK millert
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ftp/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index decebcb995c..2d6265bd128 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.138 2021/07/14 13:33:57 kn Exp $ */ +/* $OpenBSD: main.c,v 1.139 2023/11/09 18:18:59 kn Exp $ */ /* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */ /* @@ -617,24 +617,26 @@ main(volatile int argc, char *argv[]) if (isurl(argv[0])) { if (pipeout) { #ifndef SMALL + if (!resume) { if (pledge("stdio rpath dns tty inet proc exec fattr", NULL) == -1) err(1, "pledge"); -#else + } else +#endif /* !SMALL */ if (pledge("stdio rpath dns tty inet fattr", NULL) == -1) err(1, "pledge"); -#endif } else { #ifndef SMALL + if (!resume) { if (pledge("stdio rpath wpath cpath dns tty inet proc exec fattr", NULL) == -1) err(1, "pledge"); -#else + } else +#endif /* !SMALL */ if (pledge("stdio rpath wpath cpath dns tty inet fattr", NULL) == -1) err(1, "pledge"); -#endif } rval = auto_fetch(argc, argv, outfile); |