mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-02-05 20:52:45 -05:00
Call clean_fname() with new flag arg.
This commit is contained in:
10
exclude.c
10
exclude.c
@@ -304,7 +304,7 @@ static char *parse_merge_name(const char *merge_file, unsigned int *len_ptr,
|
||||
fn_len = strlen(fn);
|
||||
} else {
|
||||
strlcpy(fn, merge_file, len_ptr ? *len_ptr + 1 : MAXPATHLEN);
|
||||
fn_len = clean_fname(fn, 1);
|
||||
fn_len = clean_fname(fn, CFN_COLLAPSE_DOT_DOT_DIRS);
|
||||
}
|
||||
|
||||
/* If the name isn't in buf yet, it's wasn't absolute. */
|
||||
@@ -315,7 +315,7 @@ static char *parse_merge_name(const char *merge_file, unsigned int *len_ptr,
|
||||
}
|
||||
memcpy(buf, dirbuf + prefix_skip, dirbuf_len - prefix_skip);
|
||||
memcpy(buf + dirbuf_len - prefix_skip, fn, fn_len + 1);
|
||||
fn_len = clean_fname(buf, 1);
|
||||
fn_len = clean_fname(buf, CFN_COLLAPSE_DOT_DOT_DIRS);
|
||||
}
|
||||
|
||||
if (len_ptr)
|
||||
@@ -337,7 +337,7 @@ void set_filter_dir(const char *dir, unsigned int dirlen)
|
||||
len = 0;
|
||||
memcpy(dirbuf + len, dir, dirlen);
|
||||
dirbuf[dirlen + len] = '\0';
|
||||
dirbuf_len = clean_fname(dirbuf, 1);
|
||||
dirbuf_len = clean_fname(dirbuf, CFN_COLLAPSE_DOT_DOT_DIRS);
|
||||
if (dirbuf_len > 1 && dirbuf[dirbuf_len-1] == '.'
|
||||
&& dirbuf[dirbuf_len-2] == '/')
|
||||
dirbuf_len -= 2;
|
||||
@@ -373,7 +373,7 @@ static BOOL setup_merge_file(struct filter_struct *ex,
|
||||
else
|
||||
pathjoin(buf, MAXPATHLEN, dirbuf, x);
|
||||
|
||||
len = clean_fname(buf, 1);
|
||||
len = clean_fname(buf, CFN_COLLAPSE_DOT_DOT_DIRS);
|
||||
if (len != 1 && len < MAXPATHLEN-1) {
|
||||
buf[len++] = '/';
|
||||
buf[len] = '\0';
|
||||
@@ -1012,7 +1012,7 @@ void parse_filter_file(struct filter_list_struct *listp, const char *fname,
|
||||
if (*fname != '-' || fname[1] || am_server) {
|
||||
if (server_filter_list.head) {
|
||||
strlcpy(line, fname, sizeof line);
|
||||
clean_fname(line, 1);
|
||||
clean_fname(line, CFN_COLLAPSE_DOT_DOT_DIRS);
|
||||
if (check_filter(&server_filter_list, line, 0) < 0)
|
||||
fp = NULL;
|
||||
else
|
||||
|
||||
10
options.c
10
options.c
@@ -1009,7 +1009,7 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
|
||||
out_of_memory("parse_arguments");
|
||||
if (!*cp)
|
||||
goto options_rejected;
|
||||
clean_fname(cp, 1);
|
||||
clean_fname(cp, CFN_COLLAPSE_DOT_DOT_DIRS);
|
||||
rej = check_filter(&server_filter_list, cp, 0) < 0;
|
||||
free(cp);
|
||||
if (rej)
|
||||
@@ -1405,14 +1405,14 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
|
||||
if (tmpdir) {
|
||||
if (!*tmpdir)
|
||||
goto options_rejected;
|
||||
clean_fname(tmpdir, 1);
|
||||
clean_fname(tmpdir, CFN_COLLAPSE_DOT_DOT_DIRS);
|
||||
if (check_filter(elp, tmpdir, 1) < 0)
|
||||
goto options_rejected;
|
||||
}
|
||||
if (backup_dir) {
|
||||
if (!*backup_dir)
|
||||
goto options_rejected;
|
||||
clean_fname(backup_dir, 1);
|
||||
clean_fname(backup_dir, CFN_COLLAPSE_DOT_DOT_DIRS);
|
||||
if (check_filter(elp, backup_dir, 1) < 0)
|
||||
goto options_rejected;
|
||||
}
|
||||
@@ -1565,7 +1565,7 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
|
||||
}
|
||||
if (partial_dir) {
|
||||
if (*partial_dir)
|
||||
clean_fname(partial_dir, 1);
|
||||
clean_fname(partial_dir, CFN_COLLAPSE_DOT_DOT_DIRS);
|
||||
if (!*partial_dir || strcmp(partial_dir, ".") == 0)
|
||||
partial_dir = NULL;
|
||||
if (!partial_dir && refused_partial) {
|
||||
@@ -1606,7 +1606,7 @@ int parse_arguments(int *argc_p, const char ***argv_p, int frommain)
|
||||
if (server_filter_list.head) {
|
||||
if (!*files_from)
|
||||
goto options_rejected;
|
||||
clean_fname(files_from, 1);
|
||||
clean_fname(files_from, CFN_COLLAPSE_DOT_DOT_DIRS);
|
||||
if (check_filter(&server_filter_list, files_from, 0) < 0)
|
||||
goto options_rejected;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user