NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

misc/47915: postinstall does not install /etc/defaults/pkgpath.conf



>Number:         47915
>Category:       misc
>Synopsis:       postinstall does not install /etc/defaults/pkgpath.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 10 19:35:00 +0000 2013
>Originator:     Jim Bernard
>Release:        NetBSD 6.99.19
>Organization:
speaking for myself
>Environment:
System: NetBSD 6.99.19: Sat May 11 18:22:50 MDT 2013 i386
Architecture: i386
Machine: i386
>Description:
        The fix for PR misc/47645 included the addition of a new file,
        /etc/defaults/pkgpath.conf, which defines default paths for
        pkg_info and pkg_admin.  The do_defaults function in the
        /usr/sbin/postinstall script updates a hard-coded list of files
        from the source directory, and pkgpath.conf is not among them.
        The result is that the updated /etc/security script, which
        references ${pkg_admin}, defined _only_ in the missing pkgpath.conf
        file, cannot run pkg_admin.

>How-To-Repeat:
        Update /usr/src to a point after Wed May 1 05:36:25 2013 UTC 
        and run postinstall.  Subsequent runs of /etc/security will
        produce error messages:

          config-var: not found
          audit: not found
          check: not found

        These are arguments that follow ${pkg_admin} in various places
        in /etc/security.  The absence of /etc/defaults/pkgpath.conf
        means that pkg_admin is not defined, so those arguments are
        treated by the shell as (unknown) commands.

>Fix:
        I'll provide a patch for postinstall below, but I question whether
        it was appropriate to add the new file /etc/defaults/pkgpath.conf.
        The current version of that file contains, apart from comments,

          pkg_admin=/usr/sbin/pkg_admin
          pkg_info=/usr/sbin/pkg_info

        There is a default for pkg_info already set in the security script:

          pkg_info=${pkg_info:-/usr/sbin/pkg_info}

        but no corresponding default for pkg_admin.  It seems to me that it's
        more appropriate to add a default for pkg_admin

          pkg_admin=${pkg_admin:-/usr/sbin/pkg_admin}

        in /etc/security and rely on /etc/security.conf for local overrides,
        than to add a second configuration file for the security script.

        Alternatively, it would be reasonable to set model defaults for both
        pkg_info and pkg_admin in /etc/defaults/security.conf, which would
        help to call users' attention to their existence and configurability.

        Here's the patch to postinstall, in case pkgpath.conf is retained:

--- /usr/sbin/postinstall       2013-05-11 12:26:43.000000000 -0600
+++ ./postinstall       2013-06-10 11:57:15.000000000 -0600
@@ -751,11 +751,11 @@
        fi
 
        compare_dir "$op" "${SRC_DIR}/etc/defaults" "${DEST_DIR}/etc/defaults" \
                444 \
                daily.conf monthly.conf security.conf \
-               weekly.conf ${extra_scripts}
+               pkgpath.conf weekly.conf ${extra_scripts}
        failed=$(( ${failed} + $? ))
 
        find_file_in_dirlist pf.boot.conf "pf.boot.conf" \
            "${SRC_DIR}/usr.sbin/pf/etc/defaults" "${SRC_DIR}/etc/defaults" \
            || return 1



Home | Main Index | Thread Index | Old Index