From: Wayne Davison Date: Wed, 4 Feb 2009 15:53:35 +0000 (-0800) Subject: Do not try to send a symlink with a 0-length value. X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/4dea1a9492f065d78562679e87f9a2e357a0f0aa Do not try to send a symlink with a 0-length value. This avoids a transfer error in the receiver. --- diff --git a/NEWS b/NEWS index b5ca26e0..70245eea 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,9 @@ Changes since 3.0.5: - Fixed the parsing of an [IPv6_LITERAL_ADDR] when a USER@ is prefixed. + - The sender now skips a (bogus) symlink that has a 0-length value, which + avoids a transfer error in the receiver. + - Fixed the rrsync script to avoid a server-side problem when -e is at the start of the short options. diff --git a/flist.c b/flist.c index ca9f8ffe..d296b36f 100644 --- a/flist.c +++ b/flist.c @@ -1342,6 +1342,14 @@ static struct file_struct *send_file_name(int f, struct file_list *flist, if (preserve_links && S_ISLNK(file->mode)) { symlink_name = F_SYMLINK(file); symlink_len = strlen(symlink_name); + if (symlink_len == 0) { + io_error |= IOERR_GENERAL; + f_name(file, fbuf); + rprintf(FERROR_XFER, + "skipping symlink with 0-length value: %s\n", + full_fname(fbuf)); + return NULL; + } } else { symlink_name = NULL; symlink_len = 0;