Re: P*rtability of dash to legacy systems, such as AT&T Unix PC : 03-name-max
Steffen Nurpmeso <[email protected]> Mon, 18 Nov 2024 19:28:50 +0100
| Newsgroups | org.kernel.vger.dash |
|---|---|
| Message-ID | <20241118182850.iBiGRmVD@steffen%sdaoden.eu> |
Hello, for your possible interest.. Alain Knaff wrote in <[email protected]>: |The third part of the patch set supplies a definition of NAME_MAX |where one is lacking. ... |+#ifndef NAME_MAX |+/* NAME_MAX is only used in expand.c to make sure that we have a |+ buffer big enough to append the next local file part into during |+ globbing. So, in case of doubt, we need NAME_MAX to be bigger |+ rather than smaller, in order to prevent buffer overflow */ |+# define NAME_MAX PATH_MAX |+#endif i have for reasons i have forgotten otherwise /* POSIX 2008/Cor 1-2013 defines for * - _POSIX_PATH_MAX a minimum of 256 * - _XOPEN_PATH_MAX a minimum of 1024 * NFS RFC 1094 from March 1989 defines a MAXPATHLEN of 1024, so we really * should avoid anything smaller than that! */ #ifndef PATH_MAX # ifdef MAXPATHLEN # define PATH_MAX MAXPATHLEN # else # define PATH_MAX 1024 # endif #endif #if PATH_MAX + 0 < 1024 # undef PATH_MAX # define PATH_MAX 1024 #endif --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) | |And in Fall, feel "The Dropbear Bard"s ball(s). | |The banded bear |without a care, |Banged on himself fore'er and e'er | |Farewell, dear collar bear