1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
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;
}
/*
|