From owner-freebsd-bugs@FreeBSD.ORG Sun Oct 14 14:50:02 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9656916A419 for ; Sun, 14 Oct 2007 14:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 65AFC13C442 for ; Sun, 14 Oct 2007 14:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l9EEo24e008816 for ; Sun, 14 Oct 2007 14:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l9EEo2mx008815; Sun, 14 Oct 2007 14:50:02 GMT (envelope-from gnats) Date: Sun, 14 Oct 2007 14:50:02 GMT Message-Id: <200710141450.l9EEo2mx008815@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Eugene Grosbein Cc: Subject: Re: bin/111978: [patch] make syspath list for mount(8) configurable at runtime X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eugene Grosbein List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Oct 2007 14:50:02 -0000 The following reply was made to PR bin/111978; it has been noted by GNATS. From: Eugene Grosbein To: bug-followup@freebsd.org Cc: Subject: Re: bin/111978: [patch] make syspath list for mount(8) configurable at runtime Date: Sun, 14 Oct 2007 22:42:05 +0800 Hi! Here is the same patch for 7.0-PRERELEASE: --- sbin/mount/mount.8.orig 2007-06-25 13:06:54.000000000 +0800 +++ sbin/mount/mount.8 2007-10-14 18:00:42.000000000 +0800 @@ -342,7 +342,7 @@ .Nm to execute the equivalent of: .Bd -literal -offset indent -/sbin/mount_unionfs -b /sys $HOME/sys +mount_unionfs -b /sys $HOME/sys .Ed .Pp Additional options specific to file system types @@ -351,7 +351,7 @@ .Fl t option below) may be described in the manual pages for the associated -.Pa /sbin/mount_ Ns Sy XXX +.Pa mount_ Ns Sy XXX utilities. .It Fl p Print mount information in @@ -426,12 +426,12 @@ will not call .Xr nmount 2 directly and will instead attempt to execute a program in -.Pa /sbin/mount_ Ns Sy XXX +.Pa mount_ Ns Sy XXX where .Sy XXX is replaced by the file system type name. For example, nfs file systems are mounted by the program -.Pa /sbin/mount_nfs . +.Pa mount_nfs . .Pp Most file systems will be dynamically loaded by the kernel if not already present, and if the kernel module is available. @@ -476,6 +476,15 @@ (See .Xr issetugid 2 for more information.) +.It Ev SYSPATH +If the environment variable +.Ev SYSPATH +is set, it is used as colon-separated list of paths to search for +.Pa mount_ Ns Sy XXX +utilities (see +.Fl t +option description). If it is not set, default value /sbin:/usr/sbin +is assumed. .El .Sh FILES .Bl -tag -width /etc/fstab -compact --- sbin/mount/mount.c.orig 2007-06-25 13:06:54.000000000 +0800 +++ sbin/mount/mount.c 2007-10-14 18:09:27.000000000 +0800 @@ -152,6 +152,7 @@ { pid_t pid; int status; + char *syspath; switch (pid = fork()) { case -1: /* Error. */ @@ -159,10 +160,12 @@ exit (1); case 0: /* Child. */ /* Go find an executable. */ - execvP(execname, _PATH_SYSPATH, argv); + if ((syspath = getenv("SYSPATH")) == NULL) + syspath = _PATH_SYSPATH; + execvP(execname, syspath, argv); if (errno == ENOENT) { warn("exec %s not found in %s", execname, - _PATH_SYSPATH); + syspath); } exit(1); default: /* Parent. */