diff options
author | Wayne Davison <wayned@samba.org> | 2008-03-20 11:59:54 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2008-03-20 22:39:29 -0700 |
commit | d48810ba5b0b8d09b272092a70da1255c2346ab8 (patch) | |
tree | 46b7a8cc372f917bafe0879f3db54e1b681d13f9 /options.c | |
parent | 819bfe459919769c9ddae14affeaa79596c640bb (diff) | |
download | rsync-d48810ba5b0b8d09b272092a70da1255c2346ab8.tar.gz rsync-d48810ba5b0b8d09b272092a70da1255c2346ab8.tar.bz2 rsync-d48810ba5b0b8d09b272092a70da1255c2346ab8.zip |
Some improvements to the file-name cleaning code:
- Removed the CFN_KEEP_LEADING_DOT_DIR flag for clean_fname().
- Explicitly add an implied dot-dir to the transfer rather than keeping
a leading a "./" prefix as a part of a relative pathname.
- Added the CFN_KEEP_DOT_DIRS flag for clean_fname().
- Added the SP_KEEP_DOT_DIRS flag for sanitize_path().
- Call clean_fname() a couple more times.
Diffstat (limited to 'options.c')
-rw-r--r-- | options.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1032,7 +1032,7 @@ int parse_arguments(int *argc_p, const char ***argv_p) case OPT_INCLUDE_FROM: arg = poptGetOptArg(pc); if (sanitize_paths) - arg = sanitize_path(NULL, arg, NULL, 0); + arg = sanitize_path(NULL, arg, NULL, 0, SP_DEFAULT); if (daemon_filter_list.head) { int rej; char *dir, *cp = strdup(arg); @@ -1438,11 +1438,11 @@ int parse_arguments(int *argc_p, const char ***argv_p) 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, SP_KEEP_DOT_DIRS); if (tmpdir) - tmpdir = sanitize_path(NULL, tmpdir, NULL, 0); + tmpdir = sanitize_path(NULL, tmpdir, NULL, 0, SP_DEFAULT); if (backup_dir) - backup_dir = sanitize_path(NULL, backup_dir, NULL, 0); + backup_dir = sanitize_path(NULL, backup_dir, NULL, 0, SP_DEFAULT); } if (daemon_filter_list.head && !am_sender) { struct filter_list_struct *elp = &daemon_filter_list; @@ -1650,7 +1650,7 @@ int parse_arguments(int *argc_p, const char ***argv_p) } } else { if (sanitize_paths) - files_from = sanitize_path(NULL, files_from, NULL, 0); + files_from = sanitize_path(NULL, files_from, NULL, 0, SP_DEFAULT); if (daemon_filter_list.head) { char *dir; if (!*files_from) |