-
- p = lp_incoming_chmod(i);
- if (*p && !parse_chmod(p, &chmod_modes))
- rprintf(FLOG, "Invalid \"incoming chmod\" directive: %s\n", p);
+ /* If we have some incoming/outgoing chmod changes, append them to
+ * any user-specified changes (making our changes have priority).
+ * We also get a pointer to just our changes so that a receiver
+ * process can use them separately if --perms wasn't specified. */
+ if (am_sender)
+ p = lp_outgoing_chmod(i);
+ else
+ p = lp_incoming_chmod(i);
+ if (*p && !(daemon_chmod_modes = parse_chmod(p, &chmod_modes))) {
+ rprintf(FLOG, "Invalid \"%sing chmod\" directive: %s\n",
+ am_sender ? "outgo" : "incom", p);
+ }