From owner-svn-src-all@FreeBSD.ORG Thu Jan 8 21:17:37 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0385280F; Thu, 8 Jan 2015 21:17:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA085AC4; Thu, 8 Jan 2015 21:17:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t08LHa64005292; Thu, 8 Jan 2015 21:17:36 GMT (envelope-from stefanf@FreeBSD.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t08LHaBO005290; Thu, 8 Jan 2015 21:17:36 GMT (envelope-from stefanf@FreeBSD.org) Message-Id: <201501082117.t08LHaBO005290@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: stefanf set sender to stefanf@FreeBSD.org using -f From: Stefan Farfeleder Date: Thu, 8 Jan 2015 21:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r276854 - in stable/9: lib/libc/gen share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2015 21:17:37 -0000 Author: stefanf Date: Thu Jan 8 21:17:35 2015 New Revision: 276854 URL: https://svnweb.freebsd.org/changeset/base/276854 Log: Belatedly MFC r241440 and r241441: Decode the first two fstab fields with strunvis(3). This allows having spaces in devices and mount paths, encoded as \s or \040. Modified: stable/9/lib/libc/gen/fstab.c stable/9/share/man/man5/fstab.5 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/9/lib/libc/gen/fstab.c ============================================================================== --- stable/9/lib/libc/gen/fstab.c Thu Jan 8 20:11:38 2015 (r276853) +++ stable/9/lib/libc/gen/fstab.c Thu Jan 8 21:17:35 2015 (r276854) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "un-namespace.h" static FILE *_fs_fp; @@ -150,11 +151,17 @@ fstabscan() while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0') ; _fs_fstab.fs_spec = cp; - if (!_fs_fstab.fs_spec || *_fs_fstab.fs_spec == '#') + if (_fs_fstab.fs_spec == NULL || *_fs_fstab.fs_spec == '#') continue; + if (strunvis(_fs_fstab.fs_spec, _fs_fstab.fs_spec) < 0) + goto bad; while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0') ; _fs_fstab.fs_file = cp; + if (_fs_fstab.fs_file == NULL) + goto bad; + if (strunvis(_fs_fstab.fs_file, _fs_fstab.fs_file) < 0) + goto bad; fixfsfile(); while ((cp = strsep(&p, " \t\n")) != NULL && *cp == '\0') ; Modified: stable/9/share/man/man5/fstab.5 ============================================================================== --- stable/9/share/man/man5/fstab.5 Thu Jan 8 20:11:38 2015 (r276853) +++ stable/9/share/man/man5/fstab.5 Thu Jan 8 21:17:35 2015 (r276854) @@ -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