forwarded message from mouring at etoh.eviladmin.org
Marcus Brinkmann
Marcus.Brinkmann at ruhr-uni-bochum.de
Tue Jul 24 13:25:04 EST 2001
Hi,
On Mon, Jul 23, 2001 at 08:55:53PM +0200, Markus Friedl wrote:
> this patch looks fine,
>
> however, i don't want to see a magic numer 401 in openssh's code.
I can understand that. This is why I suggested to put a wrapper around
gethostname which just xmallocs/xreallocs a large enough buffer, and use
this wrapped version everywhere were gethostname is used right now.
An implementation is already part of the original patch, if I recall
correctly, and just needs to be isolated into a function.
If you prefer it this way (and personally, I do), we can rework the
whole patch and submit it to you for review. (of course if you want to do
this yourself, we are fine with that!).
> why not just define MAXHOSTNAMELEN for HURD ?
One main goal of the Hurd is to not impose any arbitrary system limit on the
users. The system code should be as flexible as possible so it does not
inconvenience the user. Remember that the Hurd is a user-extensible system.
Substantial (read: almost all) parts of the system are implemented in user
space, and can be replaced by a users own implementation. So every
constraint in the little system code we do have (system code here means code
that the user must use to communicate with the remainder of the system, and
cannot avoid or replace) has a serious impact on the freedom of the user of
the system.
Imposing an arbitrary limit on the length of a hostname is such a constraint
we are going a long way to avoid, in the system code and the applications
running on the Hurd. Another is PATH_MAX, MAXPATHLEN and co. Those are
likewise not defined, as there is no global imit to the filename length
known at compile time (and usually none at run time for the standard
filesystems). Another is the number of open file descriptors, like NOFILE,
and so on.
So, to summarise it: We must not define and enforce such a limit in the
system code that the user can not avoid, if we don't want to effectively
force the limit on the user. You can define such a limit in an application
(that doesn't need special privileges to run), as the user will always be
able to create his own, unrestricted version of the program. However, we take
it upon us to modify all programs (included in Debian) and remove such
limitations, because otherwise there will be a lot of duplicated efforts.
[ To put it even simpler: We don't want no stinkin' arbitrary limits ;) ]
I hope it is now easier to understand why we don't define this symbol.
Some understanding for the concepts of the Hurd and the goal of the project
is needed, though, to see why we made that decision. Please ask if
something is unclear.
Thanks,
Marcus
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd at debian.org
Marcus Brinkmann GNU http://www.gnu.org marcus at gnu.org
Marcus.Brinkmann at ruhr-uni-bochum.de
http://www.marcus-brinkmann.de
More information about the openssh-unix-dev
mailing list