From matt at mattmccutchen.net Tue Mar 16 21:57:29 2010 From: matt at mattmccutchen.net (Matt McCutchen) Date: Wed, 17 Mar 2010 04:57:29 -0000 Subject: [Rsync-patches] [PATCH] In "ignoring unsafe symlink" messages, show only the file-list path. Message-ID: <1268801842.14725.10.camel@mattlaptop2.local> Rsync was showing the full destination path, which was confusing because nothing is created at that path and was especially bogus in combination with the source name of a solo file. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=506830 --- backup.c | 4 ++-- generator.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backup.c b/backup.c index 8512e00..f0fd544 100644 --- a/backup.c +++ b/backup.c @@ -254,8 +254,8 @@ int make_backup(const char *fname, BOOL prefer_rename) const char *sl = F_SYMLINK(file); if (safe_symlinks && unsafe_symlink(sl, fname)) { if (INFO_GTE(SYMSAFE, 1)) { - rprintf(FINFO, "ignoring unsafe symlink %s -> %s\n", - full_fname(buf), sl); + rprintf(FINFO, "not backing up unsafe symlink \"%s\" -> \"%s\"\n", + fname, sl); } ret = 2; } else { diff --git a/generator.c b/generator.c index e7c1ef7..bec5c17 100644 --- a/generator.c +++ b/generator.c @@ -1355,10 +1355,12 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, if (safe_symlinks && unsafe_symlink(sl, fname)) { if (INFO_GTE(NAME, 1)) { if (solo_file) + /* fname contains the destination path, but we + * want to report the source path. */ fname = f_name(file, NULL); rprintf(FINFO, - "ignoring unsafe symlink %s -> \"%s\"\n", - full_fname(fname), sl); + "ignoring unsafe symlink \"%s\" -> \"%s\"\n", + fname, sl); } return; } -- 1.7.0.rc2.19.g05776