blob: 658d00bcecdee425447a8bf1bbf2cf4bb04b0c5f [file] [log] [blame]
Jon Westf17c5322018-08-13 17:59:16 -04001From 10d626a1a1d41edf4e4e15e0c835a567b0840a6a Mon Sep 17 00:00:00 2001
Pierre-Hugues Hussonc642be22018-07-07 23:43:53 +02002From: Pierre-Hugues Husson <phh@phh.me>
3Date: Tue, 12 Jun 2018 22:55:32 +0200
Jon Westf17c5322018-08-13 17:59:16 -04004Subject: [PATCH 08/14] property-matching RROs: allow to prefix the value with
Pierre-Hugues Hussonc642be22018-07-07 23:43:53 +02005 + to do glob match instead of exact match
6
7---
8 cmds/idmap/scan.cpp | 5 +++++
9 1 file changed, 5 insertions(+)
10
11diff --git a/cmds/idmap/scan.cpp b/cmds/idmap/scan.cpp
Jon West1fd60302018-08-11 19:14:03 -040012index d69dd79555a..2be6d23ac78 100644
Pierre-Hugues Hussonc642be22018-07-07 23:43:53 +020013--- a/cmds/idmap/scan.cpp
14+++ b/cmds/idmap/scan.cpp
15@@ -1,5 +1,6 @@
16 #include <dirent.h>
17 #include <inttypes.h>
18+#include <fnmatch.h>
19 #include <sys/file.h>
20 #include <sys/stat.h>
21
22@@ -92,6 +93,10 @@ namespace {
23 property_get(prop, propBuf, NULL);
24 val = strndup16to8(value.string(), value.size());
25
26+ if(val[0]=='+') {
27+ return fnmatch(val+1, propBuf, 0) != 0;
28+ }
29+
30 return (strcmp(propBuf, val) == 0);
31 }
32
33--
Jon West1fd60302018-08-11 19:14:03 -0400342.17.1
Pierre-Hugues Hussonc642be22018-07-07 23:43:53 +020035