summaryrefslogtreecommitdiffstats
path: root/usr.bin/rsync (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Don't close the socket in rsync_socket() itself but after calling it.naddy2019-06-032-12/+6
| | | | | | Fixes a corner case where the socket was closed twice, reported by Hiltjo Posthuma. ok deraadt@
* KNF and sneaky whitespacesderaadt2019-06-021-7/+5
|
* Use a simple hash table to look up blocks by the fast-hash. Also useflorian2019-06-023-45/+179
| | | | | | a rolling computation for the fast-hash.OB With this openrsync is on par with gpl rsync for file updates. From kristaps
* have_md is initialized at startup, don't need to do it again laterderaadt2019-06-021-2/+1
| | | | from Hiltjo Posthuma
* spelling; from Hiltjo Posthumaderaadt2019-06-021-2/+2
|
* unintialized fd passed to close(), found by hiltjo posthumaderaadt2019-05-281-2/+2
|
* remove sess argument from all functions that only used it for loggingbenno2019-05-0815-150/+131
| | | | | functions. ok deraadt@
* remove sess argument from log functions. ok deraadt@benno2019-05-0819-575/+561
|
* Remove an example that doesn't do what the accompanying text says,schwarze2019-05-061-11/+2
| | | | | | | | | | 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.
* Add support for not crossing filesystem boundaries (-x) to rsync. Optionbket2019-04-045-12/+95
| | | | | | | | | and behaviour is the same as GPL rsync. Initial diff received feedback from benno@, schwarze@, deraadt@ and florian@. Thanks! OK deraadt@
* annoying white spacederaadt2019-04-024-17/+16
|
* Pull in addargs() API from ssh to replace complicated hand-rolled argumentderaadt2019-04-024-63/+128
| | | | | composition code for the remote process. ok florian naddy
* many improvements to rsync(1) documentation:schwarze2019-04-012-59/+82
| | | | tweaks and OK deraadt@ naddy@
* Drop --devices and --specials from the synopsis because they are onlyschwarze2019-03-312-9/+6
| | | | | | | 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@
* Increasing strictness regarding signed-vs-unsigned types and their rangederaadt2019-03-315-67/+104
| | | | | in the io-path, whic is done by seperating int vs uint functions variants. reviewed by naddy, florian, and jsg
* Add ability to combine rsync:// and -e by splitting rsync_socket()naddy2019-03-314-42/+71
| | | | | | | | | | | 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@
* Make the synopsis more palatable by deleting useless long optionschwarze2019-03-302-27/+14
| | | | | | | 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@
* repair confusing "} if" indent; from naddyderaadt2019-03-301-2/+3
|
* document --del, ok deraadt@naddy2019-03-302-5/+6
|
* For now perform utimes, chown, chmod in the same order as cp(1), untilderaadt2019-03-301-38/+42
| | | | | | | 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
* Add --del as alias for --delete.naddy2019-03-301-2/+2
| | | | | | | | 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@
* fix typo in ERRX1deraadt2019-03-301-2/+2
|
* Same INT32_MAX vs -1 confusion on the write-sidederaadt2019-03-261-2/+2
| | | | (previous commit was for read-side)
* INT32_MAX isn't -1, to indicate re-read for 64-bit value.deraadt2019-03-261-2/+2
| | | | Diagnosed by krw, ok florian
* -z support isn't as trivial as linking -lz so it hasn't been writtenderaadt2019-03-251-7/+12
| | | | | | 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
* Treat time from remote as unsigned 32 bit rather than signed, whenderaadt2019-03-231-3/+4
| | | | | | | 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
* indents and reflows around ERR*() and LOG*(); ok bennoderaadt2019-03-2312-125/+105
|
* repair exit codes, slightly broken after last commit (please do not goderaadt2019-03-234-37/+41
| | | | | | to an enum, that's just alien). Documents the return values in each function and unifies the protocol incompatibility error message. from kristaps
* Don't register this manual page under the name rsync(1) yetschwarze2019-03-221-5/+4
| | | | | | 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@.
* gettimeofday(2)+TIMEVAL_TO_TIMESPEC -> UTIME_NOW; simpler & more portable.cheloha2019-03-221-17/+11
| | | | ok millert@
* add a temporary addition to NAME for openrsync; ok deraadtjmc2019-03-181-2/+3
|
* repair a few more yoda comparesderaadt2019-03-183-8/+8
|
* flesh out SYNOPSIS and usage() somewhat;jmc2019-03-182-37/+45
| | | | ok deraadt benno
* install rsync as openrsync, so that people can easily familiarizederaadt2019-03-181-3/+8
| | | | | | | 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
* Simplify startup code, various phases are heading straight towards exitderaadt2019-03-067-152/+75
| | | | | so they don't need to be constructed to return errors. ok benno florian
* remove __BEGIN_DECLS/__END_DECLS, this .h file wont bebenno2019-02-221-5/+1
| | | | | | 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@
* kristaps f18392f58d1f0bc72917e3ac3a46be74c194688dbenno2019-02-211-1/+3
| | | | | Document that the gid/uid list may be empty. Fixes https://github.com/kristapsdz/openrsync/issues/10
* kristaps cbe83cd64f40e634dbc22d3f2918c41977a6514dbenno2019-02-211-5/+7
| | | | | 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.
* kristaps 7721288a1d170f4d789bf7a7b822f14f91f7bcb9benno2019-02-212-3/+13
| | | | | | | 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.
* kristaps 156cf3b7d459efe133d603158fc33c243dc07ba0benno2019-02-211-2/+2
| | | | Use style(9) for bit
* kristaps 97df28257f3cc5faae8072fbadbc334a57a4e8a7benno2019-02-211-18/+38
| | | | | Remove another potential deadlock when in sender mode with multiplexing enabled.
* kristaps b1c688cad9f544a59b871c9984888cb1a3ae11e4benno2019-02-211-6/+7
| | | | Avoid crash when -n is specified.
* kristaps acb8f263717f27691f0318d4b7154f854b7206b3benno2019-02-212-16/+13
| | | | | | | As found by benno@, if --numeric-ids is passed in, rsync does not send or receive the uid/gid lists at all. This also means that we need not process the lists, as we're simply going to copy around the same value.
* implement --numeric-ids, tweaked by kristapsbenno2019-02-214-13/+22
|
* new attempt to sync with kristaps up to Sun Feb 17 2019benno2019-02-1812-350/+431
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 339cf5998c0c022623cd68de50722b6c14543952 Push "error trail" further into code. baf58ce5fe1bc6ce431b3b0ac8264b83ae8c7d02 Document all arguments. Add common -av usage. Remove bits about not supporting anything but files/dirs. 821a811a8c80e52fb56b241fc65a16cae1b4fb2c Disambiguate as prodded by deraadt@ 6c4475b8f226e9031ec0ec1b3f14f7d347132c87 Add -h to usage string 4d344ae6156873b44c95de0c1ed629e637c2d7ab Clarify error message language, use service name instead of port, specify that the socket is SOCK_STREAM. From deraadt@. Tweaked for lowercase messages. f3ec049e76257fc96bcdc872f1d3b967b98f3eb6 In consideration to benno@'s comments, let the mktemp functions propogate an errno handled by the caller. Also keep the original line lengths. While in mktemp.c, make some defines into an enum. e116c2bd00e634b56e4276120135915ceaa31cf2 Put the FSM of the sender into its own function. Put dry_run ack and end of phase ack into the send buffer too, further reducing the possibility of deadlock. c7745aa4c7394ca89d841f8ee76782256d694340 Make the sender write loop be fully non-blocking. This frees us of deadlocking the protocol because the sender will always be able to pull down data. 93c7b4843e80aeac2ec6ae6ffc395df4deaf4a31 Remove "yoda" notation to be more in tune with OpenBSD. Most found by deraadt@.
* revert previousbenno2019-02-1816-509/+414
|
* sync with kristaps up to Sun Feb 17 2019benno2019-02-1817-417/+512
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 339cf5998c0c022623cd68de50722b6c14543952 Push "error trail" further into code. baf58ce5fe1bc6ce431b3b0ac8264b83ae8c7d02 Document all arguments. Add common -av usage. Remove bits about not supporting anything but files/dirs. 821a811a8c80e52fb56b241fc65a16cae1b4fb2c Disambiguate as prodded by deraadt@ 6c4475b8f226e9031ec0ec1b3f14f7d347132c87 Add -h to usage string 4d344ae6156873b44c95de0c1ed629e637c2d7ab Clarify error message language, use service name instead of port, specify that the socket is SOCK_STREAM. From deraadt@. Tweaked for lowercase messages. f3ec049e76257fc96bcdc872f1d3b967b98f3eb6 In consideration to benno@'s comments, let the mktemp functions propogate an errno handled by the caller. Also keep the original line lengths. While in mktemp.c, make some defines into an enum. e116c2bd00e634b56e4276120135915ceaa31cf2 Put the FSM of the sender into its own function. Put dry_run ack and end of phase ack into the send buffer too, further reducing the possibility of deadlock. c7745aa4c7394ca89d841f8ee76782256d694340 Make the sender write loop be fully non-blocking. This frees us of deadlocking the protocol because the sender will always be able to pull down data. 93c7b4843e80aeac2ec6ae6ffc395df4deaf4a31 Remove "yoda" notation to be more in tune with OpenBSD. Most found by deraadt@.
* delete bogus commentderaadt2019-02-171-2/+1
|
* Add support for --port=PORT and ":port" in the rsync:// URL.deraadt2019-02-174-10/+27
| | | | | real rsync only supports numbers, but this supports service names also ok florian benno
* rsync has a large number of failure exit codes, so don't get used to thisderaadt2019-02-172-36/+36
| | | | | weak sauce EXIT_SUCCESS / EXIT_FAILURE model (in our tree very few programs use this failed concept, almost as bad as sysexits.h)