Subject: Re: Removing compat/aout
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 03/09/2002 04:14:41
>>> anyone running a system with a.out binaries that they *USE* really
>>> doesn't want to have COMPAT_AOUT.  why?  say your shell is aout..
>>> you type "cd /usr" in it.  where do you end up?  "/emul/aout/usr".
>> Kindly do me the courtesy of not trying to tell me what I want or
>> don't want.  Maybe _you_ don't want it, [...]

> I think he meant that in the "royal you", inclusive, sense.

> And I think he's 100% correct.

> Can you tell us how you'd convince any program running under
> COMPAT_AOUT to chdir("/usr") and get to the real /usr instad of
> /emul/aout/usr?

/../usr, IIRC.  Why is this relevant?  If you insist on running an
a.out shell under COMPAT_AOUT, you have to be aware of this and watch
out for it.  It's not that hard; I did it for a while during the
aout->elf migration time for some of my home machines.

There are probably a few other things it trips up, too.  That does not
make it totally useless.  Most binaries don't chdir, and of those that
do not all will chdir to directories that have /emul shadows - and of
those, I would hazard a guess that some high proportion are
user-supplied input and therefore quite capable of being fixed with a
little user awareness.  (Indeed, I recently did a full
rebuild-and-reinstall on all my home machines, not just "install over
existing system" but a "make distribution" into a new directory and
move over /home and sundry similar things, and promptly discovered that
I still had a number of a.out binaries lying around, some of them
utilities that I use approximately daily.  Not one of those utilities
was broken by this property of COMPAT_AOUT you're so upset about -
indeed, it was responsible for their continued working.)

Yes, it can be confusing to a non-expert, at least when used
carelessly.  That's true of a lot of things, many of which are still
kept around because of their utility to experts.  (Indeed, there are
those that would argue that any UNIX variant qualifies.)  I think
COMPAT_AOUT, or something functionally equivalent (as someone, mrg I
think, pointed out, it really should be renamed) fits in that bin too.

Can you name any specific examples of programs that would be tripped up
by this, besides shells obeying user input?  I have been able to think
of only one that strikes me as plausible.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B