summaryrefslogtreecommitdiff
path: root/usr.bin/rsync
AgeCommit message (Collapse)Author
2024-10-13include stdio.h for sscanf() snprintf()Jonathan Gray
2024-09-27rsync: make blkhash_free() callable with NULL.Theo Buehler
It is in principle possible that blkhash_free() (which obviously frees a struct blktab, sigh) is called with NULL. This would lead to a crash. ok claudio
2024-09-27rsync: avoid reallocarray() with a nmemb of 0.Theo Buehler
bset->blksz can be 0 here and how reallocarray() behaves is implementation defined.
2024-09-27rsync: fix reallocarray() usage in blkhash_set()Theo Buehler
The well-named ERR() macro doesn't error out. Therefore an incorrect use of reallocarray() is actually a leak that is easily overlooked. Do it the right way by assigning to a temporary variable and preserve behavior by freeing and NULL-ing. ok claudio
2024-09-18Fix a memory leakJob Snijders
Found by Martin Cracauer "look right" tb@
2024-05-21remove prototypes with no matching function and externs with no varJonathan Gray
partly checked by millert@
2024-03-20Remove some else statements in if () else if () chains that don't needClaudio Jeker
to be written this way. Makes the code more readable. OK tb@
2024-02-28Refactor blk_match(). Fold the remaining data and empty file or no blocksClaudio Jeker
cases together since they are kind of the same. OK tb@
2024-02-27Split hash_file into three steps, setup, add buf and final.Claudio Jeker
Setup inits the context and adds the seed. The buf function simply adds a block from the file to the hash. The final function calls MD4_Final() to close the context and generate the hash. This will help to remove the mmap in the sender and should result in a more atomic view of the file since hash_file() is now called together with the other hash_functions. OK deraadt@ tb@
2024-02-20Add missing check for the case where the pattern hits a barrier beforeClaudio Jeker
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. Report and diff from Kyle Evans (kevans FreeBSD.org) OK tb@
2024-02-19Fix a deadlock in openrsync when big files are synced using the hashClaudio Jeker
algorithm. Make sure the sender does not run ahead of itself and end stalling in a read from network that never shows up. Instead ensure that all queued data is pushed out before accepting new data. Problem found by and fix developed with Kyle Evans (kevans freebsd.org) OK tb@ deraadt@
2023-12-27Fix handling of skipped elements on the very first element transmitted.Claudio Jeker
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
2023-11-27Document -J, --omit-link-times and remove a confusing sentence fromClaudio Jeker
the -O, --omit-dir-times description. OK tb@
2023-11-27Implement --omit-link-times / -J based on the --omit-dir-times workClaudio Jeker
done by job@. OK tb@
2023-11-27The uploader tail shortcut to skip dir postprocessing should also checkClaudio Jeker
if ignore_dir_times is set. In that case preserve_times loses its meaning. OK tb@
2023-11-27Add --no-O and --no-omit-dir-times options. For some reason the realClaudio Jeker
rsync has these options and so should ours. These strange --no-XYZ options are undocumented and are there just for compatibility. OK tb@ job@
2023-11-23Add --omit-dir-times / -OJob Snijders
OK claudio@
2023-04-28Implement --size-only and --ignore-timesClaudio Jeker
Flags are passed to the remote system but --size-only is only set if local system is sender since this is the behaviour of rsync. Initial diff from Martin Cracauer but mostly reimplemented and extended by myself. OK kn@
2023-04-27sort options;Jason McIntyre
2023-04-27Implement -V as an alias to --version.Claudio Jeker
From Martin Cracauer OK kn@
2023-04-12Fix 24bit maximum/mask in manpage. Noticed by wangqr on github.Claudio Jeker
2023-02-14Fix handling of port numbers in rsync://host[:port]/module URLsJob Snijders
With and OK tb@
2022-12-26spelling fixes; from paul tagliamonteJason McIntyre
amendments to his diff are noted on tech
2022-08-02Add missing closing bracket in usageTheo Buehler
2022-08-02Add --contimeout functionality.Job Snijders
Input from deraadt@ OK claudio@
2022-04-12Do not convert the int value twice from little to host endian.Claudio Jeker
io_read_int() already does the conversion so don't double up in io_read_ulong(). Fixes openrsync on sparc64. OK miod@ deraadt@
2022-01-12seperators -> separatorsTheo Buehler
2021-12-28In io_write_buf() adjust the calculation of the multiplex message sizeClaudio Jeker
so that the loop works even for buffers bigger than 0xffffff. The code does not produce such big buffers but better make the code correct. Reported by Blago Dachev (blago (at) dachev (dot) com) OK benno@
2021-11-28Stop using MAXBSIZE to eliminate sys/param.h including (which injects aTheo de Raadt
ton of namespace intrusion). Create local sizes, and refactor some code along the way. ok millert
2021-11-26followng -> followingJonathan Gray
2021-11-26definiton -> definitionJonathan Gray
2021-11-03whitespace observed during a read-throughTheo de Raadt
2021-11-03Add missing copyright statement. Reminded by deraadt@Claudio Jeker
2021-10-29Properly implement --max-size and --min-size.Claudio Jeker
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@
2021-10-28Provide --max-size and --min-size arguments. Currently ignored butClaudio Jeker
rpki-client wants --max-size and this will unblock that work. With job@
2021-10-24For open/openat, if the flags parameter does not contain O_CREAT, theTheo de Raadt
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
2021-10-22add some punctuation;Jason McIntyre
2021-10-22Implement --compare-dest in openrsync. compare-dest allows you to addClaudio Jeker
additional directories to check for files to be available. OK benno@
2021-10-22When reading the symlink value during the fts travers use ent->fts_accpathClaudio Jeker
since the fts traverse does chdirs for performance reasons. OK deraadt@
2021-09-02remove sys/param.h that snuck in, by replacing MAXPATHLEN with PATH_MAXTheo de Raadt
2021-09-01Remove from0 support. openrsync will not implement all bad ideas thatClaudio Jeker
were added to rsync. from0 is one of those and really not needed. OK job@
2021-08-30Document new include*/exclude* options in the man pageJob Snijders
2021-08-30Add include/exclude to usage()Job Snijders
OK claudio@
2021-08-29This needs extern.h for the rmatch prototypeClaudio Jeker
2021-08-29Implement --exclude/exclude-file and --include/include-file.Claudio Jeker
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. This adds a special matching function to allow the ** matching which behaves mostly like rsyncs version with the exception of how bad [] patterns are expanded. For bad patterns openrsync follows more how fnmatch behaves and not the somewhat strange rsync behaviour. Not perfect but committing now so people can test and provide feedback.
2021-07-14Restructure the getopt_long options. Sort them mostly by name with theClaudio Jeker
exception of no-xyz options that are grouped with the coresponding xyz option. Fix --no-motd to use the internal flag setting of getopt_long. Also use some defines instead of numbers for pure long options that need special handling. OK benno@
2021-06-30... way too much white space!Claudio Jeker
2021-06-30Remove TODO.md, this file is not up-to-date and also not really a goodClaudio Jeker
todo list for rsync.
2021-06-30Replace Id: tags with OpenBSD: tagsClaudio Jeker
OK deraadt@
2021-05-17Reshuffle if conditions to check for error first after the fstat() calls.Claudio Jeker
OK benno@