diff options
author | Alexander Hall <halex@cvs.openbsd.org> | 2009-07-27 18:11:08 +0000 |
---|---|---|
committer | Alexander Hall <halex@cvs.openbsd.org> | 2009-07-27 18:11:08 +0000 |
commit | 860f645801e6ff63d417d495dacdd7b9ab89dcc4 (patch) | |
tree | 4239a6ec9beac42d3f994c3e12a05f288982c0af /sbin/newfs_msdos | |
parent | 05752d9ea1020f44bb76143173b41046332bc84e (diff) |
As is already the case for ffs, do not allow creation of msdos file systems
on block devices
ok marco@
Diffstat (limited to 'sbin/newfs_msdos')
-rw-r--r-- | sbin/newfs_msdos/newfs_msdos.8 | 14 | ||||
-rw-r--r-- | sbin/newfs_msdos/newfs_msdos.c | 4 |
2 files changed, 15 insertions, 3 deletions
diff --git a/sbin/newfs_msdos/newfs_msdos.8 b/sbin/newfs_msdos/newfs_msdos.8 index fe5a67a97d3..5c089b11109 100644 --- a/sbin/newfs_msdos/newfs_msdos.8 +++ b/sbin/newfs_msdos/newfs_msdos.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: newfs_msdos.8,v 1.22 2007/09/28 09:57:01 jmc Exp $ +.\" $OpenBSD: newfs_msdos.8,v 1.23 2009/07/27 18:11:07 halex Exp $ .\" .\" Copyright (c) 1998 Robert Nordier .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD: src/sbin/newfs_msdos/newfs_msdos.8,v 1.6 1999/08/28 00:13:52 peter Exp $ .\" -.Dd $Mdocdate: September 28 2007 $ +.Dd $Mdocdate: July 27 2009 $ .Dt NEWFS_MSDOS 8 .Os .Sh NAME @@ -71,6 +71,16 @@ entry .Ar disktype to determine geometry, if required. .Pp +The +.Ar special +file should be a raw device, +for example +.Pa /dev/rsd0i ; +if a relative path like +.Pa sd0i +is specified, +the corresponding raw device is used. +.Pp The options are as follows: .Bl -tag -width Ds .It Fl a Ar FAT-size diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c index be760b4b510..16851ff45bf 100644 --- a/sbin/newfs_msdos/newfs_msdos.c +++ b/sbin/newfs_msdos/newfs_msdos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newfs_msdos.c,v 1.17 2007/09/28 09:57:01 jmc Exp $ */ +/* $OpenBSD: newfs_msdos.c,v 1.18 2009/07/27 18:11:07 halex Exp $ */ /* * Copyright (c) 1998 Robert Nordier @@ -347,6 +347,8 @@ main(int argc, char *argv[]) err(1, "%s", fname); if (!opt_N) check_mounted(fname, sb.st_mode); + if (S_ISBLK(sb.st_mode)) + errx(1, "%s: block device", fname); if (!S_ISCHR(sb.st_mode)) warnx("warning: %s is not a character device", fname); memset(&bpb, 0, sizeof(bpb)); |