We can't check the --*-dest args against the server filter rules
authorWayne Davison <wayned@samba.org>
Fri, 28 Apr 2006 17:34:53 +0000 (17:34 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 28 Apr 2006 17:34:53 +0000 (17:34 +0000)
here because we don't know what the args are going to be relative
to yet.

options.c

index ee7b522..a80da6a 100644 (file)
--- a/options.c
+++ b/options.c
@@ -893,12 +893,15 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
                        if (sanitize_paths)
                                arg = sanitize_path(NULL, arg, NULL, 0);
                        if (server_filter_list.head) {
                        if (sanitize_paths)
                                arg = sanitize_path(NULL, arg, NULL, 0);
                        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,
@@ -1215,7 +1218,6 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
        }
        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;