summaryrefslogtreecommitdiffstats
path: root/usr.bin/rsync/main.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add option to suppress the Message of the Dayjob2021-03-311-3/+8
| | | | Fine deraadt@
* Compare explicitly against NULL.claudio2021-03-221-2/+2
| | | | From kristaps@
* Initialize the poll_timeout before rsync_server() is called.claudio2020-12-151-7/+7
| | | | | Without this the server will immediatly fail because the poll timeout is 0. Found and reported by Daniel Moch (daniel at danielmoch dot com)
* Simple implementation of --timeout to exit after specified seconds of I/Oclaudio2020-11-241-3/+17
| | | | | | 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@
* Simplify and unify wording for the -I sourceaddr option in various places.deraadt2020-02-111-2/+2
| | | | | | This is somewhat related to the "-b bind_addr" option some programs have, which should get some cleanup also... input florian claudio jmc
* Add --address argument to openrsync to bind to the specified addressclaudio2019-08-091-4/+8
| | | | | when connecting to a rsync daemon. OK deraadt@ benno@ naddy@ sthen@
* Don't close the socket in rsync_socket() itself but after calling it.naddy2019-06-031-10/+5
| | | | | | Fixes a corner case where the socket was closed twice, reported by Hiltjo Posthuma. ok deraadt@
* unintialized fd passed to close(), found by hiltjo posthumaderaadt2019-05-281-2/+2
|
* remove sess argument from log functions. ok deraadt@benno2019-05-081-8/+10
|
* Add support for not crossing filesystem boundaries (-x) to rsync. Optionbket2019-04-041-3/+6
| | | | | | | | | and behaviour is the same as GPL rsync. Initial diff received feedback from benno@, schwarze@, deraadt@ and florian@. Thanks! OK deraadt@
* many improvements to rsync(1) documentation:schwarze2019-04-011-3/+4
| | | | tweaks and OK deraadt@ naddy@
* Drop --devices and --specials from the synopsis because they are onlyschwarze2019-03-311-5/+4
| | | | | | | 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@
* Add ability to combine rsync:// and -e by splitting rsync_socket()naddy2019-03-311-7/+13
| | | | | | | | | | | 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-301-6/+4
| | | | | | | 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-301-2/+2
|
* 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@
* -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
* indents and reflows around ERR*() and LOG*(); ok bennoderaadt2019-03-231-21/+17
|
* repair exit codes, slightly broken after last commit (please do not goderaadt2019-03-231-5/+15
| | | | | | to an enum, that's just alien). Documents the return values in each function and unifies the protocol incompatibility error message. from kristaps
* flesh out SYNOPSIS and usage() somewhat;jmc2019-03-181-3/+6
| | | | ok deraadt benno
* Simplify startup code, various phases are heading straight towards exitderaadt2019-03-061-61/+41
| | | | | so they don't need to be constructed to return errors. ok benno florian
* implement --numeric-ids, tweaked by kristapsbenno2019-02-211-1/+2
|
* new attempt to sync with kristaps up to Sun Feb 17 2019benno2019-02-181-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-181-55/+45
|
* sync with kristaps up to Sun Feb 17 2019benno2019-02-181-45/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-171-4/+18
| | | | | 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-171-31/+31
| | | | | weak sauce EXIT_SUCCESS / EXIT_FAILURE model (in our tree very few programs use this failed concept, almost as bad as sysexits.h)
* percolate exit code from deeper code, so that values other than 1 arederaadt2019-02-171-10/+9
| | | | | possible on failure. looked at by florian
* nasty ugly invisible spacesderaadt2019-02-161-2/+2
|
* --archive is same as -aderaadt2019-02-161-1/+2
|
* add --help optionderaadt2019-02-161-4/+6
|
* add missing -no-OPT long optionsderaadt2019-02-161-9/+18
| | | | ok florian
* implement -D and in turn -aflorian2019-02-161-9/+27
| | | | "you snooze, you get collisions" deraadt@
* Add chown pledge so that root can gift files to other uids.florian2019-02-161-7/+7
| | | | "you snooze, you get collisions" deraadt@
* a minimal --version long-option, so someone can unconfuse themselvesderaadt2019-02-161-1/+6
|
* sync with kristaps, commit 438c1948c76a1ecd94e53e09ba88ec7e93004540florian2019-02-141-2/+2
| | | | Put back stray -o passed into child and add missing pledge.
* sync with kristaps, commit 71065b31649480ceb1ee6942232d673bf8ab70c8florian2019-02-141-3/+2
| | | | Enable -o.
* sync with kristaps, commit ab90d923f89b06308190d9fe371c7663c077e2bdflorian2019-02-141-2/+3
| | | | -o isn't finished yet...
* sync with kristaps, commit c5350b9055c3921001778275bb808a5c811c21c1florian2019-02-141-3/+6
| | | | | | | Protocol-level support for -o. The actual sharing itself is more or less a copy of the existing -g code. I've refactored a lot of the ids.c code to be generic and only accept a "isgid", as the rest is the same. So there's some churn as I make all references to "group" be generic.
* long option -group is same as -g; ok bennoderaadt2019-02-121-1/+2
|
* whitespace and knfbenno2019-02-121-3/+4
|
* sync, this also adds the -g option to the option parser.benno2019-02-121-8/+11
| | | | | | | | commit c7818bfb17195fcd7b723889bb8652b9ea024b01 Author: kristaps <> Date: Mon Feb 11 23:26:55 2019 +0000 Add getpw pledge for -g work.
* complete support for -e and -rsh=name optionsderaadt2019-02-121-2/+4
| | | | ok florian benno
* add long-opts aliases for single-letter options already presentderaadt2019-02-121-6/+12
| | | | ok florian benno
* premature bit snuck inderaadt2019-02-111-2/+1
|
* swap comparison arguments as needed, to match idiomatic C most of usderaadt2019-02-111-61/+57
| | | | are familiar with. Proofed by florian and benno
* flags variable not neededderaadt2019-02-111-5/+3
|
* cleanup weird spaces around !. (We normalize source-code to a standardderaadt2019-02-111-7/+7
| | | | | | idiom because it is less error prone for a larger team. kristaps idiom is highly divergent) ok benno