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
- Added some calls to die_on_unsafe_path() to the path-sanitizing code.
[rsync/rsync.git]
/
options.c
diff --git
a/options.c
b/options.c
index
e5f88f7
..
b6eae4e
100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-890,8
+890,10
@@
int parse_arguments(int *argc, const char ***argv, int frommain)
case OPT_EXCLUDE_FROM:
case OPT_INCLUDE_FROM:
arg = poptGetOptArg(pc);
case OPT_EXCLUDE_FROM:
case OPT_INCLUDE_FROM:
arg = poptGetOptArg(pc);
- if (sanitize_paths)
+ if (sanitize_paths)
{
arg = sanitize_path(NULL, arg, NULL, 0, NULL);
arg = sanitize_path(NULL, arg, NULL, 0, NULL);
+ die_on_unsafe_path((char*)arg, 0);
+ }
if (server_filter_list.head) {
char *cp = strdup(arg);
if (!cp)
if (server_filter_list.head) {
char *cp = strdup(arg);
if (!cp)
@@
-1209,12
+1211,14
@@
int parse_arguments(int *argc, const char ***argv, int frommain)
int i;
for (i = *argc; i-- > 0; )
(*argv)[i] = sanitize_path(NULL, (*argv)[i], "", 0, NULL);
int i;
for (i = *argc; i-- > 0; )
(*argv)[i] = sanitize_path(NULL, (*argv)[i], "", 0, NULL);
- if (tmpdir)
+ if (tmpdir)
{
tmpdir = sanitize_path(NULL, tmpdir, NULL, 0, NULL);
tmpdir = sanitize_path(NULL, tmpdir, NULL, 0, NULL);
- if (partial_dir)
- partial_dir = sanitize_path(NULL, partial_dir, NULL, 0, NULL);
- if (backup_dir)
+ die_on_unsafe_path(tmpdir, 0);
+ }
+ if (backup_dir)
{
backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, NULL);
backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, NULL);
+ die_on_unsafe_path(backup_dir, 0);
+ }
}
if (server_filter_list.head && !am_sender) {
struct filter_list_struct *elp = &server_filter_list;
}
if (server_filter_list.head && !am_sender) {
struct filter_list_struct *elp = &server_filter_list;
@@
-1225,11
+1229,6
@@
int parse_arguments(int *argc, const char ***argv, int frommain)
if (check_filter(elp, tmpdir, 1) < 0)
goto options_rejected;
}
if (check_filter(elp, tmpdir, 1) < 0)
goto options_rejected;
}
- if (partial_dir && *partial_dir) {
- clean_fname(partial_dir, 1);
- if (check_filter(elp, partial_dir, 1) < 0)
- goto options_rejected;
- }
if (backup_dir) {
if (!*backup_dir)
goto options_rejected;
if (backup_dir) {
if (!*backup_dir)
goto options_rejected;