=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rsync/client.c,v retrieving revision 1.12 retrieving revision 1.13 diff -c -r1.12 -r1.13 *** src/usr.bin/rsync/client.c 2019/03/18 15:33:21 1.12 --- src/usr.bin/rsync/client.c 2019/03/23 00:20:55 1.13 *************** *** 1,4 **** ! /* $Id: client.c,v 1.12 2019/03/18 15:33:21 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: client.c,v 1.13 2019/03/23 00:20:55 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * *************** *** 30,46 **** * It can either be in sender or receiver mode. * In the former, it synchronises local files from a remote sink. * In the latter, the remote sink synchronses to the local files. ! * ! * Pledges: stdio, rpath, wpath, cpath, unveil, fattr, chown. ! * ! * Pledges (dry-run): -cpath, -wpath, -fattr, chown. ! * Pledges (!preserve_times): -fattr. */ int rsync_client(const struct opts *opts, int fd, const struct fargs *f) { struct sess sess; ! int rc = 0; /* Standard rsync preamble, sender side. */ --- 30,43 ---- * It can either be in sender or receiver mode. * In the former, it synchronises local files from a remote sink. * In the latter, the remote sink synchronses to the local files. ! * Returns exit code 0 on success, 1 on failure, 2 on failure with ! * incompatible protocols. */ int rsync_client(const struct opts *opts, int fd, const struct fargs *f) { struct sess sess; ! int rc = 1; /* Standard rsync preamble, sender side. */ *************** *** 64,73 **** } if (sess.rver < sess.lver) { ! ERRX(&sess, "remote protocol is older " ! "than our own (%" PRId32 " < %" PRId32 "): " ! "this is not supported", ! sess.rver, sess.lver); goto out; } --- 61,70 ---- } if (sess.rver < sess.lver) { ! ERRX(&sess, ! "remote protocol %d is older than our own %d: unsupported", ! sess.rver, sess.lver); ! rc = 2; goto out; } *************** *** 105,111 **** WARNX(&sess, "data remains in read pipe"); #endif ! rc = 1; out: return rc; } --- 102,108 ---- WARNX(&sess, "data remains in read pipe"); #endif ! rc = 0; out: return rc; }