+extern int kludge_around_eof;
+extern int daemon_over_rsh;
+extern int list_only;
+extern int sanitize_paths;
+extern int filesfrom_fd;
+extern int remote_protocol;
+extern int protocol_version;
+extern int io_timeout;
+extern int select_timeout;
+extern int orig_umask;
+extern int no_detach;
+extern int default_af_hint;
+extern char *bind_address;
+extern struct filter_list_struct server_filter_list;
+extern char *config_file;
+extern char *files_from;
+
+char *auth_user;
+int read_only = 0;
+int module_id = -1;
+
+/* Length of lp_path() string when in daemon mode & not chrooted, else 0. */
+unsigned int module_dirlen = 0;
+
+/**
+ * Run a client connected to an rsyncd. The alternative to this
+ * function for remote-shell connections is do_cmd().
+ *
+ * After negotiating which module to use and reading the server's
+ * motd, this hands over to client_run(). Telling the server the
+ * module will cause it to chroot/setuid/etc.
+ *
+ * Instead of doing a transfer, the client may at this stage instead
+ * get a listing of remote modules and exit.
+ *
+ * @return -1 for error in startup, or the result of client_run().
+ * Either way, it eventually gets passed to exit_cleanup().
+ **/