[Bug 1154] Allow include statement to operate on directories and/or wildcards
bugzilla-daemon at netfilter.org
bugzilla-daemon at netfilter.org
Thu Jun 15 11:04:43 CEST 2017
https://bugzilla.netfilter.org/show_bug.cgi?id=1154
--- Comment #6 from Ismo Puustinen <ismo.puustinen at intel.com> ---
I was thinking about globbing... we need to agree on the exact semantics
before the implementation phase.
Consider this directory structure where dir1 and dir2 are include directories
(nft -I dir1 -I dir2 ...):
dir1/
cba.nft
acb.nft
dir2/
abc.nft
dir3/
a.nft
What about the following include cases:
include "*"
This means that all files in all include directories get added. However, what
do
we do for directory "dir3"? Should that cause an error or not?
include "a*"
Files starting with 'a' are in both include directories. Should we add the
files
in alphabetic order [abc.nft, acb.nft] or in include directory order
[acb.nft, abc.nft]?
include "foo*.nft"
There is no match. I think this shouldn't cause an error, because the whole
point of implementing globbing is that we can include files from potentially
empty directories. Do you agree?
include "foo.nft"
There is no match. Should this be an error, or do we think of this as a special
case of glob with no wild cards, and thus not an error?
include "dir4/*"
There is no such directory. Should this be an error? Or what would it mean?
I think the key question is if we want to handle globbing by just running
glob()
on each include directory and merging the results, or do we want to parse the
pattern ourselves and then try to handle several error cases before running the
glob() call.
--
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20170615/b0f1ec09/attachment.html>
More information about the netfilter-buglog
mailing list