summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2020-07-27 14:42:21 -0700
committerWayne Davison <wayne@opencoder.net>2020-07-27 14:49:51 -0700
commite1e546d67e72a83d6e6b6d9ed54f2a4d7e1a6d27 (patch)
treeb9145d3015cca333545a17ddd831e93ef5bcf98a
parent3714084f4806e6d23fccea1b88e8e4821a1d39d7 (diff)
downloadrsync-e1e546d67e72a83d6e6b6d9ed54f2a4d7e1a6d27.tar.gz
Don't allow a completely empty source arg.
-rw-r--r--NEWS.md3
-rw-r--r--main.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/NEWS.md b/NEWS.md
index 66b88758..0e762c62 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -26,6 +26,9 @@
- Rsync now complains about a missing `--temp-dir` before starting any file
transfers.
+ - A completely empty source arg is now a fatal error. This doesn't change
+ the handling of implied dot-dir args such as "localhost:" and such.
+
### ENHANCEMENTS:
- Allow `--max-alloc=0` to specify no limit to the alloc sanity check.
diff --git a/main.c b/main.c
index bfb69797..46b97b58 100644
--- a/main.c
+++ b/main.c
@@ -1482,8 +1482,15 @@ static int start_client(int argc, char *argv[])
char *dummy_host;
int dummy_port = rsync_port;
int i;
+ if (!argv[0][0])
+ goto invalid_empty;
/* For local source, extra source args must not have hostspec. */
for (i = 1; i < argc; i++) {
+ if (!argv[i][0]) {
+ invalid_empty:
+ rprintf(FERROR, "Empty source arg specified.\n");
+ exit_cleanup(RERR_SYNTAX);
+ }
if (check_for_hostspec(argv[i], &dummy_host, &dummy_port)) {
rprintf(FERROR, "Unexpected remote arg: %s\n", argv[i]);
exit_cleanup(RERR_SYNTAX);