Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Oct 1998 17:09:36 -0700
From:      Mike Smith <mike@smith.net.au>
To:        Chuck Robey <chuckr@mat.net>
Cc:        Terry Lambert <tlambert@primenet.com>, Andy Farkas <andyf@speednet.com.au>, freebsd-chat@FreeBSD.ORG
Subject:   Re: mount flags 
Message-ID:  <199810190009.RAA14961@dingo.cdrom.com>
In-Reply-To: Your message of "Sun, 18 Oct 1998 18:22:37 EDT." <Pine.BSF.4.05.9810181816080.348-100000@picnic.mat.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810190009.RAA14961>