master
Properly implement --max-size and --min-size. This uses scan_scaled(3) from libutil which is very similar to how rsync behaves. Not implemented are the +/-1 math and the 1000 vs 1024 multipliers. OK benno@ job@
rsync: make blkhash_free() callable with NULL.
Implement --exclude/exclude-file and --include/include-file. Currently only simple include and excludes work, the advanced filters introduced later in rsync are not implemented. It is unclear if the per directory filters are something we want to implement. This requires more modern protocols which openrsync is not able to handle right now.
Replace Id: tags with OpenBSD: tags OK deraadt@
rename a function argument for clarity
For open/openat, if the flags parameter does not contain O_CREAT, the 3rd (variadic) mode_t parameter is irrelevant. Many developers in the past have passed mode_t (0, 044, 0644, or such), which might lead future people to copy this broken idiom, and perhaps even believe this parameter has some meaning or implication or application. Delete them all. This comes out of a conversation where tb@ noticed that a strange (but intentional) pledge behaviour is to always knock-out high-bits from mode_t on a number of system calls as a safety factor, and his bewilderment that this appeared to be happening against valid modes (at least visually), but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef. ok millert
For --compare-dest and other similar operations, openat() was being used relative to the main directory, which in the rpki-client case is crazy ../../.. paths -- rsync arguments could end up with files anywhere on the filesystem and noone knew where until the openat calls() happened. This design also led to unveil("/", "r"). It is better to contruct absolute paths and use open() in the right places. ok job, lots of discussion with claudio
Implement --omit-link-times / -J based on the --omit-dir-times work done by job@. OK tb@
Fix handling of skipped elements on the very first element transmitted. rsync compares e.g. the first mtime against 0, if the mtime is the epoch then rsync will skip this field and openrsync will choke when receiving it. So if there is no first element but a FLIST_XYZ_SAME flag is use 0 as value. Problem noticed by job@ OK tb@ job@ and yoda@ for fixing the if statements
Split hash_file into three steps, setup, add buf and final.
spelling fixes; from paul tagliamonte amendments to his diff are noted on tech
Error out on memory failures in fargs_cmdline() and addargs() in both cases it was impossible to start the remote rsync anyway. Also now fargs_cmdline() can no longer fail. Add missing err(ERR_IPC, "pldege") for the cases in socket.c OK benno@
Sync code with the original from mkdir(1). OK benno@
Some asprintf() calls were checked < 0, rather than the precise == -1. ok millert nicm tb, etc
Add missing check for the case where the pattern hits a barrier before the string is consumed as well. Right now a string of 'dir1/' and a pattern of 'dir/' will result in an infinite loop because matchsub() would return success but then would not move forward.
Document -J, --omit-link-times and remove a confusing sentence from the -O, --omit-dir-times description. OK tb@
Fix 24bit maximum/mask in manpage. Noticed by wangqr on github.
sync with kristaps up to Sun Feb 17 2019
Remove some else statements in if () else if () chains that don't need to be written this way. Makes the code more readable. OK tb@
whitespace observed during a read-through
remove sys/param.h that snuck in, by replacing MAXPATHLEN with PATH_MAX
include stdio.h for sscanf() snprintf()
Add version information via include