Filesystem Hierarchy Standard patch

James Ralston qralston+ml.inn-workers at andrew.cmu.edu
Fri Apr 6 21:00:03 UTC 2001


Here's my first attempt at the FHS patch for INN.  It's against
CURRENT-20010405.  I've also made a patch for STABLE-20010405, solely
for my own needs, but I find it difficult to argue that the FHS patch
qualifies as a bugfix and therefore should be applied to STABLE.  (But
if anyone wants to argue with me on this point, feel free--I'd
personally prefer to see the FHS applied to STABLE as well.)

The changes are:

    The configure.in file now supports a --enable-fhs-dirs option,
    which changes the defaults for most of the other directory-related
    options.  It's equivalent to specifying about 10 different options
    manually.  (Unfortunately, it necessitated abandoning the nice
    INN_ARG_DIR macro.)  Use of --enable-fhs-dirs is documented in
    INSTALL.

    The directory for nnrpd authorization programs is now a separate
    configure option (--with-auth-dir), with its own corresponding
    inn.conf parameter ("pathauth").  It defaults to
    $(prefix)/bin/auth if not set, which is the exact same place that
    the auth programs are currently installed.

    DESTDIR is now properly supported (the existing support was broken
    in several ways).  The "make install" and "make cert" steps
    properly obey DESTDIR.  The use of DESTDIR is now documented in
    INSTALL.

    It is no longer a requirement that the installation step be done
    by the superuser, as long as the user executing the install has
    supplied a DESTDIR value that points to a writable directory,
    *and* the person or process performing the install corrects the
    file ownerships when INN is installed on the system on which it's
    going to run.  Non-root installs are now documented in INSTALL.

    Multiple typos in INSTALL were fixed.

Things left to do:

    Make the location of the rnews.libexec subdirectory configurable,
    the same as auth-dir / pathauth.

    When the --enable-fhs-dirs option is given, only shared/static
    libraries should be placed into libdir; relocate everything else
    to appropriate directories.

    Figure out what to do about --bindir, --sbindir, and --mandir.
    Should we use them (probably in a way not intended by configure),
    or create new options?  Both approaches have disadvantages.

The patch applies, builds, and installs correctly.  I don't know if
the resulting INN system runs correctly (or even at all), though; I
haven't had a chance to test that.

I should be able to get to the remaining FHS issues sometime within
the next few weeks.

-- 
James Ralston, Information Technology
Software Engineering Institute
Carnegie Mellon University, Pittsburgh, PA, USA


-- Attached file included as plaintext by Listar --
-- File: inn-CURRENT-20010405-fhs.patch
-- Desc: FHS patch for CURRENT-20010405

diff -U 2 -r -N ORIG/inn-CURRENT-20010405/INSTALL inn-CURRENT-20010405/INSTALL
--- ORIG/inn-CURRENT-20010405/INSTALL	Thu Apr  5 05:00:02 2001
+++ inn-CURRENT-20010405/INSTALL	Fri Apr  6 16:44:45 2001
@@ -102,7 +102,7 @@
 Unpacking the Distribution
 
-    Released versions of INN are available from ftp.isc.org in /isc/inn. 
-    New major releases will be announed on inn-announce at isc.org (see README)
-    when they're made.
+    Released versions of INN are available from ftp.isc.org in /isc/inn.
+    New major releases will be announced on inn-announce at isc.org (see
+    README) when they're made.
 
     If you want more a more cutting edge version, you can obtain current
@@ -159,41 +159,98 @@
     options are:
 
+    --enable-fhs-dirs
+        This option affects the default settings of several other options,
+        so if you plan to use this option, it should come first.
+
+        The default way to install INN is to install all of INN's programs
+        and support files beneath the same directory prefix.  For example:
+
+            /usr/local/news/bin
+            /usr/local/news/etc
+            /usr/local/news/lib
+            /usr/local/news/spool
+            ...
+
+        This is the recommended installation method, because it isolates the
+        INN system from all other software installed on the machine.  All of
+        INN's files are located in a single directory tree, and are easy to
+        locate.
+
+        Alternatively, INN can be installed in an integrated manner with the
+        operating system, in such as way as to conform to the Linux
+        Filesystem Hierarchy Standard (which most Linux distributors
+        follow).  Instead of locating all of INN's files and directories in
+        a single directory prefix, they are instead distributed to the
+        FHS-standard locations throughout filesystem.  For example:
+
+            /usr/bin
+            /etc/inn
+            /var/lib/inn
+            /var/spool/news
+            ...
+
+        It is recommended that you do *not* use the --enable-fhs-dirs option
+        unless you know what you're doing.  The default installation method
+        of using a common directory prefix is generally easier to work with
+        for novice INN administrators.  Additionally, unless INN is
+        installed using some sort of package management system, it can be
+        difficult to cleanly upgrade INN, or extract it from your system
+        entirely.
+
+        One additional caveat: the default values listed by
+        "./configure --help" always show the non-FHS-defaults, even if
+        "./configure --enable-fhs-dirs --help" is run.  If you want to know
+        how the defaults change when the --enable-fhs-dirs option is given,
+        your best bet is to examine the configure script directly.  (Look at
+        the code directly after occurrences of the "inn_enable_fhs_dirs"
+        string.)
+
     --prefix=PATH
-        Sets the installation prefix for INN.  The default is
-        /usr/local/news.  All of INN's programs and support files will be
-        installed under this directory.  This should match the home
-        directory of your news user (it will make installation and
-        maintenance easier).  It is not recommended to set this to /usr; if
-        you decide to do that anyway, make sure to point INN's temporary
-        directory at a directory that isn't world-writeable (see
-        --with-tmp-dir below).
+        If the --with-fhs-dirs option was not used, this sets the
+        installation prefix for INN.  The default is /usr/local/news.  All
+        of INN's programs and support files will be installed under this
+        directory.  This should match the home directory of your news user
+        (it will make installation and maintenance easier).  It is not
+        recommended to set this to /usr; if you decide to do that anyway,
+        make sure to point INN's temporary directory at a directory that
+        isn't world-writable (see --with-tmp-path below).
+
+        DO NOT use the --prefix option if you have used the --with-fhs-dirs
+        option; the --with-fhs-dirs option automatically sets the
+        installation prefix.
 
     --with-db-dir=PATH
-        Sets the prefix for INN database files.  The default is PREFIX/db,
-        where PREFIX is /usr/local/news unless overridden with the option
-        above.  This history and active files will be stored in this
-        directory, and writes to those files are an appreciable percentage
-        of INN's disk activity.  The history file can also be quite large
-        (requiring up to 2GB or more during nightly expire), so this is a
-        common portion of INN to move to a different file system.
+        Sets the prefix for INN database files.  The default is PREFIX/db
+        unless the --with-fhs-dirs option was given, in which case the
+        default is /var/news/db.  This history and active files will be
+        stored in this directory, and writes to those files are an
+        appreciable percentage of INN's disk activity.  The history file can
+        also be quite large (requiring up to 2GB or more during nightly
+        expire), so this is a common portion of INN to move to a different
+        file system.
 
     --with-spool-dir=PATH
         Sets the prefix for the news spool (when using any storage method
         other than CNFS) and the overview spool.  The default is
-        PREFIX/spool.  This is another common portion of INN to move to a
-        different file system (often /news).
+        PREFIX/spool unless the --with-fhs-dirs option was given, in which
+        case the default is /var/spool/news.  This is another common portion
+        of INN to move to a different file system (often /news).
 
     --with-tmp-dir=PATH
-        Sets the directory in which INN will create temporary files.  This
-        should under no circumstances be the same as the system temporary
-        directory or otherwise be set to a world-writeable directory, since
-        INN doesn't take care to avoid symlink attacks and other security
-        problems possible with a world-writeable directory.  This directory
-        should be reserved for the exclusive use of INN and only writeable
-        by the news user.
+        Sets the directory in which INN will create temporary files.  The
+        default is PREFIX/tmp unless the --with-fhs-dirs option was given,
+        in which case the default is /var/news/tmp.  This should under no
+        circumstances be the same as the system temporary directory or
+        otherwise be set to a world-writable directory, since INN doesn't
+        take care to avoid symlink attacks and other security problems
+        possible with a world-writable directory.  This directory should be
+        reserved for the exclusive use of INN and only writable by the news
+        user.
 
         It's also possible to set the paths for most other sections of the
         INN installation independently; see "./configure --help" and look
-        for the --with-*-dir=PATH options.
+        for the --with-*-dir=PATH options.  (Remember that the default
+        values listed by "./configure --help" are only accurate if the
+        --with-fhs-dirs option was not specified.)
 
     --enable-tagged-hash
@@ -236,5 +293,5 @@
     --with-tcl
         Enables support for Tcl, allowing you to install filter scripts
-        written in Tcl.  Most available filterse seem to be written in Perl
+        written in Tcl.  Most available filters seem to be written in Perl
         these days, so you can safely leave out Tcl support.  If you choose
         to enable this, you will need to have a suitable Tcl distribution
@@ -331,5 +388,5 @@
 
     provided that you have the necessary version of Perl installed. 
-    (Compiling with an embedded Perl interpretor will allow you to use one
+    (Compiling with an embedded Perl interpreter will allow you to use one
     of the available excellent spam filters if you so choose.)
 
@@ -348,9 +405,40 @@
         make install
 
-    You will need to run this command as root so that INN can create the
-    directories it needs and install a couple of setuid wrapper scripts
-    needed to raise resource limits and allow innd to bind to port 119. 
-    This will install INN under the install directory (/usr/local/news,
-    unless you specified something else to the configure script.)
+    If you are building INN on a different system than the one on which it
+    will eventually run, and you therefore want INN to install its files in
+    a virtual root directory and not into the actual filesystem of the build
+    machine, you can pass the virtual root directory to the install step via
+    the DESTDIR variable.  Type:
+
+        make DESTDIR=/tmp/inn-root install
+
+    In the above example, all of INN's directories and files would be
+    installed under the /tmp/inn-root directory instead of the normal /
+    (root) directory.  Just replace "/tmp/inn-root" with whatever directory
+    you wish.
+
+    Under most circumstances, you will need to run the "make install"
+    command as root, so that INN can create the directories it needs and
+    install a couple of setuid wrapper scripts needed to raise resource
+    limits and allow innd to bind to port 119.
+
+    However, in some situations it is desirable to be able to build INN,
+    install it into a virtual root directory, and package the resulting
+    files in a single step, without manual intervention, by a non-root user.
+    (For example, package files for Red Hat Linux's Package Manager system
+    are built in this manner.)  It is possible to build and install INN in
+    this way, but you must set a DESTDIR value for the install step, and
+    additionally, you must tell the installation process that it should omit
+    executing "chown" and "chgrp" commands (which will fail if the
+    installation step is being executed by a non-root user).  To do this,
+    type:
+
+        env CHOWNPROG=set CHGRPPROG=set make DESTDIR=/tmp/inn-root install
+
+    WARNING: if you install INN in this manner, none of the resulting
+    directories and files in the virtual root directory will be owned by the
+    correct users and groups.  It is YOUR responsibility to ensure the
+    resulting directories and files are packaged with the users, groups, and
+    modes with which INN wanted them to be installed!
 
     If you use SSL support for nnrp, you must make a certificate and private
@@ -361,4 +449,8 @@
     as root in order to do this.
 
+    You can also type "make DESTDIR=/tmp/inn-root cert", as either root
+    (preferred) or a non-root user.  All of the warnings and caveats
+    mentioned above apply.
+
     You are now ready for the really fun part: configuring your copy of INN!
 
@@ -389,5 +481,5 @@
 
         Disadvantages:  Takes a very fast file system and I/O system to keep
-        up with current Usenet traffic volues due to file system overhead. 
+        up with current Usenet traffic volume due to file system overhead. 
         Groups with heavy traffic tend to create a bottleneck because of
         inefficiencies in storing large numbers of article files in a single
@@ -406,5 +498,5 @@
         Disadvantages:  The ability to easily find all articles in a given
         newsgroup and manually fiddle with the article spool is lost, and
-        INN still suffers from speed degredation due to file system overhead
+        INN still suffers from speed degradation due to file system overhead
         (creating and deleting individual files is a slow operation).
 
@@ -495,5 +587,5 @@
     installation process and are the most complete reference to how INN
     works.  You're strongly encouraged to refer to the man pages frequently
-    while configuring INN, and for quick reference afterwards.  Any detailed
+    while configuring INN, and for quick reference afterward.  Any detailed
     questions about individual configuration files or the behavior of
     specific programs should be answered in them.  You may want to add
@@ -573,5 +665,5 @@
         automatically by INN, but in some cases it is necessary to set it
         manually.  For example, if you are running NIS on a SunOS system
-        *and* your hostnames are not fully-qualified (ie, your systems are
+        *and* your hostnames are not fully-qualified (i.e., your systems are
         named "host" instead of "host.example.com") then you will need to
         use this option to set your domain name manually.  If in doubt,
@@ -1059,5 +1151,5 @@
     matter.  For articles with an Expires: header, the other two values come
     into play; the date given in the Expires: header of an article will be
-    honored subject to the contraints set by <keep> and <purge>.  All
+    honored subject to the constraints set by <keep> and <purge>.  All
     articles in this storage class will be kept for at least <keep> days,
     regardless of their Expires: header, and all articles in this storage
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/Makefile inn-CURRENT-20010405/Makefile
--- ORIG/inn-CURRENT-20010405/Makefile	Thu Apr  5 05:00:02 2001
+++ inn-CURRENT-20010405/Makefile	Fri Apr  6 16:44:45 2001
@@ -74,5 +74,5 @@
 	@for D in $(ALLDIRS) ; do \
 	    echo '' ; \
-	    cd $$D && $(MAKE) install || exit 1 ; cd .. ; \
+	    cd $$D && $(MAKE) D="$(DESTDIR)" install || exit 1 ; cd .. ; \
 	done
 	@echo ''
@@ -87,7 +87,7 @@
 	@chmod +x support/install-sh
 	for D in $(INSTDIRS) ; do \
-	    support/install-sh $(OWNER) -m 0755 -d $$D ; \
+	    support/install-sh $(OWNER) -m 0755 -d $(DESTDIR)$$D ; \
 	done
-	support/install-sh $(OWNER) -m 0750 -d $(PATHRUN)
+	support/install-sh $(OWNER) -m 0750 -d $(DESTDIR)$(PATHRUN)
 
 update: 
@@ -100,9 +100,18 @@
 ##  Install a certificate for TLS/SSL support.
 cert:
+	umask 027 ; \
 	$(SSLBIN)/openssl req -new -x509 -nodes \
 	    -out $(PATHLIB)/cert.pem -days 366 \
 	    -keyout $(PATHLIB)/cert.pem
-	chown $(NEWSUSER) $(PATHLIB)/cert.pem
-	chgrp $(NEWSGROUP) $(PATHLIB)/cert.pem
+	@ME=`$(WHOAMI)` ; \
+	if [ x"$$ME" = xroot ] ; then \
+	    echo chown $(NEWSUSER) $(PATHLIB)/cert.pem ; \
+	    chown $(NEWSUSER) $(PATHLIB)/cert.pem ; \
+	    echo $(NEWSGROUP) $(PATHLIB)/cert.pem ; \
+	    chgrp $(NEWSGROUP) $(PATHLIB)/cert.pem ; \
+	else \
+	    echo chown $(NEWSUSER) $(PATHLIB)/cert.pem ; \
+	    echo $(NEWSGROUP) $(PATHLIB)/cert.pem ; \
+	fi
 	chmod 640 $(PATHLIB)/cert.pem
 
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/Makefile.global.in inn-CURRENT-20010405/Makefile.global.in
--- ORIG/inn-CURRENT-20010405/Makefile.global.in	Thu Apr  5 05:01:51 2001
+++ inn-CURRENT-20010405/Makefile.global.in	Fri Apr  6 16:44:45 2001
@@ -18,14 +18,4 @@
 VERSION_EXTRA   = 20010405 prerelease
 
-##  If you want to install INN relative to a root directory other than /,
-##  set DESTDIR to the path to the root directory of the file system.  This
-##  won't affect any of the paths compiled into INN; it's used primarily
-##  when building a software distribution, where software has to be
-##  installed into some file system that will later be mounted as / on the
-##  final system.
-
-DESTDIR         =
-D               = $(DESTDIR)
-
 ##  How to install man pages.  Pick one of SOURCE, BSD4.4, NROFF-PACK, or
 ##  NROFF-PACK-SCO.  Used by doc/man/putman.sh; read that script for more
@@ -169,5 +159,5 @@
 PATHSPOOL       = @SPOOLDIR@
 PATHTMP         = @tmpdir@
-PATHAUTH        = $(PATHBIN)/auth
+PATHAUTH        = @AUTHDIR@
 PATHAUTHRESOLV  = $(PATHAUTH)/resolv
 PATHAUTHPASSWD  = $(PATHAUTH)/passwd
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/configure.in inn-CURRENT-20010405/configure.in
--- ORIG/inn-CURRENT-20010405/configure.in	Thu Apr  5 05:00:03 2001
+++ inn-CURRENT-20010405/configure.in	Fri Apr  6 16:44:45 2001
@@ -45,4 +45,7 @@
 test x"$prefix" = xNONE && prefix="$ac_default_prefix"
 
+dnl Make sure $exec_prefix is set so that we can use it internally.
+test x"$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
 dnl Earlier versions of INN used --with-largefiles, which was the wrong flag
 dnl from the perspective of what --with and --enable are supposed to mean.
@@ -90,37 +93,147 @@
 AC_SUBST(UPLIBTOOLLD)
 
+dnl If --enable-fhs-dirs is given, set inn_enable_fhs_dirs so that
+dnl other options know to change their defaults.
+inn_enable_fhs_dirs=no
+AC_ARG_ENABLE(fhs-dirs,
+    [  --enable-fhs-dirs       Use FHS default dirs [default=no]],
+    if test "$enableval" = yes ; then
+        AC_PREFIX_DEFAULT(/usr)
+        inn_enable_fhs_dirs=yes
+        prefix='/usr'
+        localstatedir='/var'
+        sysconfdir='/etc'
+    fi)
+
 dnl INN has quite a few more configurable paths than autoconf supports by
 dnl default.  For right now, those additional paths are configured with
-dnl --with-*-dir options.  This is the generic macro for those arguments;
-dnl it takes the name of the directory, the path relative to $prefix if
-dnl none given to configure, the variable to set, and the help string.
-AC_DEFUN([INN_ARG_DIR],
-[AC_ARG_WITH([$1-dir], [$4], [$3=$with_$1_dir], [$3=$prefix/$2])
-AC_SUBST($3)])
-
+dnl --with-*-dir options.
+dnl
 dnl And here are all the paths.
 dnl
 dnl FIXME: We should honor bindir, libdir, includedir, and mandir at the
 dnl least, and we should use libdir over --with-lib-dir.
-INN_ARG_DIR(control, bin/control, CONTROLDIR,
-    [  --with-control-dir=PATH Path for control programs [PREFIX/bin/control]])
-INN_ARG_DIR(db, db, DBDIR,
-    [  --with-db-dir=PATH      Path for news database files [PREFIX/db]])
-INN_ARG_DIR(doc, doc, DOCDIR,
-    [  --with-doc-dir=PATH     Path for news documentation [PREFIX/doc]])
-INN_ARG_DIR(etc, etc, ETCDIR,
-    [  --with-etc-dir=PATH     Path for news config files [PREFIX/etc]])
-INN_ARG_DIR(filter, bin/filter, FILTERDIR,
-    [  --with-filter-dir=PATH  Path for embedded filters [PREFIX/bin/filter]])
-INN_ARG_DIR(lib, lib, LIBDIR,
-    [  --with-lib-dir=PATH     Path for news library files [PREFIX/lib]])
-INN_ARG_DIR(log, log, LOGDIR,
-    [  --with-log-dir=PATH     Path for news logs [PREFIX/log]])
-INN_ARG_DIR(run, run, RUNDIR,
-    [  --with-run-dir=PATH     Path for news PID/runtime files [PREFIX/run]])
-INN_ARG_DIR(spool, spool, SPOOLDIR,
-    [  --with-spool-dir=PATH   Path for news storage [PREFIX/spool]])
-INN_ARG_DIR(tmp, tmp, tmpdir,
-    [  --with-tmp-dir=PATH     Path for temporary files [PREFIX/tmp]])
+dnl
+
+AC_ARG_WITH(auth-dir,
+    [  --with-auth-dir=PATH    Path for authorization programs [PREFIX/bin/auth]],
+    AUTHDIR=$with_auth_dir,
+    if test "x$inn_enable_fhs_dirs" = xyes ; then
+        eval AUTHDIR="${libdir}/inn/auth"
+        eval AUTHDIR="${AUTHDIR}"
+    else
+        AUTHDIR=$prefix/bin/auth
+    fi)
+AC_SUBST(AUTHDIR)
+
+AC_ARG_WITH(control-dir,
+    [  --with-control-dir=PATH Path for control programs [PREFIX/bin/control]],
+    CONTROLDIR=$with_control_dir,
+    if test "x$inn_enable_fhs_dirs" = xyes ; then
+        eval CONTROLDIR="${libdir}/inn/control"
+        eval CONTROLDIR="${CONTROLDIR}"
+    else
+        CONTROLDIR=$prefix/bin/control
+    fi)
+AC_SUBST(CONTROLDIR)
+
+AC_ARG_WITH(db-dir,
+    [  --with-db-dir=PATH      Path for news database files [PREFIX/db]],
+    DBDIR=$with_db_dir,
+    if test "x$inn_enable_fhs_dirs" = xyes ; then
+        eval DBDIR="${localstatedir}/inn/db"
+        eval DBDIR="${DBDIR}"
+    else
+        DBDIR=$prefix/db
+    fi)
+AC_SUBST(DBDIR)
+
+AC_ARG_WITH(doc-dir,
+    [  --with-doc-dir=PATH     Path for news documentation [PREFIX/doc]],
+    DOCDIR=$with_doc_dir,
+    if test "x$inn_enable_fhs_dirs" = xyes ; then
+        eval DOCDIR="${datadir}/doc/inn"
+        eval DOCDIR="${DOCDIR}"
+    else
+        DOCDIR=$prefix/doc
+    fi)
+AC_SUBST(DOCDIR)
+
+AC_ARG_WITH(etc-dir,
+    [  --with-etc-dir=PATH     Path for news config files [PREFIX/etc]],
+    ETCDIR=$with_etc_dir,
+    if test "x$inn_enable_fhs_dirs" = xyes ; then
+        eval ETCDIR="${sysconfdir}/inn"
+        eval ETCDIR="${ETCDIR}"
+    else
+        ETCDIR=$prefix/etc
+    fi)
+AC_SUBST(ETCDIR)
+
+AC_ARG_WITH(filter-dir,
+    [  --with-filter-dir=PATH  Path for embedded filters [PREFIX/bin/filter]],
+    FILTERDIR=$with_filter_dir,
+    if test "x$inn_enable_fhs_dirs" = xyes ; then
+        eval FILTERDIR="${sysconfdir}/inn/filter"
+        eval FILTERDIR="${FILTERDIR}"
+    else
+        FILTERDIR=$prefix/bin/filter
+    fi)
+AC_SUBST(FILTERDIR)
+
+AC_ARG_WITH(lib-dir,
+    [  --with-lib-dir=PATH     Path for news library files [PREFIX/lib]],
+    LIBDIR=$with_lib_dir,
+    if test "x$inn_enable_fhs_dirs" = xyes ; then
+        eval LIBDIR="${libdir}"
+        eval LIBDIR="${LIBDIR}"
+    else
+        LIBDIR=$prefix/lib
+    fi)
+AC_SUBST(LIBDIR)
+
+AC_ARG_WITH(log-dir,
+    [  --with-log-dir=PATH     Path for news logs [PREFIX/log]],
+    LOGDIR=$with_log_dir,
+    if test "x$inn_enable_fhs_dirs" = xyes ; then
+        eval LOGDIR="${localstatedir}/log/news"
+        eval LOGDIR="${LOGDIR}"
+    else
+        LOGDIR=$prefix/log
+    fi)
+AC_SUBST(LOGDIR)
+
+AC_ARG_WITH(run-dir,
+    [  --with-run-dir=PATH     Path for news PID/runtime files [PREFIX/run]],
+    RUNDIR=$with_run_dir,
+    if test "x$inn_enable_fhs_dirs" = xyes ; then
+        eval RUNDIR="${localstatedir}/run/news"
+        eval RUNDIR="${RUNDIR}"
+    else
+        RUNDIR=$prefix/run
+    fi)
+AC_SUBST(RUNDIR)
+
+AC_ARG_WITH(spool-dir,
+    [  --with-spool-dir=PATH   Path for news storage [PREFIX/spool]],
+    SPOOLDIR=$with_spool_dir,
+    if test "x$inn_enable_fhs_dirs" = xyes ; then
+        eval SPOOLDIR="${localstatedir}/spool/news"
+        eval SPOOLDIR="${SPOOLDIR}"
+    else
+        SPOOLDIR=$prefix/spool
+    fi)
+AC_SUBST(SPOOLDIR)
+
+AC_ARG_WITH(tmp-dir,
+    [  --with-tmp-dir=PATH     Path for temporary files [PREFIX/tmp]],
+    tmpdir=$with_tmp_dir,
+    if test "x$inn_enable_fhs_dirs" = xyes ; then
+        eval tmpdir="${localstatedir}/news/tmp"
+        eval tmpdir="${tmpdir}"
+    else
+        tmpdir=$prefix/tmp
+    fi)
+AC_SUBST(tmpdir)
 
 dnl This is actually give to AC_SUBST later on when we check whether the
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/doc/man/inn.conf.5 inn-CURRENT-20010405/doc/man/inn.conf.5
--- ORIG/inn-CURRENT-20010405/doc/man/inn.conf.5	Thu Apr  5 05:00:31 2001
+++ inn-CURRENT-20010405/doc/man/inn.conf.5	Fri Apr  6 16:46:01 2001
@@ -1017,4 +1017,8 @@
 The path to where the news articles are stored (for storage methods other
 than \s-1CNFS\s0).  The default value is \fIpathspool\fR/spool.
+.Ip "\fIpathauth\fR" 4
+.IX Item "pathauth"
+The path to the authentication programs used by \fInnrpd\fR\|(8).  The
+default value is \fIpathbin\fR/auth.
 .Ip "\fIpathbin\fR" 4
 .IX Item "pathbin"
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/doc/man/readers.conf.5 inn-CURRENT-20010405/doc/man/readers.conf.5
--- ORIG/inn-CURRENT-20010405/doc/man/readers.conf.5	Thu Apr  5 05:00:42 2001
+++ inn-CURRENT-20010405/doc/man/readers.conf.5	Fri Apr  6 16:49:18 2001
@@ -343,5 +343,5 @@
 .IX Item "res:"
 A command line for a user resolver.  The program executed must be located
-in \fIpathbin\fR/auth/resolv.  A resolver is an authentication program which
+in \fIpathauth\fR/resolv.  A resolver is an authentication program which
 attempts to figure out the identity of the connecting user using nothing
 but the connection information (in other words, a username and password
@@ -355,5 +355,5 @@
 .IX Item "auth:"
 A command line for a user authenticator.  The program executed must be
-located in \fIpathbin\fR/auth/passwd.  An authenticator is a program used to
+located in \fIpathauth\fR/passwd.  An authenticator is a program used to
 handle a user-supplied username and password, via a mechanism such as
 \&\s-1AUTHINFO\s0 \s-1USER/PASS\s0.  Like with res:, one auth group can have multiple
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/doc/pod/inn.conf.pod inn-CURRENT-20010405/doc/pod/inn.conf.pod
--- ORIG/inn-CURRENT-20010405/doc/pod/inn.conf.pod	Thu Apr  5 05:00:46 2001
+++ inn-CURRENT-20010405/doc/pod/inn.conf.pod	Fri Apr  6 16:44:45 2001
@@ -1038,4 +1038,9 @@
 The path to the news binaries.  The default value is I<pathnews>/bin.
 
+=item I<pathauth>
+
+The path to the authentication programs used by the new
+readers.conf(5) authentication.  The default value is I<pathbin>/auth.
+
 =item I<pathcontrol>
 
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/include/innconf.h inn-CURRENT-20010405/include/innconf.h
--- ORIG/inn-CURRENT-20010405/include/innconf.h	Thu Apr  5 05:00:56 2001
+++ inn-CURRENT-20010405/include/innconf.h	Fri Apr  6 16:44:45 2001
@@ -345,5 +345,8 @@
 #define _CONF_STATHIST				"stathist"
 #define CONF_VAR_STATHIST			108
-    { _CONF_STATHIST,				"",     1, 0 }
+    { _CONF_STATHIST,				"",     1, 0 },
+#define _CONF_PATHAUTH				"pathauth"
+#define CONF_VAR_PATHAUTH			109
+    { _CONF_PATHAUTH,				"",	1, 1 }
 };
-#define MAX_CONF_VAR 109
+#define MAX_CONF_VAR 110
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/include/libinn.h inn-CURRENT-20010405/include/libinn.h
--- ORIG/inn-CURRENT-20010405/include/libinn.h	Thu Apr  5 05:00:56 2001
+++ inn-CURRENT-20010405/include/libinn.h	Fri Apr  6 16:44:45 2001
@@ -313,4 +313,5 @@
     char *patharchive;          /* Archived news. */
     char *patharticles;         /* Articles. */
+    char *pathauth;             /* Authorization programs. */
     char *pathbin;              /* News binaries. */
     char *pathcontrol;          /* Control message processing routines */
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/include/paths.h.in inn-CURRENT-20010405/include/paths.h.in
--- ORIG/inn-CURRENT-20010405/include/paths.h.in	Thu Apr  5 05:00:56 2001
+++ inn-CURRENT-20010405/include/paths.h.in	Fri Apr  6 16:44:45 2001
@@ -20,8 +20,4 @@
 #define _PATH_NNRPD		"nnrpd"
 #define _PATH_NNTPD		"nnrpd"
-#define _PATH_AUTHDIR		"auth"
-#define _PATH_AUTHDIR_GENERIC	"generic"
-#define _PATH_AUTHDIR_NOPASS	"resolv"
-#define _PATH_AUTHDIR_PASSWD	"passwd"
 #define _PATH_CTLINND		"ctlinnd"
 #define _PATH_RNEWSPROGS	"rnews.libexec"
@@ -89,4 +85,9 @@
 #define _PATH_TMP		"@tmpdir@"
 #define _PATH_RNEWS_DUP_LOG	"/dev/null"
+
+/* Always relative to pathauth. */
+#define _PATH_AUTHDIR_GENERIC	"generic"
+#define _PATH_AUTHDIR_NOPASS	"resolv"
+#define _PATH_AUTHDIR_PASSWD	"passwd"
 
 /* Always relative to pathcontrol. */
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/lib/getconfig.c inn-CURRENT-20010405/lib/getconfig.c
--- ORIG/inn-CURRENT-20010405/lib/getconfig.c	Thu Apr  5 05:01:18 2001
+++ inn-CURRENT-20010405/lib/getconfig.c	Fri Apr  6 16:44:45 2001
@@ -228,4 +228,5 @@
     innconf->pathnews = NULL;
     innconf->pathbin = NULL;
+    innconf->pathauth = NULL;
     innconf->pathfilter = NULL;
     innconf->pathcontrol = NULL;
@@ -298,4 +299,5 @@
     if (innconf->pathnews != NULL) DISPOSE(innconf->pathnews);
     if (innconf->pathbin != NULL) DISPOSE(innconf->pathbin);
+    if (innconf->pathauth != NULL) DISPOSE(innconf->pathauth);
     if (innconf->pathfilter != NULL) DISPOSE(innconf->pathfilter);
     if (innconf->pathcontrol != NULL) DISPOSE(innconf->pathcontrol);
@@ -354,4 +356,7 @@
 	innconf->pathbin = COPY(cpcatpath(innconf->pathnews, "bin"));
     }
+    if (innconf->pathauth == NULL) {
+	innconf->pathauth = COPY(cpcatpath(innconf->pathbin, "auth"));
+    }
     if (innconf->pathfilter == NULL) {
 	innconf->pathfilter = COPY(cpcatpath(innconf->pathbin, "filter"));
@@ -764,4 +769,9 @@
 		if (!bit) innconf->pathbin = COPY(p);
 		SET_CONFIG(CONF_VAR_PATHBIN);
+	    } else
+	    if (EQ(ConfigBuff,_CONF_PATHAUTH)) {
+		TEST_CONFIG(CONF_VAR_PATHAUTH, bit);
+		if (!bit) innconf->pathauth = COPY(p);
+		SET_CONFIG(CONF_VAR_PATHAUTH);
 	    } else
 	    if (EQ(ConfigBuff,_CONF_PATHFILTER)) {
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/nnrpd/commands.c inn-CURRENT-20010405/nnrpd/commands.c
--- ORIG/inn-CURRENT-20010405/nnrpd/commands.c	Thu Apr  5 05:01:23 2001
+++ inn-CURRENT-20010405/nnrpd/commands.c	Fri Apr  6 16:44:45 2001
@@ -112,10 +112,6 @@
 	}
 
-    if (strchr(_PATH_AUTHDIR,'/') == NULL)
-	(void)sprintf(path, "%s/%s/%s/%s", innconf->pathbin, _PATH_AUTHDIR,
-	  _PATH_AUTHDIR_GENERIC, av[0]);
-    else
-	(void)sprintf(path, "%s/%s/%s", _PATH_AUTHDIR, _PATH_AUTHDIR_GENERIC,
-	  av[0]);
+    (void)sprintf(path, "%s/%s/%s", innconf->pathauth, _PATH_AUTHDIR_GENERIC,
+      av[0]);
 
 #if !defined(S_IXUSR) && defined(_S_IXUSR)
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/nnrpd/perm.c inn-CURRENT-20010405/nnrpd/perm.c
--- ORIG/inn-CURRENT-20010405/nnrpd/perm.c	Thu Apr  5 05:01:23 2001
+++ inn-CURRENT-20010405/nnrpd/perm.c	Fri Apr  6 16:44:45 2001
@@ -1893,8 +1893,7 @@
 	return(0);
 
-    resdir = NEW(char, strlen(cpcatpath(innconf->pathbin, _PATH_AUTHDIR)) +
-      1 + strlen(_PATH_AUTHDIR_NOPASS) + 1 + 1);
-    sprintf(resdir, "%s/%s/", cpcatpath(innconf->pathbin, _PATH_AUTHDIR),
-      _PATH_AUTHDIR_NOPASS);
+    resdir = NEW(char, strlen(innconf->pathauth) + 1 + 
+     strlen(_PATH_AUTHDIR_NOPASS) + 1 + 1);
+    sprintf(resdir, "%s/%s/", innconf->pathauth, _PATH_AUTHDIR_NOPASS);
 
     ubuf[0] = '\0';
@@ -1958,8 +1957,7 @@
 	return(0);
 
-    resdir = NEW(char, strlen(cpcatpath(innconf->pathbin, _PATH_AUTHDIR)) +
-      1 + strlen(_PATH_AUTHDIR_PASSWD) + 1 + 1);
-    sprintf(resdir, "%s/%s/", cpcatpath(innconf->pathbin, _PATH_AUTHDIR),
-      _PATH_AUTHDIR_PASSWD);
+    resdir = NEW(char, strlen(innconf->pathauth) + 1 +
+     strlen(_PATH_AUTHDIR_PASSWD) + 1 + 1);
+    sprintf(resdir, "%s/%s/", innconf->pathauth, _PATH_AUTHDIR_PASSWD);
 
     ubuf[0] = '\0';
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/samples/inn.conf.in inn-CURRENT-20010405/samples/inn.conf.in
--- ORIG/inn-CURRENT-20010405/samples/inn.conf.in	Thu Apr  5 05:01:28 2001
+++ inn-CURRENT-20010405/samples/inn.conf.in	Fri Apr  6 16:44:45 2001
@@ -163,4 +163,5 @@
 patharticles:           @SPOOLDIR@/articles
 pathbin:                @prefix@/bin
+pathauth:               @AUTHDIR@
 pathcontrol:            @CONTROLDIR@
 pathdb:                 @DBDIR@
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/scripts/inncheck.in inn-CURRENT-20010405/scripts/inncheck.in
--- ORIG/inn-CURRENT-20010405/scripts/inncheck.in	Thu Apr  5 05:01:32 2001
+++ inn-CURRENT-20010405/scripts/inncheck.in	Fri Apr  6 16:44:45 2001
@@ -399,4 +399,5 @@
     'patharticles',             0,
     'pathbin',                  0,
+    'pathauth',                 0,
     'pathcontrol',              0,
     'pathdb',                   0,
diff -U 2 -r -N ORIG/inn-CURRENT-20010405/site/Makefile inn-CURRENT-20010405/site/Makefile
--- ORIG/inn-CURRENT-20010405/site/Makefile	Thu Apr  5 05:01:38 2001
+++ inn-CURRENT-20010405/site/Makefile	Fri Apr  6 16:44:45 2001
@@ -146,6 +146,14 @@
 $D$(PATH_ACTIVE_TIMES):
 	touch $@
-	chown $(NEWSUSER) $@
-	chgrp $(NEWSGROUP) $@
+	@ME=`$(WHOAMI)` ; \
+	if [ x"$$ME" = xroot ] ; then \
+	    echo chown $(NEWSUSER) $@ ; \
+	    chown $(NEWSUSER) $@ ; \
+	    echo chgrp $(NEWSGROUP) $@ ; \
+	    chgrp $(NEWSGROUP) $@ ; \
+	else \
+	    echo chown $(NEWSUSER) $@ ; \
+	    echo chgrp $(NEWSGROUP) $@ ; \
+	fi
 	chmod 644 $@
 



More information about the inn-workers mailing list