Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move the initialization of push_dir, which calls getcwd, to early in main.
[rsync/rsync.git]
/
clientserver.c
diff --git
a/clientserver.c
b/clientserver.c
index
557eb5f
..
7b0dd16
100644
(file)
--- a/
clientserver.c
+++ b/
clientserver.c
@@
-212,7
+212,7
@@
static int rsync_module(int fd, int i)
return -1;
}
return -1;
}
- if (
chdir("/"
)) {
+ if (
!push_dir("/", 0
)) {
rprintf(FERROR,"chdir %s failed\n", lp_path(i));
io_printf(fd,"@ERROR: chdir failed\n");
return -1;
rprintf(FERROR,"chdir %s failed\n", lp_path(i));
io_printf(fd,"@ERROR: chdir failed\n");
return -1;
@@
-422,11
+422,6
@@
int daemon_main(void)
extern char *config_file;
char *pid_file;
extern char *config_file;
char *pid_file;
- /* this ensures that we don't call getcwd after the chroot,
- which doesn't work on platforms that use popen("pwd","r")
- for getcwd */
- push_dir("/", 0);
-
if (is_a_socket(STDIN_FILENO)) {
int i;
if (is_a_socket(STDIN_FILENO)) {
int i;