iptables: Fix connlabel.conf install location
PATCH 1/1 iptables: Fix connlabel.conf install location
As reported by Danny Rawlins in bug #828, connlabel.conf is unconditionally installed in /etc/xtables instead of using prefix set at configure time. Fix to use sysconfdir variable.
This closes bugzilla #828.
Phil
Makefile.am +2 -2
@@ -25,8 +25,8 @@ tarball: rm -Rf /tmp/${PACKAGE_TARNAME}-${PACKAGE_VERSION}; install-data-hook: - @mkdir -p -m 755 $(DESTDIR)/etc/xtables/ || : - @test -f /etc/xtables/connlabel.conf || $(INSTALL) -m 644 etc/xtables/connlabel.conf $(DESTDIR)/etc/xtables/connlabel.conf || : + @mkdir -p -m 755 @sysconfdir@/xtables/ || : + @test -f @sysconfdir@/xtables/connlabel.conf || $(INSTALL) -m 644 etc/xtables/connlabel.conf @sysconfdir@/xtables/connlabel.conf || : config.status: extensions/GNUmakefile.in \ include/xtables-version.h.in include/iptables/internal.h.in
Florian Westphal
maintainerQuoted 3 lines · Phil Oester
As reported by Danny Rawlins in bug #828, connlabel.conf is unconditionally installed in
/etc/xtablesinstead of using prefix set at configure time. Fix to use sysconfdir variable.
It was intentional.
I don't want userspace to start guessing where the config file is.
Quoted 5 lines · Phil Oester
As reported by Danny Rawlins in bug #828, connlabel.conf is unconditionally installed in
/etc/xtablesinstead of using prefix set at configure time. Fix to use sysconfdir variable.This closes bugzilla #828.
Applied, thanks Phil.
Pablo Neira Ayuso
maintainerQuoted 7 lines · Florian Westphal
Quoted 3 lines · Phil Oester
As reported by Danny Rawlins in bug #828, connlabel.conf is unconditionally installed in
/etc/xtablesinstead of using prefix set at configure time. Fix to use sysconfdir variable.It was intentional.
I don't want userspace to start guessing where the config file is.
Sorry Florian, we crossed emails while replying this.
I think this is still useful for people cross-compiling and installing iptables in some custom location.
Regards.
Pablo Neira Ayuso
maintainerQuoted 6 lines · Pablo Neira Ayuso
Quoted 5 lines · Florian Westphal
Quoted 3 lines · Phil Oester
As reported by Danny Rawlins in bug #828, connlabel.conf is unconditionally installed in
/etc/xtablesinstead of using prefix set at configure time. Fix to use sysconfdir variable.
Quoted 7 lines
Quoted 2 lines
It was intentional.
I don't want userspace to start guessing where the config file is.Sorry Florian, we crossed emails while replying this.
I think this is still useful for people cross-compiling and installing iptables in some custom location.
Hm, still, this may confuse people, as xt_connlabel always looks at:
#define CONNLABEL_CFG "/etc/xtables/connlabel.conf"
Florian Westphal
maintainerQuoted 6 lines · Pablo Neira Ayuso
Quoted 2 lines
I think this is still useful for people cross-compiling and installing iptables in some custom location.
Hm, still, this may confuse people, as
xt_connlabelalways looks at:#define
CONNLABEL_CFG"/etc/xtables/connlabel.conf"
Right; this is easily fixable. However, this is also the default in libnetfilter_conntrack. But lnf-ct wont be able to know what configure options iptables was built with.
So libnetfilter-conntrack and conntrack-tool would end up having to try a couple of locations to find that config file...
Pablo Neira Ayuso
maintainerQuoted 11 lines · Florian Westphal
Quoted 6 lines · Pablo Neira Ayuso
Quoted 2 lines
I think this is still useful for people cross-compiling and installing iptables in some custom location.
Hm, still, this may confuse people, as
xt_connlabelalways looks at:#define
CONNLABEL_CFG"/etc/xtables/connlabel.conf"Right; this is easily fixable. However, this is also the default in
libnetfilter_conntrack. But lnf-ct wont be able to know what configure options iptables was built with.
We can define the default location in libnetfilter_conntrack.h, eg.
#define NFCT_CONNLABEL_CFG "/etc/xtables/connlabel.conf"
I think connlabel is not of much use without libnetfilter_conntrack, since it provides the translation of the connlabel mapping. So we can conditionally compile connlabel support if libnetfilter_conntrack is installed. We can make it a soft dependency, ie. no need for --enable-connlabel.
Regards.
Florian Westphal
maintainerQuoted 9 lines · Pablo Neira Ayuso
Quoted 8 lines · Florian Westphal
Quoted 6 lines · Pablo Neira Ayuso
Quoted 2 lines
I think this is still useful for people cross-compiling and installing iptables in some custom location.
Hm, still, this may confuse people, as
xt_connlabelalways looks at:#define
CONNLABEL_CFG"/etc/xtables/connlabel.conf"
Quoted 7 lines
Quoted 3 lines
Right; this is easily fixable. However, this is also the default in
libnetfilter_conntrack. But lnf-ct wont be able to know what configure options iptables was built with.We can define the default location in
libnetfilter_conntrack.h, eg.#define
NFCT_CONNLABEL_CFG"/etc/xtables/connlabel.conf"
Sure, I can move the definition from conntrack/labels.c to a public header.
Quoted 5 lines
I think connlabel is not of much use without
libnetfilter_conntrack, since it provides the translation of the connlabel mapping. So we can conditionally compile connlabel support iflibnetfilter_conntrackis installed. We can make it a soft dependency, ie. no need for --enable-connlabel.
Hrm, the iptables connlabel extension currently parses the labels config itself.
What we can do is to add soft dependency in iptables for libnetfilter_conntrack, build the connlabel extension conditionally and then remove the default file from iptables.
Is that what you have in mind?
Pablo Neira Ayuso
maintainerQuoted 27 lines · Florian Westphal
Quoted 9 lines · Pablo Neira Ayuso
Quoted 8 lines · Florian Westphal
Quoted 6 lines · Pablo Neira Ayuso
Quoted 2 lines
I think this is still useful for people cross-compiling and installing iptables in some custom location.
Hm, still, this may confuse people, as
xt_connlabelalways looks at:#define
CONNLABEL_CFG"/etc/xtables/connlabel.conf"Quoted 7 lines
Quoted 3 lines
Right; this is easily fixable. However, this is also the default in
libnetfilter_conntrack. But lnf-ct wont be able to know what configure options iptables was built with.We can define the default location in
libnetfilter_conntrack.h, eg.#define
NFCT_CONNLABEL_CFG"/etc/xtables/connlabel.conf"Sure, I can move the definition from
conntrack/labels.cto a public header.Quoted 5 lines
I think connlabel is not of much use without
libnetfilter_conntrack, since it provides the translation of the connlabel mapping. So we can conditionally compile connlabel support iflibnetfilter_conntrackis installed. We can make it a soft dependency, ie. no need for --enable-connlabel.
Quoted 8 lines
Hrm, the iptables connlabel extension currently parses the labels config itself.
What we can do is to add soft dependency in iptables for
libnetfilter_conntrack, build the connlabel extension conditionally and then remove the default file from iptables.Is that what you have in mind?
Yes. BTW, you could simplify the existing iptables extension by using the connlabel API provided by libnetfilter_conntrack.
I think you can also add --with-libnfct=PATH for people that want to place the library somewhere in the tree, not the standard location.
Thanks.