=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rsync/main.c,v retrieving revision 1.34 retrieving revision 1.35 diff -c -r1.34 -r1.35 *** src/usr.bin/rsync/main.c 2019/03/23 00:20:55 1.34 --- src/usr.bin/rsync/main.c 2019/03/23 16:04:28 1.35 *************** *** 1,4 **** ! /* $Id: main.c,v 1.34 2019/03/23 00:20:55 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: main.c,v 1.35 2019/03/23 16:04:28 deraadt Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * *************** *** 111,118 **** if (fargs_is_remote(f->sources[0])) { if (f->host != NULL) ! errx(1, "both source and " ! "destination cannot be remote files"); f->mode = FARGS_RECEIVER; if ((f->host = strdup(f->sources[0])) == NULL) err(1, "strdup"); --- 111,117 ---- if (fargs_is_remote(f->sources[0])) { if (f->host != NULL) ! errx(1, "both source and destination cannot be remote files"); f->mode = FARGS_RECEIVER; if ((f->host = strdup(f->sources[0])) == NULL) err(1, "strdup"); *************** *** 125,132 **** len = strlen(f->host) - 8 + 1; memmove(f->host, f->host + 8, len); if ((cp = strchr(f->host, '/')) == NULL) ! errx(1, "rsync protocol requires a module " ! "name"); *cp++ = '\0'; f->module = cp; if ((cp = strchr(f->module, '/')) != NULL) --- 124,130 ---- len = strlen(f->host) - 8 + 1; memmove(f->host, f->host + 8, len); if ((cp = strchr(f->host, '/')) == NULL) ! errx(1, "rsync protocol requires a module name"); *cp++ = '\0'; f->module = cp; if ((cp = strchr(f->module, '/')) != NULL) *************** *** 163,171 **** for (i = 0; i < f->sourcesz; i++) { if (!fargs_is_remote(f->sources[i])) continue; ! errx(1, "remote file in " ! "list of local sources: %s", ! f->sources[i]); } if (f->mode == FARGS_RECEIVER) for (i = 0; i < f->sourcesz; i++) { --- 161,169 ---- for (i = 0; i < f->sourcesz; i++) { if (!fargs_is_remote(f->sources[i])) continue; ! errx(1, ! "remote file in list of local sources: %s", ! f->sources[i]); } if (f->mode == FARGS_RECEIVER) for (i = 0; i < f->sourcesz; i++) { *************** *** 173,185 **** !fargs_is_daemon(f->sources[i])) continue; if (fargs_is_daemon(f->sources[i])) ! errx(1, "remote " ! "daemon in list of " ! "remote sources: %s", ! f->sources[i]); ! errx(1, "local file in " ! "list of remote sources: %s", ! f->sources[i]); } } else { if (f->mode != FARGS_RECEIVER) --- 171,181 ---- !fargs_is_daemon(f->sources[i])) continue; if (fargs_is_daemon(f->sources[i])) ! errx(1, "remote daemon in list of " ! "remote sources: %s", ! f->sources[i]); ! errx(1, "local file in list of remote sources: %s", ! f->sources[i]); } } else { if (f->mode != FARGS_RECEIVER) *************** *** 234,241 **** *ccp = '\0'; if (strncmp(cp, f->host, len) || (cp[len] != '/' && cp[len] != '\0')) ! errx(1, "different remote " ! "host: %s", f->sources[i]); memmove(f->sources[i], f->sources[i] + len + 8 + 1, j - len - 8); --- 230,237 ---- *ccp = '\0'; if (strncmp(cp, f->host, len) || (cp[len] != '/' && cp[len] != '\0')) ! errx(1, "different remote host: %s", ! f->sources[i]); memmove(f->sources[i], f->sources[i] + len + 8 + 1, j - len - 8); *************** *** 247,254 **** /* host::path */ if (strncmp(cp, f->host, len) || (cp[len] != ':' && cp[len] != '\0')) ! errx(1, "different remote " ! "host: %s", f->sources[i]); memmove(f->sources[i], f->sources[i] + len + 2, j - len - 1); } else if (cp[0] == ':') { --- 243,250 ---- /* host::path */ if (strncmp(cp, f->host, len) || (cp[len] != ':' && cp[len] != '\0')) ! errx(1, "different remote host: %s", ! f->sources[i]); memmove(f->sources[i], f->sources[i] + len + 2, j - len - 1); } else if (cp[0] == ':') { *************** *** 258,265 **** /* host:path */ if (strncmp(cp, f->host, len) || (cp[len] != ':' && cp[len] != '\0')) ! errx(1, "different remote " ! "host: %s", f->sources[i]); memmove(f->sources[i], f->sources[i] + len + 1, j - len); } --- 254,261 ---- /* host:path */ if (strncmp(cp, f->host, len) || (cp[len] != ':' && cp[len] != '\0')) ! errx(1, "different remote host: %s", ! f->sources[i]); memmove(f->sources[i], f->sources[i] + len + 1, j - len); }