Date: Thu, 14 Jun 2001 21:41:27 +0700 From: "Rashid N. Achilov" <shelton@sentry.granch.ru> To: freebsd-bugs@freebsd.org Subject: At Least! I'm fed up! Message-ID: <01061421412700.00698@sentry.granch.com>
next in thread | raw e-mail | index | archive | help
Now I'm fed up to the throat. My box (FreeBSD 4.3-STABLE, cvsup at last
saturday) again hung up, when I tried to read read-only mounted floppy. We
have recently discussed this - what now?
Ten (10) minutes to write this stupid patch. I won't discuss annoyed this
user or not annoyed - for me it's worked. For you...
--- /tmp/mount.c Sat Jun 9 03:36:00 2001
+++ mount.c Thu Jun 14 21:12:08 2001
@@ -380,7 +380,7 @@
const char *argv[100], **edir;
struct statfs sf;
pid_t pid;
- int argc, i, status;
+ int argc, i, status = 0;
char *optbuf, execname[MAXPATHLEN + 1], mntpath[MAXPATHLEN];
#if __GNUC__
@@ -388,6 +388,29 @@
(void)&name;
#endif
+// Check if mounting floppy. When true, ask about doing.
+
+ if (!strcmp(spec,"/dev/fd0"))
+ {
+ while(status == 0)
+ {
+ fprintf(stderr,"Mounting floppy. Be sure that R/W curtains is
CLOSED! Proceed? [Y,N]:");
+
+ fpurge(stdin);
+ i = getchar();
+
+ switch(toupper(i))
+ {
+ case 'Y': status = 1;
+ break; // You has been warned :-(
+
+ case 'N': return(1);
+
+ default : ;
+ }
+ }
+ }
+
/* resolve the mountpoint with realpath(3) */
(void)checkpath(name, mntpath);
name = mntpath;
--
With Best Regards.
Rashid N. Achilov (RNA1-RIPE), Web: http://granch.ru/~shelton
Granch Ltd. system administrator, e-mail: achilov@granch.ru
PGP: 83 CD E2 A7 37 4A D5 81 D6 D6 52 BF C9 2F 85 AF 97 BE CB 0A
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01061421412700.00698>
