extern int read_only;
extern int verbose;
extern int rsync_port;
+char *auth_user;
int start_socket_client(char *host, char *path, int argc, char *argv[])
{
char *addr = client_addr(fd);
char *host = client_name(fd);
char *name = lp_name(i);
- char *user;
int use_chroot = lp_use_chroot(i);
int start_glob=0;
int ret;
}
- user = auth_server(fd, i, addr, "@RSYNCD: AUTHREQD ");
+ auth_user = auth_server(fd, i, addr, "@RSYNCD: AUTHREQD ");
- if (!user) {
+ if (!auth_user) {
rprintf(FERROR,"auth failed on module %s from %s (%s)\n",
name, client_name(fd), client_addr(fd));
io_printf(fd,"@ERROR: auth failed on module %s\n",name);
ret = parse_arguments(argc, argv);
if (request) {
- if (*user) {
+ if (*auth_user) {
rprintf(FINFO,"rsync %s %s from %s@%s (%s)\n",
am_sender?"on":"to",
- request, user, host, addr);
+ request, auth_user, host, addr);
} else {
rprintf(FINFO,"rsync %s %s from %s (%s)\n",
am_sender?"on":"to",
static void log_formatted(char *op, struct file_struct *file)
{
extern int module_id;
+ extern char *auth_user;
char buf[1024];
char *p, *s, *n;
char buf2[100];
break;
case 'o': n = op; break;
case 'f': n = f_name(file); break;
+ case 'm': n = lp_name(module_id); break;
+ case 'P': n = lp_path(module_id); break;
+ case 'u': n = auth_user; break;
}
if (!n) continue;
it() %p for the process id of this rsync session
it() %o for the operation, which is either "send" or "recv"
it() %f for the filename
+ it() %P for the module path
+ it() %m for the module name
+ it() %u for the authenticated username (or the null string)
)
The default log format is "%o %h [%a] %f %l"