_PATH_DEFPATH, _PATH_STDPATH, etc.

From: Jilles Tjoelker (jilles_at_stack.nl)
Date: 08/06/04

  • Next message: John-Mark Gurney: "valid dup lock logic for witness"
    Date: Fri, 6 Aug 2004 20:48:07 +0200
    To: freebsd-arch@freebsd.org
    
    

    In $FreeBSD: src/include/paths.h,v 1.24 2003/06/29 18:35:36 gordon Exp $,
    the following PATHs are defined:

    /* Default search path. */
    #define _PATH_DEFPATH "/usr/bin:/bin"
    /* All standard utilities path. */
    #define _PATH_STDPATH \
            "/usr/bin:/bin:/usr/sbin:/sbin:"
    /* Locate system binaries */
    #define _PATH_SYSPATH \
            "/sbin:/usr/sbin"

    and #ifdef RESCUE
    #define _PATH_DEFPATH "/rescue:/usr/bin:/bin"
    #define _PATH_STDPATH "/rescue:/usr/bin:/bin:/usr/sbin:/sbin"
    #define _PATH_SYSPATH "/rescue:/sbin:/usr/sbin"

    I think it is not a good idea to have the current directory in
    _PATH_STDPATH, which is returned by confstr(_CS_PATH) and getconf PATH.
    Those are defined by POSIX to return a path that will find all standard
    utilities. Also, _PATH_STDPATH is used in many places as a default path
    for the root user, although in most of those cases, it is overwritten by
    explicit PATH assignments in files like /etc/crontab and
    /etc/login.conf.

    NetBSD cleared up the difference between _PATH_DEFPATH and _PATH_STDPATH
    in 1998:

    http://cvsweb.netbsd.org/bsdweb.cgi/src/include/paths.h.diff?r1=1.10&r2=1.11
    and NetBSD PR #4304

    _PATH_SYSPATH is used by fsck(8) and mount(8) to find
    filesystem-specific versions.

    On a related note, why is md5(1) in /sbin?

    -- 
    Jilles Tjoelker
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
    

  • Next message: John-Mark Gurney: "valid dup lock logic for witness"