Rules read in from per-dir merge files need to have non-applicable
authorWayne Davison <wayned@samba.org>
Sat, 19 Feb 2005 03:12:21 +0000 (03:12 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 19 Feb 2005 03:12:21 +0000 (03:12 +0000)
rules filtered out before the rule gets stored (not in a post-
filtering pass like the rules that are read-in prior to the run).

exclude.c

index 9a7a81c..9455609 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -133,6 +133,19 @@ static void add_rule(struct filter_list_struct *listp, const char *pat,
                        listp->debug_type);
        }
 
+       /* This flag also indicates that we're reading a list that
+        * needs to be filtered now, not post-filtered later. */
+       if (xflags & XFLG_ANCHORED2ABS) {
+               uint32 mf = mflags & (MATCHFLG_RECEIVER_SIDE|MATCHFLG_SENDER_SIDE);
+               if (am_sender) {
+                       if (mf == MATCHFLG_RECEIVER_SIDE)
+                               return;
+               } else {
+                       if (mf == MATCHFLG_SENDER_SIDE)
+                               return;
+               }
+       }
+
        if (!(ret = new(struct filter_struct)))
                out_of_memory("add_rule");
        memset(ret, 0, sizeof ret[0]);