aboutsummaryrefslogtreecommitdiffstats
path: root/clientserver.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2005-02-07 20:36:43 +0000
committerWayne Davison <wayned@samba.org>2005-02-07 20:36:43 +0000
commit4875d6b64dd0ed8d451746cc0cc609cff36192bd (patch)
treea67e793c04e5628b8bfbad50864d9b62aab936d8 /clientserver.c
parent54b405985632b71444f215bb547a2b6a7f0f3637 (diff)
downloadandroid_external_rsync-4875d6b64dd0ed8d451746cc0cc609cff36192bd.tar.gz
android_external_rsync-4875d6b64dd0ed8d451746cc0cc609cff36192bd.tar.bz2
android_external_rsync-4875d6b64dd0ed8d451746cc0cc609cff36192bd.zip
Adding more calls to safe_fname().
Diffstat (limited to 'clientserver.c')
-rw-r--r--clientserver.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/clientserver.c b/clientserver.c
index 19d54c61..4007bffe 100644
--- a/clientserver.c
+++ b/clientserver.c
@@ -258,9 +258,8 @@ static int rsync_module(int f_in, int f_out, int i)
if (!claim_connection(lp_lock_file(i), lp_max_connections(i))) {
if (errno) {
rsyserr(FLOG, errno, "failed to open lock file %s",
- lp_lock_file(i));
- io_printf(f_out, "@ERROR: failed to open lock file %s\n",
- lp_lock_file(i));
+ safe_fname(lp_lock_file(i)));
+ io_printf(f_out, "@ERROR: failed to open lock file\n");
} else {
rprintf(FLOG, "max connections (%d) reached\n",
lp_max_connections(i));
@@ -360,20 +359,23 @@ static int rsync_module(int f_in, int f_out, int i)
* in which case we fail.
*/
if (chroot(lp_path(i))) {
- rsyserr(FLOG, errno, "chroot %s failed", lp_path(i));
+ rsyserr(FLOG, errno, "chroot %s failed",
+ safe_fname(lp_path(i)));
io_printf(f_out, "@ERROR: chroot failed\n");
return -1;
}
if (!push_dir("/")) {
- rsyserr(FLOG, errno, "chdir %s failed\n", lp_path(i));
+ rsyserr(FLOG, errno, "chdir %s failed\n",
+ safe_fname(lp_path(i)));
io_printf(f_out, "@ERROR: chdir failed\n");
return -1;
}
} else {
if (!push_dir(lp_path(i))) {
- rsyserr(FLOG, errno, "chdir %s failed\n", lp_path(i));
+ rsyserr(FLOG, errno, "chdir %s failed\n",
+ safe_fname(lp_path(i)));
io_printf(f_out, "@ERROR: chdir failed\n");
return -1;
}
@@ -646,7 +648,8 @@ int daemon_main(void)
if ((fd = do_open(lp_pid_file(), O_WRONLY|O_CREAT|O_TRUNC,
0666 & ~orig_umask)) == -1) {
cleanup_set_pid(0);
- rsyserr(FLOG, errno, "failed to create pid file %s", pid_file);
+ rsyserr(FLOG, errno, "failed to create pid file %s",
+ safe_fname(pid_file));
exit_cleanup(RERR_FILEIO);
}
snprintf(pidbuf, sizeof pidbuf, "%ld\n", (long)pid);