* libmisc/xgetXXbyYY.c, libmisc/xgetpwnam.c, libmisc/xgetgrnam.c,
libmisc/xgetpwuid.c, libmisc/xgetgrgid.c, libmisc/xgetspnam.c: Do not limit the size of the buffer to hold the group or user structure. It used to be limited to 16k, which caused issues with groups having many users.
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
exit (13);
|
||||
}
|
||||
|
||||
do {
|
||||
while (true) {
|
||||
int status;
|
||||
LOOKUP_TYPE *resbuf = NULL;
|
||||
buffer = (char *)realloc (buffer, length);
|
||||
@@ -106,8 +106,14 @@
|
||||
return NULL;
|
||||
}
|
||||
|
||||
length *= 4;
|
||||
} while (length < MAX_LENGTH);
|
||||
if (length <= ((size_t)-1 / 4)) {
|
||||
length *= 4;
|
||||
} else if (length == (size_t) -1) {
|
||||
break;
|
||||
} else {
|
||||
length = (size_t) -1;
|
||||
}
|
||||
}
|
||||
|
||||
free(buffer);
|
||||
free(result);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007 , Nicolas François
|
||||
* Copyright (c) 2007 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -58,7 +58,6 @@
|
||||
#define ARG_TYPE gid_t
|
||||
#define ARG_NAME gid
|
||||
#define DUP_FUNCTION __gr_dup
|
||||
#define MAX_LENGTH 0x8000
|
||||
#define HAVE_FUNCTION_R (defined HAVE_GETGRGID_R)
|
||||
|
||||
#include "xgetXXbyYY.c"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007 , Nicolas François
|
||||
* Copyright (c) 2007 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -58,7 +58,6 @@
|
||||
#define ARG_TYPE const char *
|
||||
#define ARG_NAME name
|
||||
#define DUP_FUNCTION __gr_dup
|
||||
#define MAX_LENGTH 0x8000
|
||||
#define HAVE_FUNCTION_R (defined HAVE_GETGRNAM_R)
|
||||
|
||||
#include "xgetXXbyYY.c"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007 - 2008, Nicolas François
|
||||
* Copyright (c) 2007 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -58,7 +58,6 @@
|
||||
#define ARG_TYPE const char *
|
||||
#define ARG_NAME name
|
||||
#define DUP_FUNCTION __pw_dup
|
||||
#define MAX_LENGTH 0x8000
|
||||
#define HAVE_FUNCTION_R (defined HAVE_GETPWNAM_R)
|
||||
|
||||
#include "xgetXXbyYY.c"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2007 , Nicolas François
|
||||
* Copyright (c) 2007 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -58,7 +58,6 @@
|
||||
#define ARG_TYPE uid_t
|
||||
#define ARG_NAME uid
|
||||
#define DUP_FUNCTION __pw_dup
|
||||
#define MAX_LENGTH 0x8000
|
||||
#define HAVE_FUNCTION_R (defined HAVE_GETPWUID_R)
|
||||
|
||||
#include "xgetXXbyYY.c"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008 , Nicolas François
|
||||
* Copyright (c) 2008 - 2009, Nicolas François
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -58,7 +58,6 @@
|
||||
#define ARG_TYPE const char *
|
||||
#define ARG_NAME name
|
||||
#define DUP_FUNCTION __spw_dup
|
||||
#define MAX_LENGTH 0x8000
|
||||
#define HAVE_FUNCTION_R (defined HAVE_GETSPNAM_R)
|
||||
|
||||
#include "xgetXXbyYY.c"
|
||||
|
Reference in New Issue
Block a user