+ if (!flist) /* lastdir isn't valid if flist is NULL */
+ lastdir_len = -1;
+
+ if (strlcpy(thisname, fname, sizeof thisname)
+ >= sizeof thisname - flist_dir_len) {
+ rprintf(FINFO, "skipping overly long name: %s\n", fname);
+ return NULL;
+ }
+ clean_fname(thisname);
+ if (sanitize_paths)
+ sanitize_path(thisname, NULL);
+
+ memset(sum, 0, SUM_LENGTH);
+
+ if (readlink_stat(thisname, &st, linkname) != 0) {
+ int save_errno = errno;
+ if (errno == ENOENT) {
+ enum logcode c = am_daemon && protocol_version < 28
+ ? FERROR : FINFO;
+ /* either symlink pointing nowhere or file that
+ * was removed during rsync run; see if excluded
+ * before reporting an error */
+ if (exclude_level != NO_EXCLUDES
+ && check_exclude_file(thisname, 0, exclude_level)) {
+ /* file is excluded anyway, ignore silently */
+ return NULL;
+ }
+ io_error |= IOERR_VANISHED;
+ rprintf(c, "file has vanished: %s\n",
+ full_fname(thisname));
+ }
+ else {
+ io_error |= IOERR_GENERAL;
+ rprintf(FERROR, "readlink %s failed: %s\n",
+ full_fname(thisname), strerror(save_errno));
+ }
+ return NULL;
+ }