On Sun, Nov 04, 2007 at 04:34:54PM +0000, Samuel Thibault wrote: > Here is an updated patch. fdiskbsdlabel.c actually exactly knows how big > its buffer should be. agetty.c already had a generic macro, but just > wasn't using it everywhere. wall.c and rdev.c are a bit difficult to > make use a dynamic buffer. namei.c can just use the get_current_dir_name > function which allocates a properly sized buffer. > > Samuel > index 01912ab..ba880f4 100644 > --- a/fdisk/fdiskbsdlabel.c > +++ b/fdisk/fdiskbsdlabel.c > @@ -515,7 +515,7 @@ static void > xbsd_write_bootstrap (void) > { > char *bootdir = BSD_LINUX_BOOTDIR; > - char path[MAXPATHLEN]; > + char path[strlen(BSD_LINUX_BOOTDIR) + 1 + 2 + 4 + 1]; Applied, but more readable version: char path[sizeof(BSD_LINUX_BOOTDIR) + 1 + 2 + 4]; /* BSD_LINUX_BOOTDIR + / + {sd,wd} + boot */ > diff --git a/login-utils/agetty.c b/login-utils/agetty.c > index 7e2eee1..be98883 100644 > --- a/login-utils/agetty.c > +++ b/login-utils/agetty.c > @@ -861,7 +861,7 @@ do_prompt(op, tp) > > case 'o': > { > - char domainname[HOST_NAME_MAX+1]; > + char domainname[HOSTNAME_LENGTH+1]; Applied, but I used MAXHOSTNAMELEN (like in the rest of util-linux-ng). > --- a/misc-utils/namei.c > +++ b/misc-utils/namei.c > @@ -81,7 +81,11 @@ int > main(int argc, char **argv) { > extern int optind; > int c; > +#ifdef HAVE_GET_CURRENT_DIR_NAME > + char *curdir; > +#else > char curdir[MAXPATHLEN]; > +#endif Applied. > --- a/sys-utils/rdev.c > +++ b/sys-utils/rdev.c > @@ -94,6 +94,9 @@ usage(void) { > > #define DEFAULT_OFFSET 508 > > +#ifndef PATH_MAX > +#define PATH_MAX 4096 > +#endif Not applied. I don't believe that any non-linux kernel supports rdev stuff. What? Thanks Samuel. Karel -- Karel Zak <kzak@xxxxxxxxxx> - To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html