Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
b9232d45
Commit
b9232d45
authored
Mar 10, 2005
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed the reading of the fuzzy xname from the socket.
- Call read_item_attrs() with its new arg.
parent
6087ef2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
28 deletions
+13
-28
receiver.c
receiver.c
+13
-28
No files found.
receiver.c
View file @
b9232d45
...
...
@@ -303,25 +303,6 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
}
static
char
*
read_gen_name
(
int
fd
,
char
*
dirname
,
char
*
buf
)
{
int
dlen
;
if
(
dirname
)
{
dlen
=
strlcpy
(
buf
,
dirname
,
MAXPATHLEN
);
if
(
dlen
!=
1
||
*
buf
!=
'/'
)
buf
[
dlen
++
]
=
'/'
;
}
else
dlen
=
0
;
if
(
read_vstring
(
fd
,
buf
+
dlen
,
MAXPATHLEN
-
dlen
)
<
0
)
return
NULL
;
if
(
strchr
(
buf
+
dlen
,
'/'
)
!=
NULL
)
return
NULL
;
return
buf
;
}
static
void
discard_receive_data
(
int
f_in
,
OFF_T
length
)
{
receive_data
(
f_in
,
NULL
,
-
1
,
0
,
NULL
,
-
1
,
length
);
...
...
@@ -337,9 +318,9 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
int
next_gen_i
=
-
1
;
int
fd1
,
fd2
;
STRUCT_STAT
st
;
int
iflags
;
int
iflags
,
xlen
;
char
*
fname
,
fbuf
[
MAXPATHLEN
];
char
templat
e
[
MAXPATHLEN
];
char
xnam
e
[
MAXPATHLEN
];
char
fnametmp
[
MAXPATHLEN
];
char
*
fnamecmp
,
*
partialptr
,
numbuf
[
4
];
char
fnamecmpbuf
[
MAXPATHLEN
];
...
...
@@ -386,7 +367,8 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
continue
;
}
iflags
=
read_item_attrs
(
f_in
,
-
1
,
i
,
fnametmp
,
&
fnamecmp_type
);
iflags
=
read_item_attrs
(
f_in
,
-
1
,
i
,
&
fnamecmp_type
,
xname
,
&
xlen
);
if
(
iflags
==
ITEM_IS_NEW
)
/* no-op packet */
continue
;
...
...
@@ -397,7 +379,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
rprintf
(
FINFO
,
"recv_files(%s)
\n
"
,
safe_fname
(
fname
));
if
(
!
(
iflags
&
ITEM_TRANSFER
))
{
maybe_log_item
(
file
,
iflags
,
itemizing
,
fnametmp
);
maybe_log_item
(
file
,
iflags
,
itemizing
,
xname
);
continue
;
}
...
...
@@ -447,8 +429,12 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
fnamecmp
=
get_backup_name
(
fname
);
break
;
case
FNAMECMP_FUZZY
:
fnamecmp
=
read_gen_name
(
f_in
,
file
->
dirname
,
fnamecmpbuf
);
if
(
file
->
dirname
)
{
pathjoin
(
fnamecmpbuf
,
MAXPATHLEN
,
file
->
dirname
,
xname
);
fnamecmp
=
fnamecmpbuf
;
}
else
fnamecmp
=
xname
;
break
;
default:
if
(
fnamecmp_type
>=
basis_dir_cnt
)
{
...
...
@@ -549,8 +535,6 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
continue
;
}
strlcpy
(
template
,
fnametmp
,
sizeof
template
);
/* we initially set the perms without the
* setuid/setgid bits to ensure that there is no race
* condition. They are then correctly updated after
...
...
@@ -564,7 +548,8 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
* transferred, but that may not be the case with -R */
if
(
fd2
==
-
1
&&
relative_paths
&&
errno
==
ENOENT
&&
create_directory_path
(
fnametmp
,
orig_umask
)
==
0
)
{
strlcpy
(
fnametmp
,
template
,
sizeof
fnametmp
);
/* Get back to name with XXXXXX in it. */
get_tmpname
(
fnametmp
,
fname
);
fd2
=
do_mkstemp
(
fnametmp
,
file
->
mode
&
INITACCESSPERMS
);
}
if
(
fd2
==
-
1
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment