summaryrefslogtreecommitdiff
path: root/clientserver.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-05-15 09:26:01 +0000
committerAndrew Tridgell <tridge@samba.org>1998-05-15 09:26:01 +0000
commite42c9458c2f1e3a78d6d45e99741d6edb38fc0cc (patch)
tree4ebc43570cdd5f3fe11dd189aaf3cbb3b4968be2 /clientserver.c
parent087bf010d2cd89848181e49b4ecdfd29a66353e9 (diff)
downloadrsync-e42c9458c2f1e3a78d6d45e99741d6edb38fc0cc.tar.gz
use strlcat() strlcpy() and slprintf() whenever possible to avoid any
chance of a buffer overflow
Diffstat (limited to 'clientserver.c')
-rw-r--r--clientserver.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/clientserver.c b/clientserver.c
index b8c4da04..1c0bd7ec 100644
--- a/clientserver.c
+++ b/clientserver.c
@@ -30,7 +30,7 @@ int start_socket_client(char *host, char *path, int argc, char *argv[])
int fd, i;
char *sargs[MAX_ARGS];
int sargc=0;
- char line[1024];
+ char line[MAXPATHLEN];
char *p, *user=NULL;
extern int remote_version;
@@ -102,13 +102,12 @@ static int rsync_module(int fd, int i)
int argc=0;
char *argv[MAX_ARGS];
char **argp;
- char line[1024];
+ char line[MAXPATHLEN];
uid_t uid;
gid_t gid;
char *p;
char *addr = client_addr(fd);
char *host = client_name(fd);
- char *auth;
char *name = lp_name(i);
int start_glob=0;
@@ -201,17 +200,13 @@ static int rsync_module(int fd, int i)
p = line;
- if (start_glob && strncmp(p, name, strlen(name)) == 0) {
- p += strlen(name);
- if (!*p) p = ".";
- }
-
argv[argc] = strdup(p);
if (!argv[argc]) {
return -1;
}
if (start_glob) {
+ rprintf(FINFO,"transferring %s\n",p);
glob_expand(name, argv, &argc, MAX_ARGS);
} else {
argc++;
@@ -331,6 +326,8 @@ int daemon_main(void)
become_daemon();
+ rprintf(FINFO,"rsyncd version %s starting\n",VERSION);
+
start_accept_loop(rsync_port, start_daemon);
return -1;
}