38 lines
1.2 KiB
Diff
38 lines
1.2 KiB
Diff
Description: avoid userdefs.h
|
|
1. This is an ancient header with crazy ancient defaults
|
|
2. It was included only for MAXGLEN
|
|
3. MAXGLEN is damn small (= 9)
|
|
Index: libproject/usr/src/lib/libproject/common/getprojent.c
|
|
===================================================================
|
|
--- libproject.orig/usr/src/lib/libproject/common/getprojent.c 2012-10-08 04:25:41.000000000 +0400
|
|
+++ libproject/usr/src/lib/libproject/common/getprojent.c 2012-10-30 19:59:30.409768851 +0400
|
|
@@ -30,7 +30,6 @@
|
|
#include <user_attr.h>
|
|
#include <pwd.h>
|
|
#include <grp.h>
|
|
-#include <userdefs.h>
|
|
#include <project.h>
|
|
#include <memory.h>
|
|
#include <nss_dbdefs.h>
|
|
@@ -139,7 +138,7 @@
|
|
ismember(struct project *proj, const char *user, gid_t gid, int is_default)
|
|
{
|
|
char grbuf[NSS_BUFLEN_GROUP];
|
|
- char groupname[MAXGLEN + 1];
|
|
+ const char *groupname = NULL;
|
|
int res = is_default;
|
|
struct group grp;
|
|
int group_ok = 0;
|
|
@@ -147,8 +146,9 @@
|
|
char *member;
|
|
|
|
if (getgrgid_r(gid, &grp, grbuf, NSS_BUFLEN_GROUP) != NULL) {
|
|
- group_ok = 1;
|
|
- (void) snprintf(groupname, MAXGLEN, grp.gr_name);
|
|
+ groupname = strdupa(grp.gr_name);
|
|
+ if (NULL != groupname)
|
|
+ group_ok = 1;
|
|
}
|
|
|
|
/*
|