From owner-freebsd-bugs@FreeBSD.ORG Sat Apr 21 06:00:11 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A59A316A409 for ; Sat, 21 Apr 2007 06:00:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 85E7613C468 for ; Sat, 21 Apr 2007 06:00:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l3L60Bjt006568 for ; Sat, 21 Apr 2007 06:00:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l3L60BhK006567; Sat, 21 Apr 2007 06:00:11 GMT (envelope-from gnats) Resent-Date: Sat, 21 Apr 2007 06:00:11 GMT Resent-Message-Id: <200704210600.l3L60BhK006567@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Eugene Grosbein Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3409016A404 for ; Sat, 21 Apr 2007 05:50:40 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.166]) by mx1.freebsd.org (Postfix) with ESMTP id 8723E13C459 for ; Sat, 21 Apr 2007 05:50:39 +0000 (UTC) (envelope-from eugen@grosbein.pp.ru) Received: from grosbein.pp.ru (localhost [127.0.0.1]) by grosbein.pp.ru (8.14.1/8.14.1) with ESMTP id l3L5d5en012042 for ; Sat, 21 Apr 2007 13:39:05 +0800 (KRAST) (envelope-from eugen@grosbein.pp.ru) Received: (from eugen@localhost) by grosbein.pp.ru (8.14.1/8.13.8/Submit) id l3L5d4Nq012041; Sat, 21 Apr 2007 13:39:04 +0800 (KRAST) (envelope-from eugen) Message-Id: <200704210539.l3L5d4Nq012041@grosbein.pp.ru> Date: Sat, 21 Apr 2007 13:39:04 +0800 (KRAST) From: Eugene Grosbein To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/111978: 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: Sat, 21 Apr 2007 06:00:11 -0000 >Number: 111978 >Category: bin >Synopsis: make syspath list for mount(8) configurable at runtime >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Apr 21 06:00:10 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Eugene Grosbein >Release: FreeBSD 6.2-STABLE i386 >Organization: Svyaz Service JSC >Environment: System: FreeBSD grosbein.pp.ru 6.2-STABLE FreeBSD 6.2-STABLE #16: Tue Apr 17 23:08:38 KRAST 2007 eu@grosbein.pp.ru:/mnt/home/obj/usr/local/src/sys/DADV i386 >Description: There are sysutils/fusefs-* ports that extend FreeBSD support for several filesystem types. These ports install utilities into /usr/local hierarchy but mount(8) only looks to compiled-in _PATH_SYSPATH (/sbin:/usr/sbin) path when it searches for mount_XXX commands. Let's allow system administrator to redefine this list using environment variable SYSPATH (the exact name is discussible), so that f.e. mount_ntfs-3g may be found by "mount -t ntfs_3g ..." command. >How-To-Repeat: N/A >Fix: The patch is for src/sbin/mount: --- mount.c.orig Sat Apr 21 12:53:32 2007 +++ mount.c Sat Apr 21 12:58:36 2007 @@ -438,7 +438,7 @@ struct statfs sf; pid_t pid; int argc, i, status; - char *optbuf, execname[PATH_MAX], mntpath[PATH_MAX]; + char *optbuf, *syspath, execname[PATH_MAX], mntpath[PATH_MAX]; #if __GNUC__ (void)&optbuf; @@ -511,10 +511,12 @@ exit(mount_ufs(argc, (char * const *) argv)); /* Go find an executable. */ - execvP(execname, _PATH_SYSPATH, (char * const *)argv); + if ((syspath = getenv("SYSPATH")) == NULL) + syspath = _PATH_SYSPATH; + execvP(execname, syspath, (char * const *)argv); if (errno == ENOENT) { warn("exec mount_%s not found in %s", vfstype, - _PATH_SYSPATH); + syspath); } exit(1); /* NOTREACHED */ --- mount.8.orig Sat Apr 21 13:19:58 2007 +++ mount.8 Sat Apr 21 13:28:33 2007 @@ -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 @@ -401,12 +401,12 @@ If the type is not one of the internally known types, .Nm will attempt to execute a program in -.Pa /sbin/mount_ Ns Sy XXX +.Pa mount_ Ns Sy XXX where .Sy XXX is replaced by the 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. @@ -451,6 +451,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 Eugene Grosbein >Release-Note: >Audit-Trail: >Unformatted: