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
Call the new die_on_unsafe_path() function in a few places.
[rsync/rsync.git]
/
options.c
diff --git
a/options.c
b/options.c
index
ee7b522
..
14071c8
100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-891,14
+891,17
@@
int parse_arguments(int *argc, const char ***argv, int frommain)
case OPT_INCLUDE_FROM:
arg = poptGetOptArg(pc);
if (sanitize_paths)
case OPT_INCLUDE_FROM:
arg = poptGetOptArg(pc);
if (sanitize_paths)
- arg = sanitize_path(NULL, arg, NULL, 0);
+ arg = sanitize_path(NULL, arg, NULL, 0
, NULL
);
if (server_filter_list.head) {
if (server_filter_list.head) {
- char *cp = (char *)arg;
+ char *cp = strdup(arg);
+ if (!cp)
+ out_of_memory("parse_arguments");
if (!*cp)
goto options_rejected;
clean_fname(cp, 1);
if (check_filter(&server_filter_list, cp, 0) < 0)
goto options_rejected;
if (!*cp)
goto options_rejected;
clean_fname(cp, 1);
if (check_filter(&server_filter_list, cp, 0) < 0)
goto options_rejected;
+ free(cp);
}
parse_filter_file(&filter_list, arg,
opt == OPT_INCLUDE_FROM ? MATCHFLG_INCLUDE : 0,
}
parse_filter_file(&filter_list, arg,
opt == OPT_INCLUDE_FROM ? MATCHFLG_INCLUDE : 0,
@@
-1205,17
+1208,16
@@
int parse_arguments(int *argc, const char ***argv, int frommain)
if (sanitize_paths) {
int i;
for (i = *argc; i-- > 0; )
if (sanitize_paths) {
int i;
for (i = *argc; i-- > 0; )
- (*argv)[i] = sanitize_path(NULL, (*argv)[i], "", 0);
+ (*argv)[i] = sanitize_path(NULL, (*argv)[i], "", 0
, NULL
);
if (tmpdir)
if (tmpdir)
- tmpdir = sanitize_path(NULL, tmpdir, NULL, 0);
+ tmpdir = sanitize_path(NULL, tmpdir, NULL, 0
, NULL
);
if (partial_dir)
if (partial_dir)
- partial_dir = sanitize_path(NULL, partial_dir, NULL, 0);
+ partial_dir = sanitize_path(NULL, partial_dir, NULL, 0
, NULL
);
if (backup_dir)
if (backup_dir)
- backup_dir = sanitize_path(NULL, backup_dir, NULL, 0);
+ backup_dir = sanitize_path(NULL, backup_dir, NULL, 0
, NULL
);
}
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;
- int i;
if (tmpdir) {
if (!*tmpdir)
goto options_rejected;
if (tmpdir) {
if (!*tmpdir)
goto options_rejected;
@@
-1228,13
+1230,6
@@
int parse_arguments(int *argc, const char ***argv, int frommain)
if (check_filter(elp, partial_dir, 1) < 0)
goto options_rejected;
}
if (check_filter(elp, partial_dir, 1) < 0)
goto options_rejected;
}
- for (i = 0; i < basis_dir_cnt; i++) {
- if (!*basis_dir[i])
- goto options_rejected;
- clean_fname(basis_dir[i], 1);
- if (check_filter(elp, basis_dir[i], 1) < 0)
- goto options_rejected;
- }
if (backup_dir) {
if (!*backup_dir)
goto options_rejected;
if (backup_dir) {
if (!*backup_dir)
goto options_rejected;
@@
-1415,7
+1410,7
@@
int parse_arguments(int *argc, const char ***argv, int frommain)
}
} else {
if (sanitize_paths)
}
} else {
if (sanitize_paths)
- files_from = sanitize_path(NULL, files_from, NULL, 0);
+ files_from = sanitize_path(NULL, files_from, NULL, 0
, NULL
);
if (server_filter_list.head) {
if (!*files_from)
goto options_rejected;
if (server_filter_list.head) {
if (!*files_from)
goto options_rejected;