summaryrefslogtreecommitdiff
path: root/package/nfs-utils/patches/patch-utils_mountd_cache_c
blob: 5f46d31166251a5e2010bece89812280372c13eb (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
--- nfs-utils-1.1.4.orig/utils/mountd/cache.c	2008-10-17 16:20:09.000000000 +0200
+++ nfs-utils-1.1.4/utils/mountd/cache.c	2009-01-03 13:48:33.000000000 +0100
@@ -118,54 +118,6 @@ void auth_unix_ip(FILE *f)
 	free(he);
 }
 
-void auth_unix_gid(FILE *f)
-{
-	/* Request are
-	 *  uid
-	 * reply is
-	 *  uid expiry count list of group ids
-	 */
-	int uid;
-	struct passwd *pw;
-	gid_t glist[100], *groups = glist;
-	int ngroups = 100;
-	int rv, i;
-	char *cp;
-
-	if (readline(fileno(f), &lbuf, &lbuflen) != 1)
-		return;
-
-	cp = lbuf;
-	if (qword_get_int(&cp, &uid) != 0)
-		return;
-
-	pw = getpwuid(uid);
-	if (!pw)
-		rv = -1;
-	else {
-		rv = getgrouplist(pw->pw_name, pw->pw_gid, groups, &ngroups);
-		if (rv == -1 && ngroups >= 100) {
-			groups = malloc(sizeof(gid_t)*ngroups);
-			if (!groups)
-				rv = -1;
-			else
-				rv = getgrouplist(pw->pw_name, pw->pw_gid,
-						  groups, &ngroups);
-		}
-	}
-	qword_printint(f, uid);
-	qword_printint(f, time(0)+30*60);
-	if (rv >= 0) {
-		qword_printint(f, ngroups);
-		for (i=0; i<ngroups; i++)
-			qword_printint(f, groups[i]);
-	} else
-		qword_printint(f, 0);
-	qword_eol(f);
-
-	if (groups != glist)
-		free(groups);
-}
 
 #if USE_BLKID
 static const char *get_uuid_blkdev(char *path)
@@ -730,7 +682,6 @@ struct {
 	FILE *f;
 } cachelist[] = {
 	{ "auth.unix.ip", auth_unix_ip},
-	{ "auth.unix.gid", auth_unix_gid},
 	{ "nfsd.export", nfsd_export},
 	{ "nfsd.fh", nfsd_fh},
 	{ NULL, NULL }
@@ -742,8 +693,6 @@ void cache_open(void) 
 	int i;
 	for (i=0; cachelist[i].cache_name; i++ ) {
 		char path[100];
-		if (!manage_gids && cachelist[i].cache_handle == auth_unix_gid)
-			continue;
 		sprintf(path, "/proc/net/rpc/%s/channel", cachelist[i].cache_name);
 		cachelist[i].f = fopen(path, "r+");
 	}