From owner-freebsd-bugs Thu Jun 14 7:41:36 2001 Delivered-To: freebsd-bugs@freebsd.org Received: from sentry.granch.com (sentry.granch.com [212.109.197.55]) by hub.freebsd.org (Postfix) with ESMTP id 7C75C37B401 for ; Thu, 14 Jun 2001 07:41:31 -0700 (PDT) (envelope-from shelton@sentry.granch.com) Received: (from shelton@localhost) by sentry.granch.com (8.11.3/8.11.3) id f5EEfS700798 for freebsd-bugs@freebsd.org; Thu, 14 Jun 2001 21:41:28 +0700 (NOVST) (envelope-from shelton) Content-Type: text/plain; charset="koi8-r" From: "Rashid N. Achilov" Organization: Granch Ltd. To: freebsd-bugs@freebsd.org Subject: At Least! I'm fed up! Date: Thu, 14 Jun 2001 21:41:27 +0700 X-Mailer: KMail [version 1.2] MIME-Version: 1.0 Message-Id: <01061421412700.00698@sentry.granch.com> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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