=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rsync/sender.c,v retrieving revision 1.28.2.1 retrieving revision 1.29 diff -u -r1.28.2.1 -r1.29 --- src/usr.bin/rsync/sender.c 2021/11/09 13:41:24 1.28.2.1 +++ src/usr.bin/rsync/sender.c 2021/06/30 13:10:04 1.29 @@ -1,4 +1,4 @@ -/* $Id: sender.c,v 1.28.2.1 2021/11/09 13:41:24 benno Exp $ */ +/* $OpenBSD: sender.c,v 1.29 2021/06/30 13:10:04 claudio Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * @@ -358,7 +358,7 @@ { struct flist *fl = NULL; const struct flist *f; - size_t i, flsz = 0, phase = 0; + size_t i, flsz = 0, phase = 0, excl; int rc = 0, c; int32_t idx; struct pollfd pfd[3]; @@ -393,9 +393,13 @@ } /* Client sends zero-length exclusions if deleting. */ - if (!sess->opts->server && sess->opts->del) - send_rules(sess, fdout); + if (!sess->opts->server && sess->opts->del && + !io_write_int(sess, fdout, 0)) { + ERRX1("io_write_int"); + goto out; + } + /* * Then the file list in any mode. * Finally, the IO error (always zero for us). @@ -423,8 +427,15 @@ * This is always 0 for now. */ - if (sess->opts->server) - recv_rules(sess, fdin); + if (sess->opts->server) { + if (!io_read_size(sess, fdin, &excl)) { + ERRX1("io_read_size"); + goto out; + } else if (excl != 0) { + ERRX1("exclusion list is non-empty"); + goto out; + } + } /* * Set up our poll events.