extern int sanitize_paths;
extern int munge_symlinks;
extern int need_unsorted_flist;
+extern int sender_symlink_iconv;
extern int unsort_ndx;
extern struct stats stats;
extern char *filesfrom_host;
if (iconvbufs(ic_recv, &inbuf, &outbuf, 0) < 0) {
io_error |= IOERR_GENERAL;
- rprintf(FERROR_XFER,
+ rprintf(FERROR_UTF8,
"[%s] cannot convert filename: %s (%s)\n",
who_am_i(), lastname, strerror(errno));
outbuf.len = 0;
}
#ifdef ICONV_OPTION
/* We don't know how much extra room we need to convert
- * the as-yet-unread symlink name when converting it,
- * so let's hope that a double-size buffer is plenty. */
- if (ic_recv != (iconv_t)-1)
- linkname_len = linkname_len * 2 + 1;
+ * the as-yet-unread symlink data, so let's hope that a
+ * double-size buffer is plenty. */
+ if (sender_symlink_iconv)
+ linkname_len *= 2;
#endif
if (munge_symlinks)
linkname_len += SYMLINK_PREFIX_LEN;
linkname_len -= SYMLINK_PREFIX_LEN;
}
#ifdef ICONV_OPTION
- if (ic_recv != (iconv_t)-1) {
+ if (sender_symlink_iconv) {
xbuf outbuf, inbuf;
alloc_len = linkname_len;
- linkname_len /= 2; /* (linkname_len-1) / 2 for odd values. */
+ linkname_len /= 2;
- /* Read the symlink name into the end of our double-sized
+ /* Read the symlink data into the end of our double-sized
* buffer and then convert it into the right spot. */
INIT_XBUF(inbuf, bp + alloc_len - linkname_len,
linkname_len - 1, (size_t)-1);
if (iconvbufs(ic_recv, &inbuf, &outbuf, 0) < 0) {
io_error |= IOERR_GENERAL;
rprintf(FERROR_XFER,
- "[%s] cannot convert symlink name for: %s (%s)\n",
+ "[%s] cannot convert symlink data for: %s (%s)\n",
who_am_i(), full_fname(thisname), strerror(errno));
bp = (char*)file->basename;
*bp++ = '\0';
}
} else {
io_error |= IOERR_GENERAL;
- rsyserr(FERROR_XFER, save_errno, "readlink %s failed",
+ rsyserr(FERROR_XFER, save_errno, "readlink_stat(%s) failed",
full_fname(thisname));
}
return NULL;
fbuf[outbuf.len] = '\0';
#ifdef SUPPORT_LINKS
- if (symlink_len) {
+ if (symlink_len && sender_symlink_iconv) {
INIT_XBUF(inbuf, (char*)symlink_name, symlink_len, (size_t)-1);
INIT_CONST_XBUF(outbuf, symlink_buf);
if (iconvbufs(ic_send, &inbuf, &outbuf, 0) < 0) {
io_error |= IOERR_GENERAL;
f_name(file, fbuf);
rprintf(FERROR_XFER,
- "[%s] cannot convert symlink name for: %s (%s)\n",
+ "[%s] cannot convert symlink data for: %s (%s)\n",
who_am_i(), full_fname(fbuf), strerror(errno));
return NULL;
}