+
+ ret = start_inband_exchange(user, path, fd, fd, argc);
+
+ return ret < 0? ret : client_run(fd, fd, -1, argc, argv);
+}
+
+int start_inband_exchange(char *user, char *path, int f_in, int f_out, int argc)
+{
+ int i;
+ char *sargs[MAX_ARGS];
+ int sargc = 0;
+ char line[MAXPATHLEN];
+ char *p;
+ extern int kludge_around_eof;
+ extern int am_sender;
+ extern int daemon_over_rsh;
+ extern int list_only;
+
+ if (argc == 0 && !am_sender)
+ list_only = 1;
+
+ if (*path == '/') {
+ rprintf(FERROR, "ERROR: The remote path must start with a module name\n");
+ return -1;
+ }
+
+ if (!user) user = getenv("USER");
+ if (!user) user = getenv("LOGNAME");
+
+ /* set daemon_over_rsh to false since we need to build the
+ * true set of args passed through the rsh/ssh connection;
+ * this is a no-op for direct-socket-connection mode */
+ daemon_over_rsh = 0;
+ server_options(sargs, &sargc);