diff --git a/clientserver.c b/clientserver.c
--- a/clientserver.c
+++ b/clientserver.c
-@@ -64,6 +64,7 @@ char *auth_user;
+@@ -67,6 +67,7 @@ char *auth_user;
int read_only = 0;
int module_id = -1;
int munge_symlinks = 0;
struct chmod_mode_struct *daemon_chmod_modes;
/* module_dirlen is the length of the module_dir string when in daemon
-@@ -73,6 +74,7 @@ char *module_dir = NULL;
- unsigned int module_dirlen = 0;
+@@ -78,6 +79,7 @@ unsigned int module_dirlen = 0;
+ char *full_module_path;
static int rl_nulls = 0;
+static int namecvt_fd_req = -1, namecvt_fd_ans = -1;
#ifdef HAVE_SIGACTION
static struct sigaction sigact;
-@@ -535,7 +537,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -565,7 +567,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
log_init(1);
#ifdef HAVE_PUTENV
char *modname, *modpath, *hostaddr, *hostname, *username;
int status;
-@@ -631,6 +633,44 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -654,6 +656,44 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
set_blocking(fds[1]);
pre_exec_fd = fds[1];
}
umask(0);
}
#endif
-@@ -844,6 +884,44 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
+@@ -877,6 +917,44 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
return 0;
}
diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo
--- a/rsyncd.conf.yo
+++ b/rsyncd.conf.yo
-@@ -160,10 +160,11 @@ if the module is not read-only).
+@@ -159,10 +159,11 @@ if the module is not read-only).
- When this option is enabled, rsync will not attempt to map users and groups
+ When this parameter is enabled, rsync will not attempt to map users and groups
by name (by default), but instead copy IDs as though bf(--numeric-ids) had
-been specified. In order to enable name-mapping, rsync needs to be able to
+been specified. In order to enable name-mapping, rsync needs either the
/etc/group, but perhaps additional dynamic libraries as well).
@@ -227,6 +228,27 @@ path elements that rsync believes will allow a symlink to escape the module's
hierarchy. There are tricky ways to work around this, though, so you had
- better trust your users if you choose this combination of options.
+ better trust your users if you choose this combination of parameters.
-+dit(bf(name converter)) The "name converter" option lets you specify a
++dit(bf(name converter)) This parameter lets you specify a
+program that will be run by the rsync daemon (prior to bf(use chroot), if
-+that option is enabled) to convert user/group names into numbers or visa
++that parameter is enabled) to convert user/group names into numbers or visa
+versa. There is a sample perl script in the support directory named
+"nameconvert" that you can use to enable the use of the normal passwd/group
+lookup calls in a chroot daemon (which does not require any extra files
new file mode 100755
--- /dev/null
+++ b/support/nameconvert
-@@ -0,0 +1,42 @@
-+#!/usr/bin/perl -w
+@@ -0,0 +1,43 @@
++#!/usr/bin/perl
+# This implements a simple protocol to do {user,group}-{name,id}
+# conversions. All input and output consists of simple strings
+# with a terminating null char (or newline for debugging). If
+# "name converter" setting.
+
+use strict;
++use warnings;
+
+my $eol = grep(/^--debug$/, @ARGV) ? "\n" : "\0";
+$/ = $eol;
diff --git a/t_stub.c b/t_stub.c
--- a/t_stub.c
+++ b/t_stub.c
-@@ -29,6 +29,7 @@ int module_dirlen = 0;
+@@ -30,6 +30,7 @@ int preserve_xattrs = 0;
mode_t orig_umask = 002;
char *partial_dir;
char *module_dir;
+pid_t namecvt_pid;
- struct filter_list_struct server_filter_list;
+ struct filter_list_struct daemon_filter_list;
void rprintf(UNUSED(enum logcode code), const char *format, ...)
-@@ -69,6 +70,11 @@ struct filter_list_struct server_filter_list;
+@@ -75,6 +76,11 @@ struct filter_list_struct daemon_filter_list;
return -1;
}
diff --git a/util.c b/util.c
--- a/util.c
+++ b/util.c
-@@ -30,9 +30,10 @@ extern int modify_window;
- extern int relative_paths;
+@@ -31,9 +31,10 @@ extern int relative_paths;
extern int human_readable;
+ extern int preserve_xattrs;
extern char *module_dir;
-extern unsigned int module_dirlen;
extern mode_t orig_umask;
extern char *partial_dir;
+extern pid_t namecvt_pid;
+extern unsigned int module_dirlen;
- extern struct filter_list_struct server_filter_list;
+ extern struct filter_list_struct daemon_filter_list;
int sanitize_paths = 0;
-@@ -468,24 +469,44 @@ void kill_all(int sig)
+@@ -497,24 +498,44 @@ void kill_all(int sig)
/** Turn a user name into a uid */
int name_to_uid(const char *name, uid_t *uid_p)
{