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
b389939f
Commit
b389939f
authored
Nov 17, 1998
by
David Dykstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply sanitize_paths() to glob expansions when use chroot = no.
parent
af77cc6b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
clientserver.c
clientserver.c
+1
-1
util.c
util.c
+5
-5
No files found.
clientserver.c
View file @
b389939f
...
...
@@ -253,7 +253,7 @@ static int rsync_module(int fd, int i)
request
=
strdup
(
p
);
start_glob
++
;
}
glob_expand
(
name
,
argv
,
&
argc
,
MAX_ARGS
);
glob_expand
(
name
,
argv
,
&
argc
,
MAX_ARGS
,
!
use_chroot
);
}
else
{
argc
++
;
}
...
...
util.c
View file @
b389939f
...
...
@@ -400,7 +400,7 @@ int lock_range(int fd, int offset, int len)
}
static
void
glob_expand_one
(
char
*
s
,
char
**
argv
,
int
*
argc
,
int
maxargs
)
static
void
glob_expand_one
(
char
*
s
,
char
**
argv
,
int
*
argc
,
int
maxargs
,
int
sanitize_paths
)
{
#if !(defined(HAVE_GLOB) && defined(HAVE_GLOB_H))
if
(
!*
s
)
s
=
"."
;
...
...
@@ -413,7 +413,7 @@ static void glob_expand_one(char *s, char **argv, int *argc, int maxargs)
if
(
!*
s
)
s
=
"."
;
argv
[
*
argc
]
=
strdup
(
s
);
argv
[
*
argc
]
=
s
anitize_paths
?
sanitize_path
(
s
)
:
s
trdup
(
s
);
memset
(
&
globbuf
,
0
,
sizeof
(
globbuf
));
glob
(
argv
[
*
argc
],
0
,
NULL
,
&
globbuf
);
...
...
@@ -432,7 +432,7 @@ static void glob_expand_one(char *s, char **argv, int *argc, int maxargs)
#endif
}
void
glob_expand
(
char
*
base1
,
char
**
argv
,
int
*
argc
,
int
maxargs
)
void
glob_expand
(
char
*
base1
,
char
**
argv
,
int
*
argc
,
int
maxargs
,
int
sanitize_paths
)
{
char
*
s
=
argv
[
*
argc
];
char
*
p
,
*
q
;
...
...
@@ -456,11 +456,11 @@ void glob_expand(char *base1, char **argv, int *argc, int maxargs)
while
((
p
=
strstr
(
q
,
base
))
&&
((
*
argc
)
<
maxargs
))
{
/* split it at this point */
*
p
=
0
;
glob_expand_one
(
q
,
argv
,
argc
,
maxargs
);
glob_expand_one
(
q
,
argv
,
argc
,
maxargs
,
sanitize_paths
);
q
=
p
+
strlen
(
base
);
}
if
(
*
q
&&
(
*
argc
<
maxargs
))
glob_expand_one
(
q
,
argv
,
argc
,
maxargs
);
if
(
*
q
&&
(
*
argc
<
maxargs
))
glob_expand_one
(
q
,
argv
,
argc
,
maxargs
,
sanitize_paths
);
free
(
s
);
free
(
base
);
...
...
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