server: remove extra '/run' subdir from paths
Having extra '/run' subdirectory hardcoded into paths used for options 'digest-file', 'pid-file', 'run-dir' is counterintuitive and can lead to bogus directory layouts when 'localstatedir' differs from the default value. For example, if 'localstatedir' is set to '/run', which is a common and recommended substitute for /var/run in many distros nowadays, then fwknop files will be placed under /run/run/fwknop. This changeset removes extra '/run' subdirectory from all relevant paths by changing DEF_RUN_DIR. Default value of 'localstatedir' is changed to '/var/run' so users who relied on the previous behaviour won't have to bother changing anything. This is tested and works. Gentoo have this patch applied since 2.6.0.
This commit is contained in:
parent
b1100cb730
commit
e333cba945
@ -68,7 +68,7 @@ COMMAND-LINE OPTIONS
|
|||||||
*-d, --digest-file*='<digest-file>'::
|
*-d, --digest-file*='<digest-file>'::
|
||||||
Specify the location of the 'digest.cache' file. If this option is
|
Specify the location of the 'digest.cache' file. If this option is
|
||||||
not given, 'fwknopd' will use the compile-time default location (typically
|
not given, 'fwknopd' will use the compile-time default location (typically
|
||||||
'@localstatedir@/run/fwknop/digest.cache').
|
'@localstatedir@/fwknop/digest.cache').
|
||||||
|
|
||||||
*-D, --dump-config*::
|
*-D, --dump-config*::
|
||||||
Dump the configuration values that *fwknopd* derives from the
|
Dump the configuration values that *fwknopd* derives from the
|
||||||
@ -131,7 +131,7 @@ COMMAND-LINE OPTIONS
|
|||||||
*-p, --pid-file*='<pid-file>'::
|
*-p, --pid-file*='<pid-file>'::
|
||||||
Specify the location of the 'fwknopd.pid' file. If this option is
|
Specify the location of the 'fwknopd.pid' file. If this option is
|
||||||
not given, 'fwknopd' will use the compile-time default location (typically
|
not given, 'fwknopd' will use the compile-time default location (typically
|
||||||
'@localstatedir@/run/fwknop/fwknopd.pid).
|
'@localstatedir@/fwknop/fwknopd.pid).
|
||||||
|
|
||||||
*-P, --pcap-filter*='<filter>'::
|
*-P, --pcap-filter*='<filter>'::
|
||||||
Specify a Berkeley packet filter statement on the *fwknopd* command
|
Specify a Berkeley packet filter statement on the *fwknopd* command
|
||||||
@ -165,11 +165,11 @@ COMMAND-LINE OPTIONS
|
|||||||
*--rotate-digest-cache*::
|
*--rotate-digest-cache*::
|
||||||
Rotate the digest cache file by renaming it to ``<name>-old'', and
|
Rotate the digest cache file by renaming it to ``<name>-old'', and
|
||||||
starting a new one. The digest cache file is typically found in
|
starting a new one. The digest cache file is typically found in
|
||||||
'@localstatedir@/run/fwknop/digest.cache'.
|
'@localstatedir@/fwknop/digest.cache'.
|
||||||
|
|
||||||
*-r, --run-dir*='<path>'::
|
*-r, --run-dir*='<path>'::
|
||||||
Specify the directory where *fwknopd* writes run time state files. The
|
Specify the directory where *fwknopd* writes run time state files. The
|
||||||
default is '@localstatedir@/run'.
|
default is '@localstatedir@'.
|
||||||
|
|
||||||
*-S, --status*::
|
*-S, --status*::
|
||||||
Display the status of any *fwknopd* processes that may or not be
|
Display the status of any *fwknopd* processes that may or not be
|
||||||
@ -399,7 +399,7 @@ See the '@sysconfdir@/fwknop/fwknopd.conf' file for the full list and correspond
|
|||||||
|
|
||||||
*FWKNOP_RUN_DIR* '<path>'::
|
*FWKNOP_RUN_DIR* '<path>'::
|
||||||
Specify the directory where *fwknopd* writes run time state files. The
|
Specify the directory where *fwknopd* writes run time state files. The
|
||||||
default is '@localstatedir@/run'.
|
default is '@localstatedir@'.
|
||||||
|
|
||||||
ACCESS.CONF VARIABLES
|
ACCESS.CONF VARIABLES
|
||||||
~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
%define _libdir /usr/lib
|
%define _libdir /usr/lib
|
||||||
%endif
|
%endif
|
||||||
%define _sysconfdir /etc
|
%define _sysconfdir /etc
|
||||||
%define _localstatedir /var
|
%define _localstatedir /var/run
|
||||||
%define _infodir /usr/share/info
|
%define _infodir /usr/share/info
|
||||||
%define _mandir /usr/share/man
|
%define _mandir /usr/share/man
|
||||||
|
|
||||||
|
|||||||
@ -94,7 +94,7 @@ Specify the location of the
|
|||||||
file\&. If this option is not given,
|
file\&. If this option is not given,
|
||||||
\fIfwknopd\fR
|
\fIfwknopd\fR
|
||||||
will use the compile\-time default location (typically
|
will use the compile\-time default location (typically
|
||||||
\fI@localstatedir@/run/fwknop/digest\&.cache\fR)\&.
|
\fI@localstatedir@/fwknop/digest\&.cache\fR)\&.
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
\fB\-D, \-\-dump\-config\fR
|
\fB\-D, \-\-dump\-config\fR
|
||||||
@ -196,7 +196,7 @@ Specify the location of the
|
|||||||
\fIfwknopd\&.pid\fR
|
\fIfwknopd\&.pid\fR
|
||||||
file\&. If this option is not given,
|
file\&. If this option is not given,
|
||||||
\fIfwknopd\fR
|
\fIfwknopd\fR
|
||||||
will use the compile\-time default location (typically \*(Aq@localstatedir@/run/fwknop/fwknopd\&.pid)\&.
|
will use the compile\-time default location (typically \*(Aq@localstatedir@/fwknop/fwknopd\&.pid)\&.
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
\fB\-P, \-\-pcap\-filter\fR=\fI<filter>\fR
|
\fB\-P, \-\-pcap\-filter\fR=\fI<filter>\fR
|
||||||
@ -244,7 +244,7 @@ files\&. This will also force a flush of the current \(lqFWKNOP\(rq iptables cha
|
|||||||
\fB\-\-rotate\-digest\-cache\fR
|
\fB\-\-rotate\-digest\-cache\fR
|
||||||
.RS 4
|
.RS 4
|
||||||
Rotate the digest cache file by renaming it to \(lq<name>\-old\(rq, and starting a new one\&. The digest cache file is typically found in
|
Rotate the digest cache file by renaming it to \(lq<name>\-old\(rq, and starting a new one\&. The digest cache file is typically found in
|
||||||
\fI@localstatedir@/run/fwknop/digest\&.cache\fR\&.
|
\fI@localstatedir@/fwknop/digest\&.cache\fR\&.
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
\fB\-r, \-\-run\-dir\fR=\fI<path>\fR
|
\fB\-r, \-\-run\-dir\fR=\fI<path>\fR
|
||||||
@ -252,7 +252,7 @@ Rotate the digest cache file by renaming it to \(lq<name>\-old\(rq, and starting
|
|||||||
Specify the directory where
|
Specify the directory where
|
||||||
\fBfwknopd\fR
|
\fBfwknopd\fR
|
||||||
writes run time state files\&. The default is
|
writes run time state files\&. The default is
|
||||||
\fI@localstatedir@/run\fR\&.
|
\fI@localstatedir@\fR\&.
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
\fB\-S, \-\-status\fR
|
\fB\-S, \-\-status\fR
|
||||||
@ -524,7 +524,7 @@ Override syslog facility\&. The \(lqSYSLOG_FACILITY\(rq variable can be set to
|
|||||||
Specify the directory where
|
Specify the directory where
|
||||||
\fBfwknopd\fR
|
\fBfwknopd\fR
|
||||||
writes run time state files\&. The default is
|
writes run time state files\&. The default is
|
||||||
\fI@localstatedir@/run\fR\&.
|
\fI@localstatedir@\fR\&.
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
\fBENABLE_DESTINATION_RULE\fR \fI<Y/N>\fR
|
\fBENABLE_DESTINATION_RULE\fR \fI<Y/N>\fR
|
||||||
|
|||||||
@ -70,7 +70,7 @@
|
|||||||
/* Our default run directory is based on LOCALSTATEDIR as set by the
|
/* Our default run directory is based on LOCALSTATEDIR as set by the
|
||||||
* configure script. This is where we put the PID and digest cache files.
|
* configure script. This is where we put the PID and digest cache files.
|
||||||
*/
|
*/
|
||||||
#define DEF_RUN_DIR SYSRUNDIR"/run/"PACKAGE_NAME
|
#define DEF_RUN_DIR SYSRUNDIR"/"PACKAGE_NAME
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* More Conf defaults
|
/* More Conf defaults
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user