-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi,
Thanks for the reply. On 03/28/2012 08:39 PM, Pino Toscano wrote: > Alle mercoledì 28 marzo 2012, Jelmer Vernooij ha scritto: >> Looking at these patches for the first time, I do wonder if they do >> the right thing. My understanding is that there is no fixed limit on >> path and hostnames on GNU/Hurd. Yet MaxHostNameLen and >> MaxPathNameLen are (fairly arbitrary) constants, meaning that you >> *do* end up with a limit by using them instead. Wouldn't the proper >> fix be to use dynamically allocated strings? > > Yes, the ideal solution would be dynamically allocate strings, either > for paths and for hostname strings. > Note also MAXHOSTNAMELEN is never used within Linux code (it is only > defined to 64 in asm/param.h), so this non POSIX constant is more like > an arbitrary limit, even on Linux (maybe it was used in the past, but > still didn't make much sense for userland). As far as I can tell POSIX says that the return value of gethostname() is limited to HOST_NAME_MAX: http://pubs.opengroup.org/onlinepubs/9699919799/functions/gethostname.html Should we be using that rather than MAXHOSTNAMELEN? > >> As using MaxPathNameLen and MaxHostNameLen means there are arbitrary >> limits anyway, is there any particular reason we couldn't just patch >> configure to #define MAXHOSTNAMELEN and PATH_MAX if they weren't in >> limits.h? That seems like a simpler solution and would prevent us >> from chasing new places where these constants are used. > > Not sure; as said above, ideally these two constants shouldn't be used > (or at most not assume they are always defined, and be able to work as > if they wouldn't exist). It seems simpler to just define them in the source package if they don't exist though, rather than changing all the individual places where they're used. I'll see if I can update the patch. I'm currently also talking to upstream about consistently using either pair of constants; hopefully we'll be able to remove these patches from the Debian package at some point. Cheers, Jelmer -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJPc3tLAAoJEACAbyvXKaRXN3gP/0eBh+E11HwTciZrP3WSq2Z5 Mh+qQ2rEj50Fru/XQLutkH1ZGc2VHdKLmh4BY6lYcaB8fXzvcQhRzJOuiJQOpqS6 uOCXr6nxUywfTt7PZenhPKaheaO203fZI91bUo3HgicAT8oN00k4WcDJtx2nt0qC NxzwoPtoCsBy7g/SehiFnU6dR4bq4F9Om1ymEFmGyfy1AlXjmfDMYDKExuyuz41v 6/mOJVoVzsRviq/WyOoABMaA0NTAtBnN+e3EwaK8fcjCl9sT1VgGDh/c+49feKZr 4DeskZAncwY/MdQCJ1C9mMm81ZXR3zqbdl7+o2vwoyrvaDHcPjrz04JlfWOburHA StoHZwzgPJuNLaL+7XU4GuQluXJwi/35j7+eL+0JQU7/Y+TX3EVTANwskEASv9/e O9z8sEpNiEP9tTLTThQZZTlNzpUr8IZndOYZAtO9cwxaieq53rngsJ4H2Y8uxLvk S4zngLf00Krp3TYU1GohLUeFf2spqiDm+9JshwiGxawgzUs19ZWpPLd6jHLfrTFQ ZpJwiFrGz0CsRrIUcX7UeO47Ngo8T41JDTiOgkDKTeFNgwK4qgN/5ucdR0vT/xvV SOoC10wxy5rpXwumySfCiZFjMtP5RSaVn6+HiuK/MHYfM25bMPQ7C4DvCfEOAB/X t4Ar8GuVjFvId2dpVITA =Qdi+ -----END PGP SIGNATURE----- -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

