Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst Do not allow installation onto floppy disk ...



details:   https://anonhg.NetBSD.org/src/rev/3a01c393571b
branches:  trunk
changeset: 994503:3a01c393571b
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Nov 11 09:17:10 2018 +0000

description:
Do not allow installation onto floppy disk - can be overriden by
architectures where it would make sense (none currently), and also
works around a bug in QEMU for sparc that kills our -current anita tests.

diffstat:

 usr.sbin/sysinst/defs.h  |  10 ++++++++--
 usr.sbin/sysinst/disks.c |  18 ++++++++++++++++--
 2 files changed, 24 insertions(+), 4 deletions(-)

diffs (57 lines):

diff -r 9ab0a6479133 -r 3a01c393571b usr.sbin/sysinst/defs.h
--- a/usr.sbin/sysinst/defs.h   Sun Nov 11 08:28:35 2018 +0000
+++ b/usr.sbin/sysinst/defs.h   Sun Nov 11 09:17:10 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: defs.h,v 1.22 2018/11/08 20:29:37 martin Exp $ */
+/*     $NetBSD: defs.h,v 1.23 2018/11/11 09:17:10 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -178,8 +178,14 @@
 #define PI_ISBSDFS(p) ((p)->pi_fstype == FS_BSDLFS || \
                       (p)->pi_fstype == FS_BSDFFS)
 
-/* standard cd0 device */
+/*
+ * We do not offer CDs or floppies as installation target usually.
+ * Architectures might want to undefine if they want to allow
+ * these devices or redefine if they have unusual CD device names.
+ * Do not define to empty or an empty string, undefine instead.
+ */
 #define CD_NAMES "cd*"
+#define FLOPPY_NAMES "fd*"
 
 /* Types */
 
diff -r 9ab0a6479133 -r 3a01c393571b usr.sbin/sysinst/disks.c
--- a/usr.sbin/sysinst/disks.c  Sun Nov 11 08:28:35 2018 +0000
+++ b/usr.sbin/sysinst/disks.c  Sun Nov 11 09:17:10 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disks.c,v 1.23 2018/11/09 15:20:36 martin Exp $ */
+/*     $NetBSD: disks.c,v 1.24 2018/11/11 09:17:10 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -515,7 +515,21 @@
 bool
 is_cdrom_device(const char *dev)
 {
-       static const char *cdrom_devices[] = { CD_NAMES, 0 };
+       static const char *cdrom_devices[] = {
+#ifdef CD_NAMES
+               CD_NAMES
+#endif
+#if defined(CD_NAMES) && defined(FLOPPY_NAMES)
+               ,
+#endif
+#ifdef FLOPPY_NAMES
+               FLOPPY_NAMES
+#endif
+#if defined(CD_NAMES) || defined(FLOPPY_NAMES)
+               ,
+#endif
+               0
+       };
 
        for (const char **dev_pat = cdrom_devices; *dev_pat; dev_pat++)
                if (fnmatch(*dev_pat, dev, 0) == 0)



Home | Main Index | Thread Index | Old Index