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
0199b05f
Commit
0199b05f
authored
Jul 23, 1998
by
Andrew Tridgell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed the relative paths bug pointed out by Alberto Accomazzi
parent
e2d1033d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
9 deletions
+38
-9
clientserver.c
clientserver.c
+2
-0
flist.c
flist.c
+36
-9
No files found.
clientserver.c
View file @
0199b05f
...
...
@@ -267,8 +267,10 @@ static int rsync_module(int fd, int i)
free
(
request
);
}
#if !TRIDGE
/* don't allow the logs to be flooded too fast */
if
(
verbose
>
1
)
verbose
=
1
;
#endif
argc
-=
optind
;
argp
=
argv
+
optind
;
...
...
flist.c
View file @
0199b05f
...
...
@@ -49,6 +49,8 @@ extern int io_error;
static
struct
exclude_struct
**
local_exclude_list
;
static
void
clean_flist
(
struct
file_list
*
flist
,
int
strip_root
);
int
link_stat
(
const
char
*
Path
,
STRUCT_STAT
*
Buffer
)
{
#if SUPPORT_LINKS
...
...
@@ -225,12 +227,6 @@ static void receive_file_entry(struct file_struct **fptr,
clean_fname
(
thisname
);
if
(
relative_paths
&&
thisname
[
0
]
==
'/'
)
{
/* strip / off absolute paths in destination */
memmove
(
thisname
,
thisname
+
1
,
strlen
(
thisname
));
if
(
!
thisname
[
0
])
strcpy
(
thisname
,
"."
);
}
if
((
p
=
strrchr
(
thisname
,
'/'
)))
{
static
char
*
lastdir
;
*
p
=
0
;
...
...
@@ -647,7 +643,7 @@ struct file_list *send_file_list(int f,int argc,char *argv[])
if
(
verbose
&&
recurse
&&
!
am_server
&&
f
!=
-
1
)
rprintf
(
FINFO
,
"done
\n
"
);
clean_flist
(
flist
);
clean_flist
(
flist
,
0
);
/* now send the uid/gid list. This was introduced in protocol
version 15 */
...
...
@@ -728,7 +724,7 @@ struct file_list *recv_file_list(int f)
if
(
verbose
>
2
)
rprintf
(
FINFO
,
"received %d names
\n
"
,
flist
->
count
);
clean_flist
(
flist
);
clean_flist
(
flist
,
relative_paths
);
if
(
verbose
&&
recurse
&&
!
am_server
)
{
rprintf
(
FINFO
,
"done
\n
"
);
...
...
@@ -826,7 +822,7 @@ void flist_free(struct file_list *flist)
* This routine ensures we don't have any duplicate names in our file list.
* duplicate names can cause corruption because of the pipelining
*/
void
clean_flist
(
struct
file_list
*
flis
t
)
static
void
clean_flist
(
struct
file_list
*
flist
,
int
strip_roo
t
)
{
int
i
;
...
...
@@ -848,6 +844,37 @@ void clean_flist(struct file_list *flist)
free_file
(
flist
->
files
[
i
]);
}
}
if
(
strip_root
)
{
/* we need to strip off the root directory in the case
of relative paths, but this must be done _after_
the sorting phase */
for
(
i
=
0
;
i
<
flist
->
count
;
i
++
)
{
if
(
flist
->
files
[
i
]
->
dirname
&&
flist
->
files
[
i
]
->
dirname
[
0
]
==
'/'
)
{
memmove
(
&
flist
->
files
[
i
]
->
dirname
[
0
],
&
flist
->
files
[
i
]
->
dirname
[
1
],
strlen
(
flist
->
files
[
i
]
->
dirname
));
}
if
(
flist
->
files
[
i
]
->
dirname
&&
!
flist
->
files
[
i
]
->
dirname
[
0
])
{
flist
->
files
[
i
]
->
dirname
=
NULL
;
}
}
}
if
(
verbose
<=
3
)
return
;
for
(
i
=
0
;
i
<
flist
->
count
;
i
++
)
{
rprintf
(
FINFO
,
"[%d] i=%d %s %s mode=0%o len=%d
\n
"
,
getpid
(),
i
,
flist
->
files
[
i
]
->
dirname
,
flist
->
files
[
i
]
->
basename
,
flist
->
files
[
i
]
->
mode
,
flist
->
files
[
i
]
->
length
);
}
}
...
...
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