From owner-cvs-sbin Sun Mar 3 00:44:29 1996 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id AAA28774 for cvs-sbin-outgoing; Sun, 3 Mar 1996 00:44:29 -0800 (PST) Received: (from jkh@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id AAA28759 Sun, 3 Mar 1996 00:44:24 -0800 (PST) Date: Sun, 3 Mar 1996 00:44:24 -0800 (PST) From: "Jordan K. Hubbard" Message-Id: <199603030844.AAA28759@freefall.freebsd.org> To: CVS-committers, cvs-all, cvs-sbin Subject: cvs commit: src/sbin/mount mount.c Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk jkh 96/03/03 00:44:24 Modified: sbin/mount mount.c Log: Close PR#17. This may be a contraversal fix in that now mount will spit out two error lines for a bogus filesystem type, e.g: root@time-> mount -t foo /dev/sd0a /mnt mount: exec /sbin/mount_foo for /mnt: No such file or directory mount: exec /usr/sbin/mount_foo for /mnt: No such file or directory But I would submit that if you're even going to scan multiple directories for a mount_foo (which I actually think is somewhat bogus - if it's not in /sbin, you're probably in big trouble anyway), you should emit an error for each one. I got multiple complaints (in addition to the PR) that the existing behavior was very confusing. Revision Changes Path 1.9 +1 -5 src/sbin/mount/mount.c From owner-cvs-sbin Sun Mar 3 10:02:26 1996 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id KAA05444 for cvs-sbin-outgoing; Sun, 3 Mar 1996 10:02:26 -0800 (PST) Received: from GndRsh.aac.dev.com (GndRsh.aac.dev.com [198.145.92.241]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id KAA05432 Sun, 3 Mar 1996 10:02:16 -0800 (PST) Received: (from rgrimes@localhost) by GndRsh.aac.dev.com (8.6.12/8.6.12) id KAA03361; Sun, 3 Mar 1996 10:02:14 -0800 From: "Rodney W. Grimes" Message-Id: <199603031802.KAA03361@GndRsh.aac.dev.com> Subject: Re: cvs commit: src/sbin/mount mount.c To: jkh@freefall.freebsd.org (Jordan K. Hubbard) Date: Sun, 3 Mar 1996 10:02:13 -0800 (PST) Cc: CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-sbin@freefall.freebsd.org In-Reply-To: <199603030844.AAA28759@freefall.freebsd.org> from "Jordan K. Hubbard" at Mar 3, 96 00:44:24 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk > > jkh 96/03/03 00:44:24 > > Modified: sbin/mount mount.c > Log: > Close PR#17. This may be a contraversal fix in that now mount will > spit out two error lines for a bogus filesystem type, e.g: > > root@time-> mount -t foo /dev/sd0a /mnt > mount: exec /sbin/mount_foo for /mnt: No such file or directory > mount: exec /usr/sbin/mount_foo for /mnt: No such file or directory mount: exec mount_foo could not be found in /sbin, /usr/sbin: No such file or directory > > But I would submit that if you're even going to scan multiple directories > for a mount_foo (which I actually think is somewhat bogus - if it's not > in /sbin, you're probably in big trouble anyway), you should emit an error > for each one. I got multiple complaints (in addition to the PR) that the > existing behavior was very confusing. > > Revision Changes Path > 1.9 +1 -5 src/sbin/mount/mount.c > -- Rod Grimes rgrimes@gndrsh.aac.dev.com Accurate Automation Company Reliable computers for FreeBSD From owner-cvs-sbin Sun Mar 3 11:25:36 1996 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id LAA08655 for cvs-sbin-outgoing; Sun, 3 Mar 1996 11:25:36 -0800 (PST) Received: from time.cdrom.com (time.cdrom.com [192.216.222.226]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id LAA08645 Sun, 3 Mar 1996 11:25:34 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by time.cdrom.com (8.7.4/8.6.9) with SMTP id LAA27228; Sun, 3 Mar 1996 11:25:17 -0800 (PST) To: "Rodney W. Grimes" cc: jkh@freefall.freebsd.org (Jordan K. Hubbard), CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-sbin@freefall.freebsd.org Subject: Re: cvs commit: src/sbin/mount mount.c In-reply-to: Your message of "Sun, 03 Mar 1996 10:02:13 PST." <199603031802.KAA03361@GndRsh.aac.dev.com> Date: Sun, 03 Mar 1996 11:25:16 -0800 Message-ID: <27226.825881116@time.cdrom.com> From: "Jordan K. Hubbard" Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk > mount: exec mount_foo could not be found in /sbin, /usr/sbin: No such file or directory Look at the code - this kind of error message is not easy to emit without fundamentally changing more structure than I felt was wise. The search list is an arbitrary path, you see. Jordan From owner-cvs-sbin Mon Mar 4 02:35:54 1996 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id CAA19415 for cvs-sbin-outgoing; Mon, 4 Mar 1996 02:35:54 -0800 (PST) Received: (from ache@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id CAA19393 Mon, 4 Mar 1996 02:35:47 -0800 (PST) Date: Mon, 4 Mar 1996 02:35:47 -0800 (PST) From: "Andrey A. Chernov" Message-Id: <199603041035.CAA19393@freefall.freebsd.org> To: CVS-committers, cvs-all, cvs-sbin Subject: cvs commit: src/sbin/startslip uucplock.c Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk ache 96/03/04 02:35:46 Modified: sbin/startslip uucplock.c Log: Prepare to eliminate multiply uucplock.c copies Revision Changes Path 1.5 +33 -16 src/sbin/startslip/uucplock.c From owner-cvs-sbin Tue Mar 5 19:26:11 1996 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA23741 for cvs-sbin-outgoing; Tue, 5 Mar 1996 19:26:11 -0800 (PST) Received: from sunrise.cs.berkeley.edu (sunrise.CS.Berkeley.EDU [128.32.38.121]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id TAA23594 Tue, 5 Mar 1996 19:24:55 -0800 (PST) Received: (from asami@localhost) by sunrise.cs.berkeley.edu (8.6.12/8.6.12) id TAA11194; Tue, 5 Mar 1996 19:26:53 -0800 Date: Tue, 5 Mar 1996 19:26:53 -0800 Message-Id: <199603060326.TAA11194@sunrise.cs.berkeley.edu> To: jkh@time.cdrom.com CC: rgrimes@gndrsh.aac.dev.com, jkh@freefall.freebsd.org, CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-sbin@freefall.freebsd.org In-reply-to: <27226.825881116@time.cdrom.com> (jkh@time.cdrom.com) Subject: Re: cvs commit: src/sbin/mount mount.c From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk * > mount: exec mount_foo could not be found in /sbin, /usr/sbin: No such file or * directory * * Look at the code - this kind of error message is not easy to emit * without fundamentally changing more structure than I felt was wise. * The search list is an arbitrary path, you see. I know it's no big deal but this message has bugged me in the past too. What about this? === Index: mount.c =================================================================== RCS file: /usr/cvs/src/sbin/mount/mount.c,v retrieving revision 1.9 diff -u -r1.9 mount.c --- 1.9 1996/03/03 08:44:22 +++ mount.c 1996/03/06 03:20:54 @@ -332,8 +332,20 @@ (void)snprintf(execname, sizeof(execname), "%s/mount_%s", *edir, vfstype); execv(execname, (char * const *)argv); - warn("exec %s for %s", execname, name); } while (*++edir != NULL); + if (errno == ENOENT) { + char tmp[sizeof(edirs)+5]; + tmp[0] = '\0'; + edir = edirs; + do { + strcat(tmp, *edir); + strcat(tmp, ", "); + } while (*++edir != NULL); + /* now delete the last ", " */ + tmp[strlen(tmp)-2] = '\0'; + warn("exec mount_%s could not be found in %s", + vfstype, tmp); + } exit(1); /* NOTREACHED */ default: /* Parent. */ === Actually, if I know how to call warn() (or an equivalent) without letting it emit the "No such file or directory" message first, we don't have to build the string and it will be even simpler.... Satoshi From owner-cvs-sbin Tue Mar 5 19:30:32 1996 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA24315 for cvs-sbin-outgoing; Tue, 5 Mar 1996 19:30:32 -0800 (PST) Received: from sunrise.cs.berkeley.edu (sunrise.CS.Berkeley.EDU [128.32.38.121]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id TAA24218 Tue, 5 Mar 1996 19:30:02 -0800 (PST) Received: (from asami@localhost) by sunrise.cs.berkeley.edu (8.6.12/8.6.12) id TAA11575; Tue, 5 Mar 1996 19:32:00 -0800 Date: Tue, 5 Mar 1996 19:32:00 -0800 Message-Id: <199603060332.TAA11575@sunrise.cs.berkeley.edu> To: jkh@time.cdrom.com CC: rgrimes@gndrsh.aac.dev.com, jkh@freefall.freebsd.org, CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-sbin@freefall.freebsd.org In-reply-to: <27226.825881116@time.cdrom.com> (jkh@time.cdrom.com) Subject: Re: cvs commit: src/sbin/mount mount.c From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk On second thought, try this one instead. The message is slightly shorter, making it fit on 80-line terminals for most cases. ;) === Index: mount.c =================================================================== RCS file: /usr/cvs/src/sbin/mount/mount.c,v retrieving revision 1.9 diff -u -r1.9 mount.c --- 1.9 1996/03/03 08:44:22 +++ mount.c 1996/03/06 03:27:47 @@ -332,8 +332,20 @@ (void)snprintf(execname, sizeof(execname), "%s/mount_%s", *edir, vfstype); execv(execname, (char * const *)argv); - warn("exec %s for %s", execname, name); } while (*++edir != NULL); + if (errno == ENOENT) { + char tmp[sizeof(edirs)+5]; + tmp[0] = '\0'; + edir = edirs; + do { + strcat(tmp, *edir); + strcat(tmp, ", "); + } while (*++edir != NULL); + /* now delete the last ", " */ + tmp[strlen(tmp)-2] = '\0'; + warn("exec mount_%s not found in %s", + vfstype, tmp); + } exit(1); /* NOTREACHED */ default: /* Parent. */ === Satoshi From owner-cvs-sbin Tue Mar 5 19:37:49 1996 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA24944 for cvs-sbin-outgoing; Tue, 5 Mar 1996 19:37:49 -0800 (PST) Received: from time.cdrom.com (time.cdrom.com [192.216.222.226]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id TAA24929 Tue, 5 Mar 1996 19:37:43 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by time.cdrom.com (8.7.4/8.6.9) with SMTP id TAA01223; Tue, 5 Mar 1996 19:37:28 -0800 (PST) To: asami@cs.berkeley.edu (Satoshi Asami) cc: rgrimes@gndrsh.aac.dev.com, jkh@freefall.freebsd.org, CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-sbin@freefall.freebsd.org Subject: Re: cvs commit: src/sbin/mount mount.c In-reply-to: Your message of "Tue, 05 Mar 1996 19:26:53 PST." <199603060326.TAA11194@sunrise.cs.berkeley.edu> Date: Tue, 05 Mar 1996 19:37:28 -0800 Message-ID: <1221.826083448@time.cdrom.com> From: "Jordan K. Hubbard" Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk > I know it's no big deal but this message has bugged me in the past > too. What about this? Except for being more complex than my solution (and hence more failure prone), I've no problems with it. Go ahead! I only sought to eliminate the PR, which my simple fix at least accomplished. Jordan From owner-cvs-sbin Tue Mar 5 19:39:06 1996 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id TAA25103 for cvs-sbin-outgoing; Tue, 5 Mar 1996 19:39:06 -0800 (PST) Received: from time.cdrom.com (time.cdrom.com [192.216.222.226]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id TAA25094 Tue, 5 Mar 1996 19:39:00 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by time.cdrom.com (8.7.4/8.6.9) with SMTP id TAA01243; Tue, 5 Mar 1996 19:38:45 -0800 (PST) To: asami@cs.berkeley.edu (Satoshi Asami) cc: rgrimes@gndrsh.aac.dev.com, jkh@freefall.freebsd.org, CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-sbin@freefall.freebsd.org Subject: Re: cvs commit: src/sbin/mount mount.c In-reply-to: Your message of "Tue, 05 Mar 1996 19:32:00 PST." <199603060332.TAA11575@sunrise.cs.berkeley.edu> Date: Tue, 05 Mar 1996 19:38:45 -0800 Message-ID: <1241.826083525@time.cdrom.com> From: "Jordan K. Hubbard" Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk > On second thought, try this one instead. The message is slightly > shorter, making it fit on 80-line terminals for most cases. ;) One small question - won't the warn() inside the loop also go off, resulting in even _more_ output? Jordan From owner-cvs-sbin Tue Mar 5 20:11:41 1996 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id UAA28655 for cvs-sbin-outgoing; Tue, 5 Mar 1996 20:11:41 -0800 (PST) Received: from silvia.HIP.Berkeley.EDU (silvia.HIP.Berkeley.EDU [136.152.64.181]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id UAA28612 Tue, 5 Mar 1996 20:11:13 -0800 (PST) Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.7.4/8.6.9) id UAA13389; Tue, 5 Mar 1996 20:11:01 -0800 (PST) Date: Tue, 5 Mar 1996 20:11:01 -0800 (PST) Message-Id: <199603060411.UAA13389@silvia.HIP.Berkeley.EDU> To: jkh@time.cdrom.com CC: rgrimes@gndrsh.aac.dev.com, jkh@freefall.freebsd.org, CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-sbin@freefall.freebsd.org In-reply-to: <1241.826083525@time.cdrom.com> (jkh@time.cdrom.com) Subject: Re: cvs commit: src/sbin/mount mount.c From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk * One small question - won't the warn() inside the loop also go off, * resulting in even _more_ output? Um, that part is deleted in the patch. The "-" at the beginning of the line. But anyway, people don't try this at home...the patch is totally bogus, sizeof(array of "char *"s) will not return the total number of characters used by the strings. ;) I'll send out another one after dinner.... Satoshi From owner-cvs-sbin Tue Mar 5 21:33:09 1996 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id VAA10223 for cvs-sbin-outgoing; Tue, 5 Mar 1996 21:33:09 -0800 (PST) Received: from silvia.HIP.Berkeley.EDU (silvia.HIP.Berkeley.EDU [136.152.64.181]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id VAA10179 Tue, 5 Mar 1996 21:32:55 -0800 (PST) Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.7.4/8.6.9) id VAA13683; Tue, 5 Mar 1996 21:32:41 -0800 (PST) Date: Tue, 5 Mar 1996 21:32:41 -0800 (PST) Message-Id: <199603060532.VAA13683@silvia.HIP.Berkeley.EDU> To: CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-sbin@freefall.freebsd.org In-reply-to: <199603060411.UAA13389@silvia.HIP.Berkeley.EDU> (asami@cs.berkeley.edu) Subject: Re: cvs commit: src/sbin/mount mount.c From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk * But anyway, people don't try this at home...the patch is totally * bogus, sizeof(array of "char *"s) will not return the total number of * characters used by the strings. ;) * * I'll send out another one after dinner.... Ok, this one should be ok. I also converted a "do-while" to a "for", I don't know why it had to be three lines instead of one.... === Index: mount.c =================================================================== RCS file: /usr/cvs/src/sbin/mount/mount.c,v retrieving revision 1.9 diff -c -r1.9 mount.c *** mount.c 1996/03/03 08:44:22 1.9 --- mount.c 1996/03/06 05:29:50 *************** *** 327,339 **** exit(mount_ufs(argc, (char * const *) argv)); /* Go find an executable. */ ! edir = edirs; ! do { (void)snprintf(execname, sizeof(execname), "%s/mount_%s", *edir, vfstype); execv(execname, (char * const *)argv); ! warn("exec %s for %s", execname, name); ! } while (*++edir != NULL); exit(1); /* NOTREACHED */ default: /* Parent. */ --- 327,354 ---- exit(mount_ufs(argc, (char * const *) argv)); /* Go find an executable. */ ! for (edir = edirs; *edir; edir++) { (void)snprintf(execname, sizeof(execname), "%s/mount_%s", *edir, vfstype); execv(execname, (char * const *)argv); ! } ! if (errno == ENOENT) { ! int len = 0; ! char *tmp; ! for (edir = edirs; *edir; edir++) ! len += strlen(*edir) + 2; /* ", " */ ! if ((tmp = malloc(len)) == NULL) { ! warn(NULL); ! exit(1); ! } ! tmp[0] = '\0'; ! for (edir = edirs; *edir; edir++) { ! strcat(tmp, *edir); ! if (edir[1] != NULL) ! strcat(tmp, ", "); ! } ! warn("exec mount_%s not found in %s", vfstype, tmp); ! } exit(1); /* NOTREACHED */ default: /* Parent. */ === I know it's more complicated than necessary (I can probably get away with "char tmp[100]" or some such), but I don't want it to break when someone decides to add 30 directories to the list.... :) Satoshi From owner-cvs-sbin Sat Mar 9 16:20:39 1996 Return-Path: owner-cvs-sbin Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA07846 for cvs-sbin-outgoing; Sat, 9 Mar 1996 16:20:39 -0800 (PST) Received: (from mpp@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA07805 Sat, 9 Mar 1996 16:20:30 -0800 (PST) Date: Sat, 9 Mar 1996 16:20:30 -0800 (PST) From: Mike Pritchard Message-Id: <199603100020.QAA07805@freefall.freebsd.org> To: CVS-committers, cvs-all, cvs-sbin Subject: cvs commit: src/sbin/mount mount.c Sender: owner-cvs-sbin@FreeBSD.ORG X-Loop: owner-cvs-sbin@FreeBSD.ORG Precedence: bulk mpp 96/03/09 16:20:29 Modified: sbin/mount mount.c Log: Do not allow the caller to specify the same path for the special device file and the mount point. This prevents the "unexpected recursive lock" panic from happening. This is a temporary fix. A kernel fix would be much much more ugly than this, and still wouldn't be the "right" way to fix it. After some of Terry's file system rework is installed, it will be possible to properly fix this problem in a clean manner. Until then, this change should prevent use from getting a problem report on this every month or so (and I just noticed that someone in one of the freebsd news groups was complaining about this problem, too). Revision Changes Path 1.10 +19 -0 src/sbin/mount/mount.c