From owner-svn-src-head@FreeBSD.ORG Thu Oct 11 07:54:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97B33FE3; Thu, 11 Oct 2012 07:54:30 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65F788FC0C; Thu, 11 Oct 2012 07:54:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9B7sUiR083533; Thu, 11 Oct 2012 07:54:30 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9B7sUBD083530; Thu, 11 Oct 2012 07:54:30 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <201210110754.q9B7sUBD083530@svn.freebsd.org> From: Stefan Farfeleder Date: Thu, 11 Oct 2012 07:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241440 - in head: lib/libc/gen share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Oct 2012 07:54:30 -0000 Author: stefanf Date: Thu Oct 11 07:54:29 2012 New Revision: 241440 URL: http://svn.freebsd.org/changeset/base/241440 Log: Decode the first two fstab fields with strunvis(3). This allows having spaces in devices and mount paths, encoded as \s or \040. PR: bin/117687 Submitted by: Martin Kammerhofer Discussed on: arch Modified: head/lib/libc/gen/fstab.c head/share/man/man5/fstab.5 Modified: head/lib/libc/gen/fstab.c ============================================================================== --- head/lib/libc/gen/fstab.c Thu Oct 11 07:39:51 2012 (r241439) +++ head/lib/libc/gen/fstab.c Thu Oct 11 07:54:29 2012 (r241440) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "un-namespace.h" static FILE *_fs_fp; @@ -149,11 +150,15 @@ fstabscan(void) /* OLD_STYLE_FSTAB */ while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0') ; + if (strunvis(cp, cp) < 0) + goto bad; _fs_fstab.fs_spec = cp; if (!_fs_fstab.fs_spec || *_fs_fstab.fs_spec == '#') continue; while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0') ; + if (strunvis(cp, cp) < 0) + goto bad; _fs_fstab.fs_file = cp; fixfsfile(); while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0') Modified: head/share/man/man5/fstab.5 ============================================================================== --- head/share/man/man5/fstab.5 Thu Oct 11 07:39:51 2012 (r241439) +++ head/share/man/man5/fstab.5 Thu Oct 11 07:54:29 2012 (r241440) @@ -32,7 +32,7 @@ .\" @(#)fstab.5 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 7, 2011 +.Dd October 11, 2012 .Dt FSTAB 5 .Os .Sh NAME @@ -66,12 +66,20 @@ The first field, .Pq Fa fs_spec , describes the special device or remote file system to be mounted. +The contents are decoded by the +.Xr strunvis 3 +function. +This allows using spaces or tabs in the device name which would be +interpreted as field separators otherwise. .Pp The second field, .Pq Fa fs_file , describes the mount point for the file system. For swap partitions, this field should be specified as .Dq none . +The contents are decoded by the +.Xr strunvis 3 +function, as above. .Pp The third field, .Pq Fa fs_vfstype , @@ -338,6 +346,7 @@ resides in .Xr mount 8 , .Xr quotacheck 8 , .Xr quotaon 8 , +.Xr strunvis 3 , .Xr swapon 8 , .Xr umount 8 .Sh HISTORY