Fix the setting of module_dirlen for a module path of "/".
authorWayne Davison <wayned@samba.org>
Fri, 1 Apr 2005 00:18:40 +0000 (00:18 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 1 Apr 2005 00:18:40 +0000 (00:18 +0000)
This fixes a crash in the exclude code when chroot is off.

clientserver.c

index 47ed5e7..d354ef7 100644 (file)
@@ -321,13 +321,11 @@ static int rsync_module(int f_in, int f_out, int i)
        /* TODO: Perhaps take a list of gids, and make them into the
         * supplementary groups. */
 
-       if (use_chroot) {
+       if (use_chroot || (module_dirlen = strlen(lp_path(i))) == 1) {
                module_dirlen = 0;
                set_filter_dir("/", 1);
-       } else {
-               module_dirlen = strlen(lp_path(i));
+       } else
                set_filter_dir(lp_path(i), module_dirlen);
-       }
 
        p = lp_filter(i);
        parse_rule(&server_filter_list, p, MATCHFLG_WORD_SPLIT,