From owner-freebsd-chat Sun Oct 18 17:05:32 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA21987 for freebsd-chat-outgoing; Sun, 18 Oct 1998 17:05:32 -0700 (PDT) (envelope-from owner-freebsd-chat@FreeBSD.ORG) Received: from dingo.cdrom.com (castles236.castles.com [208.214.165.236]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA21976 for ; Sun, 18 Oct 1998 17:05:30 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (LOCALHOST [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id RAA14961; Sun, 18 Oct 1998 17:09:36 -0700 (PDT) (envelope-from mike@dingo.cdrom.com) Message-Id: <199810190009.RAA14961@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Chuck Robey cc: Terry Lambert , Andy Farkas , freebsd-chat@FreeBSD.ORG Subject: Re: mount flags In-reply-to: Your message of "Sun, 18 Oct 1998 18:22:37 EDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 18 Oct 1998 17:09:36 -0700 From: Mike Smith Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > The situation is where I'm asking statfs what kind of fs I happen to be > manipulating (not where I'm asking for a mount, or anything like a fs > action initiation). There are a set of manifest constants that are > pretty darn common among all the unixes, and what they mean is > unambiguous ... in mount.h, normally. I see that work has been done to > move that info into an ascii string, but: > > 1) there is no registry for what the mapping is between an fs type > and what string is used to ID it, and This is arguably a failure in the transition to the new interface; the constants should remain, and likewise the interface that used them should still accept them, even if it performs the transformation to the character string before passing it to the kernel. > 2) why is it that a string comparison is felt to be cleaner, in a world > so worried about buffer overruns? That part at least seems terribly > wrong. On top of that, the data is done via linker set ... seems to > be an abuse-trap. > > Why is this cleaner? Because it's arbitrarily extensible, and does away with having to have the VFS type numbers cast in stone. If you wonder why having manifest VFS constants sucks, consider the current mess involving loadable VFS modules. What value do you give a newly loaded VFS? What if you have two loaded in different orders on different systems? The jab about string comparisons is just silly; bad programming is what's dangerous. The fact that people have been getting away with bad string handling for a while but aren't any more is no better or worse than people that used to get away with not range-checking values. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message