From: job Date: Thu, 28 Oct 2021 13:50:29 +0000 (+0000) Subject: Don't fetch files larger than 2MB X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=542275b6ff738c3f72661e4bb0eea33f0962d2ef;p=openbsd Don't fetch files larger than 2MB OK claudio@ --- diff --git a/usr.sbin/rpki-client/rsync.c b/usr.sbin/rpki-client/rsync.c index a1bdd7f3a66..bc711f143ef 100644 --- a/usr.sbin/rpki-client/rsync.c +++ b/usr.sbin/rpki-client/rsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsync.c,v 1.28 2021/10/23 20:01:16 claudio Exp $ */ +/* $OpenBSD: rsync.c,v 1.29 2021/10/28 13:50:29 job Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -33,6 +33,9 @@ #include "extern.h" +#define __STRINGIFY(x) #x +#define STRINGIFY(x) __STRINGIFY(x) + /* * A running rsync process. * We can have multiple of these simultaneously and need to keep track @@ -275,6 +278,7 @@ proc_rsync(char *prog, char *bind_addr, int fd) args[i++] = (char *)prog; args[i++] = "-rt"; args[i++] = "--no-motd"; + args[i++] = "--max-size=" STRINGIFY(MAX_FILE_SIZE); args[i++] = "--timeout=180"; args[i++] = "--include=*/"; args[i++] = "--include=*.cer";