IABSD.fr/src/usr.bin/rsync

Branch :


Log

Author Commit Date CI Message
786202c1 2023-02-14 17:15:15 Fix handling of port numbers in rsync://host[:port]/module URLs With and OK tb@
d9a51c35 2022-12-26 19:16:00 spelling fixes; from paul tagliamonte amendments to his diff are noted on tech
e878ec53 2022-08-02 20:01:12 Add missing closing bracket in usage
2eaa6f4e 2022-08-02 18:09:20 Add --contimeout functionality. Input from deraadt@ OK claudio@
40f74970 2022-04-12 14:51:04 Do not convert the int value twice from little to host endian. io_read_int() already does the conversion so don't double up in io_read_ulong(). Fixes openrsync on sparc64. OK miod@ deraadt@
5a0505c8 2022-01-12 22:52:40 seperators -> separators
c91bd412 2021-12-28 11:59:48 In io_write_buf() adjust the calculation of the multiplex message size 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@
1a0afcde 2021-11-28 19:28:41 Stop using MAXBSIZE to eliminate sys/param.h including (which injects a ton of namespace intrusion). Create local sizes, and refactor some code along the way. ok millert
ab0e7209 2021-11-26 03:42:33 followng -> following
f6c6a9b9 2021-11-26 03:41:39 definiton -> definition
f6eb9700 2021-11-03 14:42:12 whitespace observed during a read-through
2157a8e5 2021-11-03 08:30:14 Add missing copyright statement. Reminded by deraadt@
82ecafa1 2021-10-29 08:00:59 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@
81855fde 2021-10-28 13:07:43 Provide --max-size and --min-size arguments. Currently ignored but rpki-client wants --max-size and this will unblock that work. With job@
b7041c07 2021-10-24 21:24:15 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
62c7e043 2021-10-22 16:42:28 add some punctuation;
e397242d 2021-10-22 11:10:34 Implement --compare-dest in openrsync. compare-dest allows you to add additional directories to check for files to be available. OK benno@
e812f350 2021-10-22 09:59:35 When reading the symlink value during the fts travers use ent->fts_accpath since the fts traverse does chdirs for performance reasons. OK deraadt@
173dc874 2021-09-02 21:06:06 remove sys/param.h that snuck in, by replacing MAXPATHLEN with PATH_MAX
0345af14 2021-09-01 09:48:08 Remove from0 support. openrsync will not implement all bad ideas that were added to rsync. from0 is one of those and really not needed. OK job@
ede24f48 2021-08-30 20:25:24 Document new include*/exclude* options in the man page
fecc32f1 2021-08-30 20:25:01 Add include/exclude to usage() OK claudio@
722539fd 2021-08-29 15:37:58 This needs extern.h for the rmatch prototype
57987d16 2021-08-29 13:43:46 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. 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.
f1521a77 2021-07-14 11:14:27 Restructure the getopt_long options. Sort them mostly by name with the 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@
1db0096a 2021-06-30 15:24:10 ... way too much white space!
66125dcd 2021-06-30 13:16:45 Remove TODO.md, this file is not up-to-date and also not really a good todo list for rsync.
b0091597 2021-06-30 13:10:04 Replace Id: tags with OpenBSD: tags OK deraadt@
eab91bee 2021-05-17 12:15:48 Reshuffle if conditions to check for error first after the fstat() calls. OK benno@
8da8f61e 2021-05-17 12:11:05 Do not leak blk.blks in error condition. Noticed by and OK benno@
05e0b7a0 2021-05-17 12:04:38 Adjust exit codes in the main program to follow the ones from rsync. OK benno@
dd3c9d24 2021-05-17 12:02:58 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@
dd135e81 2021-05-17 11:59:09 If pledge() or unveil() fails error out with ERR_IPC. Also error out in the receiver when intial setup fails because of filesystem errors (unable to open or create the base directory) or on memory failures. OK benno@
f642adf7 2021-05-17 11:54:14 Introduce some error exit codes which are in sync with the ones from proper rsync. This should help to make the tool behave more like the real thing. OK benno@
41ffc556 2021-05-17 11:52:10 Sync code with the original from mkdir(1). OK benno@
e107519e 2021-05-17 11:49:01 The openat() then fstat() pattern only works if one is sure the file being opened is a regular file. In other cases this may block in openat() (since the O_NONBLOCK flag removed). Switch to fstatat() and then openat() to protect from involuntary side-effects (like opening a device node) and possible hangs. OK benno@
a982ab77 2021-05-06 07:35:22 Simplify file handling. There is no reason to use O_NONBLOCK on regular files since they will never "block". Remove the UPLOAD_READ_LOCAL state and inline the meta data check into pre_file(). Plug one memory leak and cleanup code a bunch. OK benno@
bb41c969 2021-05-06 07:29:59 More code cleanup OK florian@ benno@
6e53a029 2021-04-05 18:17:37 minor KNF
2df12267 2021-03-31 20:36:05 add --no-motd to SYNOPSIS;
3bf4cfb6 2021-03-31 19:45:16 Add option to suppress the Message of the Day Fine deraadt@
320af302 2021-03-22 11:49:15 Remove unveil() from the rsync_sender() and flist_gen(). The sender is not able to properly unveil itself because you can request many files as arguments. At the same time the sender is read-only and uses rpath pledge() so the gain from unveil() is less of an issue. On the receiver side all files land in one directory and this part still uses unveil() to protect rsync to somehow walk out of the destination directory. From kristaps@
e7e8e562 2021-03-22 11:26:44 Adjust function name in error strings. From kristaps@
ae581bab 2021-03-22 11:25:29 Adjust a type to unsigned since the io function works on unsigned ints. Also the id is a strictly positve integer so this make sense. Cleanup comments and a spacing while there. From kristaps@
17d693db 2021-03-22 11:20:04 Put comment where it belongs also remove an assert() that checks for an impossible condition. The map argument is from a pread() call and can never be MAP_FAILED. From kristaps@
88e84a3b 2021-03-22 11:16:05 Compare explicitly against NULL. From kristaps@
3a011501 2021-03-22 11:14:42 Make fmt argument const. Format local vars a bit. From kristaps@
45646037 2020-12-15 08:20:42 Initialize the poll_timeout before rsync_server() is called. Without this the server will immediatly fail because the poll timeout is 0. Found and reported by Daniel Moch (daniel at danielmoch dot com)
a84b4914 2020-11-24 16:54:44 Simple implementation of --timeout to exit after specified seconds of I/O inactivity. By default rsync will wait forever but this results in stuck processes if the remote side does not answer properly as seen in rpki-client. OK job@ benno@
55a1066f 2020-08-19 11:10:42 Handle EADDRNOAVAIL from connect(2) gracefully The server's DNS name may yield multiple addresses of different address families; in case the local client has no suitable address, i.e. connect(2) fails with EADDRNOTAVAIL, do not fail hard but try the next address instead. Report (IPv6 only client with dualstack server) and diff from Sasha Romijn. OK job
7ddad9c7 2020-05-17 19:54:41 __FILE__ and __LINE__ information are fine during early development, or occasionally for fatal source-code bugs are critical and must be hunted down. It is NOT suitable to expose regular users to this on a regular basis though. ok kn beck
70813041 2020-02-11 18:41:39 Simplify and unify wording for the -I sourceaddr option in various places. This is somewhat related to the "-b bind_addr" option some programs have, which should get some cleanup also... input florian claudio jmc
fdde5f0a 2020-01-04 11:53:53 Delete .Xrs to rsync(5) and rsyncd(5). If somebody wants to install these two manual pages describing the protocols, it is easy to put these two links back. Dead links reported by <Aham dot Brahmasmi at gmx dot com>. OK jmc@ florian@
c314c803 2019-08-26 22:22:14 replace a mmap() with pread(). The mmap() is not needed, the file is read sequentially anyway, (hash-sized) block by block. This avoids counting potentially large files against the memory limits of the process. Problem reported by Jan Stary, thanks. ok deraadt@
7b590dfa 2019-08-09 13:11:26 Only print the message of the day in the rsyncd header if rsync is started with -v. In normal operation rsync should only print errors. OK benno@ deraadt@
a52e5c3a 2019-08-09 05:28:01 Add --address argument to openrsync to bind to the specified address when connecting to a rsync daemon. OK deraadt@ benno@ naddy@ sthen@
3aaa63eb 2019-06-28 13:34:58 When system calls indicate an error they return -1, not some arbitrary value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
95af8abf 2019-06-27 18:03:36 Some asprintf() calls were checked < 0, rather than the precise == -1. ok millert nicm tb, etc
447e3174 2019-06-23 10:28:32 fix free() on uninitialized pointer with -rx and same suggestions and ok naddy@ and ok previois diff florian@. from Hiltjo Posthuma hiltjo AT codemadness DOT org and Bjoern Ketelaars bjorn DOT ketelaars AT hydroxide DOT nl, Thanks.
0724efd0 2019-06-03 15:37:48 Don't close the socket in rsync_socket() itself but after calling it. Fixes a corner case where the socket was closed twice, reported by Hiltjo Posthuma. ok deraadt@
dc4a3938 2019-06-02 17:43:34 KNF and sneaky whitespaces
ea555712 2019-06-02 17:36:48 Use a simple hash table to look up blocks by the fast-hash. Also use a rolling computation for the fast-hash.OB With this openrsync is on par with gpl rsync for file updates. From kristaps
57d08c5e 2019-06-02 14:30:51 have_md is initialized at startup, don't need to do it again later from Hiltjo Posthuma
69cdce33 2019-06-02 14:29:58 spelling; from Hiltjo Posthuma
47e90edf 2019-05-28 18:20:30 unintialized fd passed to close(), found by hiltjo posthuma
ba617ada 2019-05-08 21:30:11 remove sess argument from all functions that only used it for logging functions. ok deraadt@
b2a7eac7 2019-05-08 20:00:25 remove sess argument from log functions. ok deraadt@
45df3426 2019-05-06 15:44:34 Remove an example that doesn't do what the accompanying text says, with the current formatting. OK benno@ naddy@ The original suggestion to delete it rather than fix it came from deraadt@: we do not want to encourage use of --rsync-path because it is important that the openrsync client smoothly works with the Samba rsync server. If it doesn't, we should fix it and not fragment the ecosystem.
1c3d4160 2019-04-04 04:19:54 Add support for not crossing filesystem boundaries (-x) to rsync. Option and behaviour is the same as GPL rsync. Initial diff received feedback from benno@, schwarze@, deraadt@ and florian@. Thanks! OK deraadt@
8a54c977 2019-04-02 11:05:55 annoying white space
4d864e8f 2019-04-02 05:32:08 Pull in addargs() API from ssh to replace complicated hand-rolled argument composition code for the remote process. ok florian naddy
47f3c363 2019-04-01 13:04:51 many improvements to rsync(1) documentation: tweaks and OK deraadt@ naddy@
cf0720cb 2019-03-31 13:17:44 Drop --devices and --specials from the synopsis because they are only low-utility parts of the more useful and shorter -D. Nice because it brings the synopsis down to two lines, and because the approach buys us additional time before the synopsis may grow disgustingly long again. "Shrug. Probably helps." deraadt@
aa1dcd86 2019-03-31 09:26:05 Increasing strictness regarding signed-vs-unsigned types and their range in the io-path, whic is done by seperating int vs uint functions variants. reviewed by naddy, florian, and jsg
ac024dd4 2019-03-31 08:47:46 Add ability to combine rsync:// and -e by splitting rsync_socket() into two functions, rsync_connect() to establish a TCP connection to the remote daemon, and rsync_socket() to run the actual protocol. E.g.: rsync -av --del -e 'ssh -W localhost:rsync -lanoncvs' \ rsync://anoncvs.spacehopper.org/OpenBSD-CVS/ /cvs ok deraadt@
8767334c 2019-03-30 23:48:24 Make the synopsis more palatable by deleting useless long option aliases where short or shorter forms exist; of course, the long versions remain in the full option listing as well as in the code. Also drop some redundant repetions of .Fl macros. OK jmc@ deraadt@
79782833 2019-03-30 09:55:05 repair confusing "} if" indent; from naddy
8dad8af8 2019-03-30 09:32:54 document --del, ok deraadt@
afb54730 2019-03-30 07:28:55 For now perform utimes, chown, chmod in the same order as cp(1), until we know later how rsync wants to behave and how it interacts with future option development. This sequence is safest, since it drops setugid bits in case of failure to chown.. ok florian
90d56d89 2019-03-30 07:24:42 Add --del as alias for --delete. Drop --no-delete. The "no-" prefix is only available for options that are implied by other options. --delete is never implied and GPL rsync does not accept --no-delete. ok deraadt@
80888faf 2019-03-30 07:24:02 fix typo in ERRX1
4fbea989 2019-03-26 17:13:42 Same INT32_MAX vs -1 confusion on the write-side (previous commit was for read-side)
75c8f3ba 2019-03-26 16:20:03 INT32_MAX isn't -1, to indicate re-read for 64-bit value. Diagnosed by krw, ok florian
4eeef55c 2019-03-25 21:09:49 -z support isn't as trivial as linking -lz so it hasn't been written yet. In the meantime, make it a warning-no-op, as most usage cases will be satisfied by this (and hopefully annoy someone to write support) ok florian benno
60ac34c7 2019-03-23 23:22:57 Treat time from remote as unsigned 32 bit rather than signed, when casting it into a time_t. If the remote doesn't muck things up, we may make it through 2038.. (best that can be done without protocol repair and coordination) ok benno
02f20df6 2019-03-23 16:04:28 indents and reflows around ERR*() and LOG*(); ok benno
83649630 2019-03-23 00:20:55 repair exit codes, slightly broken after last commit (please do not go to an enum, that's just alien). Documents the return values in each function and unifies the protocol incompatibility error message. from kristaps
82637e4e 2019-03-22 20:12:23 Don't register this manual page under the name rsync(1) yet because "man rsync" still ought to show the manual page from the port. Consistently use the name "openrsync" for now. Issue reported by espie@; OK jmc@.
a4c5e668 2019-03-22 19:56:47 gettimeofday(2)+TIMEVAL_TO_TIMESPEC -> UTIME_NOW; simpler & more portable. ok millert@
c99dd5cd 2019-03-18 18:11:07 add a temporary addition to NAME for openrsync; ok deraadt
08a7862d 2019-03-18 15:33:21 repair a few more yoda compares
59175122 2019-03-18 08:11:11 flesh out SYNOPSIS and usage() somewhat; ok deraadt benno
e762119d 2019-03-18 04:32:31 install rsync as openrsync, so that people can easily familiarize themselves with using it (as front end -- it will talk to the installed 'rsync' on the remote side). this will allow folks to give it a shot, identify weaknesses, collaborate, etc etc etc discussed with benno
ef859540 2019-03-06 18:37:22 Simplify startup code, various phases are heading straight towards exit so they don't need to be constructed to return errors. ok benno florian
e341876b 2019-02-22 09:54:36 remove __BEGIN_DECLS/__END_DECLS, this .h file wont be read by a C++ compiler, and __* are no lonmger recommended. https://www.gnu.org/software/libtool/manual/html_node/C-header-files.html ok deraadt@
1c13accf 2019-02-21 22:15:09 kristaps f18392f58d1f0bc72917e3ac3a46be74c194688d Document that the gid/uid list may be empty. Fixes https://github.com/kristapsdz/openrsync/issues/10
4cdf811f 2019-02-21 22:13:43 kristaps cbe83cd64f40e634dbc22d3f2918c41977a6514d If we don't get a uid/gid map, such as with an rsync:// address, we might not be able to map. So fall back on numeric ids.
521a61e9 2019-02-21 22:12:48 kristaps 7721288a1d170f4d789bf7a7b822f14f91f7bcb9 In order for GPL rsync(1) to work with --delete when openrsync is a remote sender, we need to set the FLIST_TOP_LEVEL bit for all top-level directories. This is because the GPL rsync(1) uses this bit to determine which directories to scan for files for deletion.
2b7b2d66 2019-02-21 22:11:26 kristaps 156cf3b7d459efe133d603158fc33c243dc07ba0 Use style(9) for bit
aeb41609 2019-02-21 22:09:47 kristaps 97df28257f3cc5faae8072fbadbc334a57a4e8a7 Remove another potential deadlock when in sender mode with multiplexing enabled.