Cast file->mode to an int when printing it via %o.
[rsync/rsync.git] / generator.c
index 1860b0d..d8863d7 100644 (file)
@@ -50,8 +50,6 @@ extern int delete_before;
 extern int delete_during;
 extern int delete_after;
 extern int module_id;
-extern int sanitize_paths;
-extern int startdir_depth;
 extern int ignore_errors;
 extern int remove_sent_files;
 extern int delay_updates;
@@ -742,7 +740,7 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
                } else {
                        rprintf(FERROR,
                                "internal: try_dests_non() called with invalid mode (%o)\n",
-                               file->mode);
+                               (int)file->mode);
                        exit_cleanup(RERR_UNSUPPORTED);
                }
                if (link_dest
@@ -753,7 +751,10 @@ static int try_dests_non(struct file_struct *file, char *fname, int ndx,
                 && !IS_SPECIAL(file->mode) && !IS_DEVICE(file->mode)
 #endif
                ) {
-                       if (do_link(fnamebuf, fname) < 0) {
+#ifdef SUPPORT_HARD_LINKS
+                       if (do_link(fnamebuf, fname) < 0) 
+#endif
+                       {
                                rsyserr(FERROR, errno,
                                        "failed to hard-link %s with %s",
                                        fnamebuf, fname);
@@ -859,7 +860,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                char *dn = file->dirname ? file->dirname : ".";
                if (parent_dirname != dn && strcmp(parent_dirname, dn) != 0) {
                        if (relative_paths && !implied_dirs
-                        && do_stat(dn, &st) < 0
+                        && safe_stat(dn, &st) < 0
                         && create_directory_path(fname) < 0) {
                                rsyserr(FERROR, errno,
                                        "recv_generator: mkdir %s failed",
@@ -955,10 +956,6 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx,
                        }
                        return;
                }
-               if (sanitize_paths) {
-                       sanitize_path(file->u.link, file->u.link, "",
-                                     startdir_depth + file->dir.depth - 1);
-               }
                if (statret == 0) {
                        char lnk[MAXPATHLEN];
                        int len;