--- clientserver.c~	2022-09-07 00:46:45.217695027 +0000
+++ clientserver.c	2022-09-07 00:46:48.931684755 +0000
@@ -974,8 +974,14 @@ static int rsync_module(int f_in, int f_
 	if (!change_dir(module_chdir, CD_NORMAL))
 		return path_failure(f_out, module_chdir, True);
 	if (module_dirlen || (!use_chroot && !*lp_daemon_chroot()))
-		sanitize_paths = 1;
-
+		/*
+		 * If module_dir is /, it is not possible to "escape"
+		 * the module, and path sanitization can only break
+		 * stuff.
+		 */
+		if (strcmp(module_dir, "/"))
+			sanitize_paths = 1;
+			
 	if ((munge_symlinks = lp_munge_symlinks(module_id)) < 0)
 		munge_symlinks = !use_chroot || module_dirlen;
 	if (munge_symlinks) {
