Added "const" to appropriate char pointers.
[rsync/rsync.git] / clientserver.c
index 00c492b..d27ced3 100644 (file)
@@ -24,6 +24,7 @@
 
 extern int verbose;
 extern int quiet;
+extern int output_motd;
 extern int list_only;
 extern int am_sender;
 extern int am_server;
@@ -109,7 +110,7 @@ int start_socket_client(char *host, char *path, int argc, char *argv[])
        return ret ? ret : client_run(fd, fd, -1, argc, argv);
 }
 
-int start_inband_exchange(char *user, char *path, int f_in, int f_out,
+int start_inband_exchange(const char *user, char *path, int f_in, int f_out,
                          int argc)
 {
        int i;
@@ -205,7 +206,10 @@ int start_inband_exchange(char *user, char *path, int f_in, int f_out,
                        return -1;
                }
 
-               rprintf(FINFO, "%s\n", line);
+               /* This might be a MOTD line or a module listing, but there is
+                * no way to differentiate it.  The manpage mentions this. */
+               if (output_motd)
+                       rprintf(FINFO, "%s\n", line);
        }
        kluge_around_eof = 0;
 
@@ -336,7 +340,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
        if (am_root) {
                p = lp_uid(i);
                if (!name_to_uid(p, &uid)) {
-                       if (!isdigit(*(unsigned char *)p)) {
+                       if (!isDigit(p)) {
                                rprintf(FLOG, "Invalid uid %s\n", p);
                                io_printf(f_out, "@ERROR: invalid uid %s\n", p);
                                return -1;
@@ -346,7 +350,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
 
                p = lp_gid(i);
                if (!name_to_gid(p, &gid)) {
-                       if (!isdigit(*(unsigned char *)p)) {
+                       if (!isDigit(p)) {
                                rprintf(FLOG, "Invalid gid %s\n", p);
                                io_printf(f_out, "@ERROR: invalid gid %s\n", p);
                                return -1;
@@ -503,7 +507,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
                        return -1;
                }
 
-               if (!push_dir("/")) {
+               if (!push_dir("/", 0)) {
                        rsyserr(FLOG, errno, "chdir %s failed\n",
                                lp_path(i));
                        io_printf(f_out, "@ERROR: chdir failed\n");
@@ -511,7 +515,7 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host)
                }
 
        } else {
-               if (!push_dir(lp_path(i))) {
+               if (!push_dir(lp_path(i), 0)) {
                        rsyserr(FLOG, errno, "chdir %s failed\n",
                                lp_path(i));
                        io_printf(f_out, "@ERROR: chdir failed\n");