Re: [PATCH] avoid assuming MAXPATHLEN in config(8)

2011-09-04 Thread olafBuddenhagen
Hi, On Thu, Jul 07, 2011 at 11:33:53AM +0200, Robert Millan wrote: - (void)snprintf(fname, sizeof fname, ../../conf/options.%s, + (void)asprintf(fname, ../../conf/options.%s, machinename); Ignoring the return value of asprintf() is not a good idea, as it can indicate a

Re: [PATCH] avoid assuming MAXPATHLEN in config(8)

2011-07-30 Thread Guillem Jover
Hi! On Thu, 2011-07-07 at 13:12:03 +0200, Robert Millan wrote: 2011/7/7 Ed Schouten e...@80386.nl: Even though it is good to make our code conform to standards as much as possible, do keep in mind that your patch also causes a lot of regressions in that area. The code now uses asprintf(),

Re: [PATCH] avoid assuming MAXPATHLEN in config(8)

2011-07-08 Thread Robert Millan
2011/7/7 Ed Schouten e...@80386.nl: Considering that the function is rather small anyway, why not compile it in unconditionally (though having a different name). Hi Ed, I made the adjustment you requested, plus a bit more polishing (plugged a memleak, etc), and then I hit what seems like a

[PATCH] avoid assuming MAXPATHLEN in config(8)

2011-07-07 Thread Robert Millan
config(8) assumes MAXPATHLEN is defined in a few places, but presence of this macro isn't garanteed (POSIX says that it is only present when a file length limit exists, which may not be the case). This patch fixes a usr.sbin/config compile problem on Debian GNU/Hurd by using dynamic allocation.

Re: [PATCH] avoid assuming MAXPATHLEN in config(8)

2011-07-07 Thread Ed Schouten
Hi Robert, * Robert Millan r...@debian.org, 20110707 11:33: config(8) assumes MAXPATHLEN is defined in a few places, but presence of this macro isn't garanteed (POSIX says that it is only present when a file length limit exists, which may not be the case). Even though it is good to make our

Re: [PATCH] avoid assuming MAXPATHLEN in config(8)

2011-07-07 Thread Robert Millan
2011/7/7 Ed Schouten e...@80386.nl: * Robert Millan r...@debian.org, 20110707 11:33: config(8) assumes MAXPATHLEN is defined in a few places, but presence of this macro isn't garanteed (POSIX says that it is only present when a file length limit exists, which may not be the case). Even

Re: [PATCH] avoid assuming MAXPATHLEN in config(8)

2011-07-07 Thread Ed Schouten
* Robert Millan r...@debian.org, 20110707 13:12: As for the __GLIBC__ bit, it is difficult to handle this without a function that canonicalizes arbitrary-length pathnames. Would you prefer something like: #ifdef MAXPATHLEN // use realpath on a statically-allocated buffer #else // assume