Fix the setting of module_dirlen for a module path of "/".
[rsync/rsync.git] / 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,