blob: 40d41a2831d75bb1dc4d710212e742bb62fa3033 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#include <linux/types.h>
2#include <linux/sched.h>
3#include <linux/module.h>
4#include <linux/sunrpc/types.h>
5#include <linux/sunrpc/xdr.h>
6#include <linux/sunrpc/svcsock.h>
7#include <linux/sunrpc/svcauth.h>
8#include <linux/err.h>
9#include <linux/seq_file.h>
10#include <linux/hash.h>
Paulo Marques543537b2005-06-23 00:09:02 -070011#include <linux/string.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
13#define RPCDBG_FACILITY RPCDBG_AUTH
14
15
16/*
17 * AUTHUNIX and AUTHNULL credentials are both handled here.
18 * AUTHNULL is treated just like AUTHUNIX except that the uid/gid
19 * are always nobody (-2). i.e. we do the same IP address checks for
20 * AUTHNULL as for AUTHUNIX, and that is done here.
21 */
22
23
Linus Torvalds1da177e2005-04-16 15:20:36 -070024struct unix_domain {
25 struct auth_domain h;
26 int addr_changes;
27 /* other stuff later */
28};
29
NeilBrownefc36aa2006-03-27 01:14:59 -080030extern struct auth_ops svcauth_unix;
31
Linus Torvalds1da177e2005-04-16 15:20:36 -070032struct auth_domain *unix_domain_find(char *name)
33{
NeilBrownefc36aa2006-03-27 01:14:59 -080034 struct auth_domain *rv;
35 struct unix_domain *new = NULL;
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
NeilBrownefc36aa2006-03-27 01:14:59 -080037 rv = auth_domain_lookup(name, NULL);
38 while(1) {
NeilBrownad1b5222006-03-27 01:15:11 -080039 if (rv) {
40 if (new && rv != &new->h)
41 auth_domain_put(&new->h);
42
43 if (rv->flavour != &svcauth_unix) {
44 auth_domain_put(rv);
45 return NULL;
46 }
NeilBrownefc36aa2006-03-27 01:14:59 -080047 return rv;
48 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
NeilBrownefc36aa2006-03-27 01:14:59 -080050 new = kmalloc(sizeof(*new), GFP_KERNEL);
51 if (new == NULL)
52 return NULL;
53 kref_init(&new->h.ref);
54 new->h.name = kstrdup(name, GFP_KERNEL);
55 new->h.flavour = &svcauth_unix;
56 new->addr_changes = 0;
57 rv = auth_domain_lookup(name, &new->h);
Linus Torvalds1da177e2005-04-16 15:20:36 -070058 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070059}
60
61static void svcauth_unix_domain_release(struct auth_domain *dom)
62{
63 struct unix_domain *ud = container_of(dom, struct unix_domain, h);
64
65 kfree(dom->name);
66 kfree(ud);
67}
68
69
70/**************************************************
71 * cache for IP address to unix_domain
72 * as needed by AUTH_UNIX
73 */
74#define IP_HASHBITS 8
75#define IP_HASHMAX (1<<IP_HASHBITS)
76#define IP_HASHMASK (IP_HASHMAX-1)
77
78struct ip_map {
79 struct cache_head h;
80 char m_class[8]; /* e.g. "nfsd" */
81 struct in_addr m_addr;
82 struct unix_domain *m_client;
83 int m_add_change;
84};
85static struct cache_head *ip_table[IP_HASHMAX];
86
NeilBrownbaab9352006-03-27 01:15:09 -080087static void ip_map_put(struct kref *kref)
Linus Torvalds1da177e2005-04-16 15:20:36 -070088{
NeilBrownbaab9352006-03-27 01:15:09 -080089 struct cache_head *item = container_of(kref, struct cache_head, ref);
Linus Torvalds1da177e2005-04-16 15:20:36 -070090 struct ip_map *im = container_of(item, struct ip_map,h);
NeilBrownbaab9352006-03-27 01:15:09 -080091
92 if (test_bit(CACHE_VALID, &item->flags) &&
93 !test_bit(CACHE_NEGATIVE, &item->flags))
94 auth_domain_put(&im->m_client->h);
95 kfree(im);
Linus Torvalds1da177e2005-04-16 15:20:36 -070096}
97
NeilBrown1f1e0302006-01-06 00:09:49 -080098#if IP_HASHBITS == 8
99/* hash_long on a 64 bit machine is currently REALLY BAD for
100 * IP addresses in reverse-endian (i.e. on a little-endian machine).
101 * So use a trivial but reliable hash instead
102 */
103static inline int hash_ip(unsigned long ip)
104{
105 int hash = ip ^ (ip>>16);
106 return (hash ^ (hash>>8)) & 0xff;
107}
108#endif
NeilBrown1a9917c2006-03-27 01:15:02 -0800109static int ip_map_match(struct cache_head *corig, struct cache_head *cnew)
110{
111 struct ip_map *orig = container_of(corig, struct ip_map, h);
112 struct ip_map *new = container_of(cnew, struct ip_map, h);
113 return strcmp(orig->m_class, new->m_class) == 0
114 && orig->m_addr.s_addr == new->m_addr.s_addr;
115}
116static void ip_map_init(struct cache_head *cnew, struct cache_head *citem)
117{
118 struct ip_map *new = container_of(cnew, struct ip_map, h);
119 struct ip_map *item = container_of(citem, struct ip_map, h);
NeilBrown1f1e0302006-01-06 00:09:49 -0800120
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121 strcpy(new->m_class, item->m_class);
122 new->m_addr.s_addr = item->m_addr.s_addr;
123}
NeilBrown1a9917c2006-03-27 01:15:02 -0800124static void update(struct cache_head *cnew, struct cache_head *citem)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125{
NeilBrown1a9917c2006-03-27 01:15:02 -0800126 struct ip_map *new = container_of(cnew, struct ip_map, h);
127 struct ip_map *item = container_of(citem, struct ip_map, h);
128
NeilBrownefc36aa2006-03-27 01:14:59 -0800129 kref_get(&item->m_client->h.ref);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700130 new->m_client = item->m_client;
131 new->m_add_change = item->m_add_change;
132}
NeilBrown1a9917c2006-03-27 01:15:02 -0800133static struct cache_head *ip_map_alloc(void)
134{
135 struct ip_map *i = kmalloc(sizeof(*i), GFP_KERNEL);
136 if (i)
137 return &i->h;
138 else
139 return NULL;
140}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141
142static void ip_map_request(struct cache_detail *cd,
143 struct cache_head *h,
144 char **bpp, int *blen)
145{
146 char text_addr[20];
147 struct ip_map *im = container_of(h, struct ip_map, h);
Alexey Dobriyand8ed0292006-09-26 22:29:38 -0700148 __be32 addr = im->m_addr.s_addr;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149
150 snprintf(text_addr, 20, "%u.%u.%u.%u",
151 ntohl(addr) >> 24 & 0xff,
152 ntohl(addr) >> 16 & 0xff,
153 ntohl(addr) >> 8 & 0xff,
154 ntohl(addr) >> 0 & 0xff);
155
156 qword_add(bpp, blen, im->m_class);
157 qword_add(bpp, blen, text_addr);
158 (*bpp)[-1] = '\n';
159}
160
NeilBrown1a9917c2006-03-27 01:15:02 -0800161static struct ip_map *ip_map_lookup(char *class, struct in_addr addr);
162static int ip_map_update(struct ip_map *ipm, struct unix_domain *udom, time_t expiry);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163
164static int ip_map_parse(struct cache_detail *cd,
165 char *mesg, int mlen)
166{
167 /* class ipaddress [domainname] */
168 /* should be safe just to use the start of the input buffer
169 * for scratch: */
170 char *buf = mesg;
171 int len;
172 int b1,b2,b3,b4;
173 char c;
NeilBrown1a9917c2006-03-27 01:15:02 -0800174 char class[8];
175 struct in_addr addr;
176 int err;
177
178 struct ip_map *ipmp;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179 struct auth_domain *dom;
180 time_t expiry;
181
182 if (mesg[mlen-1] != '\n')
183 return -EINVAL;
184 mesg[mlen-1] = 0;
185
186 /* class */
NeilBrown1a9917c2006-03-27 01:15:02 -0800187 len = qword_get(&mesg, class, sizeof(class));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188 if (len <= 0) return -EINVAL;
189
190 /* ip address */
191 len = qword_get(&mesg, buf, mlen);
192 if (len <= 0) return -EINVAL;
193
194 if (sscanf(buf, "%u.%u.%u.%u%c", &b1, &b2, &b3, &b4, &c) != 4)
195 return -EINVAL;
196
197 expiry = get_expiry(&mesg);
198 if (expiry ==0)
199 return -EINVAL;
200
201 /* domainname, or empty for NEGATIVE */
202 len = qword_get(&mesg, buf, mlen);
203 if (len < 0) return -EINVAL;
204
205 if (len) {
206 dom = unix_domain_find(buf);
207 if (dom == NULL)
208 return -ENOENT;
209 } else
210 dom = NULL;
211
NeilBrown1a9917c2006-03-27 01:15:02 -0800212 addr.s_addr =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213 htonl((((((b1<<8)|b2)<<8)|b3)<<8)|b4);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214
NeilBrown1a9917c2006-03-27 01:15:02 -0800215 ipmp = ip_map_lookup(class,addr);
216 if (ipmp) {
217 err = ip_map_update(ipmp,
218 container_of(dom, struct unix_domain, h),
219 expiry);
220 } else
221 err = -ENOMEM;
222
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223 if (dom)
224 auth_domain_put(dom);
NeilBrown1a9917c2006-03-27 01:15:02 -0800225
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226 cache_flush();
NeilBrown1a9917c2006-03-27 01:15:02 -0800227 return err;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700228}
229
230static int ip_map_show(struct seq_file *m,
231 struct cache_detail *cd,
232 struct cache_head *h)
233{
234 struct ip_map *im;
235 struct in_addr addr;
236 char *dom = "-no-domain-";
237
238 if (h == NULL) {
239 seq_puts(m, "#class IP domain\n");
240 return 0;
241 }
242 im = container_of(h, struct ip_map, h);
243 /* class addr domain */
244 addr = im->m_addr;
245
246 if (test_bit(CACHE_VALID, &h->flags) &&
247 !test_bit(CACHE_NEGATIVE, &h->flags))
248 dom = im->m_client->h.name;
249
250 seq_printf(m, "%s %d.%d.%d.%d %s\n",
251 im->m_class,
Al Viro753ed902006-09-26 22:30:23 -0700252 ntohl(addr.s_addr) >> 24 & 0xff,
253 ntohl(addr.s_addr) >> 16 & 0xff,
254 ntohl(addr.s_addr) >> 8 & 0xff,
255 ntohl(addr.s_addr) >> 0 & 0xff,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700256 dom
257 );
258 return 0;
259}
260
261
262struct cache_detail ip_map_cache = {
Bruce Allanf35279d2005-09-06 15:17:08 -0700263 .owner = THIS_MODULE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264 .hash_size = IP_HASHMAX,
265 .hash_table = ip_table,
266 .name = "auth.unix.ip",
267 .cache_put = ip_map_put,
268 .cache_request = ip_map_request,
269 .cache_parse = ip_map_parse,
270 .cache_show = ip_map_show,
NeilBrown1a9917c2006-03-27 01:15:02 -0800271 .match = ip_map_match,
272 .init = ip_map_init,
273 .update = update,
274 .alloc = ip_map_alloc,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275};
276
NeilBrown1a9917c2006-03-27 01:15:02 -0800277static struct ip_map *ip_map_lookup(char *class, struct in_addr addr)
278{
279 struct ip_map ip;
280 struct cache_head *ch;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281
NeilBrown1a9917c2006-03-27 01:15:02 -0800282 strcpy(ip.m_class, class);
283 ip.m_addr = addr;
284 ch = sunrpc_cache_lookup(&ip_map_cache, &ip.h,
285 hash_str(class, IP_HASHBITS) ^
286 hash_ip((unsigned long)addr.s_addr));
287
288 if (ch)
289 return container_of(ch, struct ip_map, h);
290 else
291 return NULL;
292}
293
294static int ip_map_update(struct ip_map *ipm, struct unix_domain *udom, time_t expiry)
295{
296 struct ip_map ip;
297 struct cache_head *ch;
298
299 ip.m_client = udom;
300 ip.h.flags = 0;
301 if (!udom)
302 set_bit(CACHE_NEGATIVE, &ip.h.flags);
303 else {
304 ip.m_add_change = udom->addr_changes;
305 /* if this is from the legacy set_client system call,
306 * we need m_add_change to be one higher
307 */
308 if (expiry == NEVER)
309 ip.m_add_change++;
310 }
311 ip.h.expiry_time = expiry;
312 ch = sunrpc_cache_update(&ip_map_cache,
313 &ip.h, &ipm->h,
314 hash_str(ipm->m_class, IP_HASHBITS) ^
315 hash_ip((unsigned long)ipm->m_addr.s_addr));
316 if (!ch)
317 return -ENOMEM;
NeilBrownbaab9352006-03-27 01:15:09 -0800318 cache_put(ch, &ip_map_cache);
NeilBrown1a9917c2006-03-27 01:15:02 -0800319 return 0;
320}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321
322int auth_unix_add_addr(struct in_addr addr, struct auth_domain *dom)
323{
324 struct unix_domain *udom;
NeilBrown1a9917c2006-03-27 01:15:02 -0800325 struct ip_map *ipmp;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326
NeilBrownefc36aa2006-03-27 01:14:59 -0800327 if (dom->flavour != &svcauth_unix)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700328 return -EINVAL;
329 udom = container_of(dom, struct unix_domain, h);
NeilBrown1a9917c2006-03-27 01:15:02 -0800330 ipmp = ip_map_lookup("nfsd", addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700331
NeilBrown1a9917c2006-03-27 01:15:02 -0800332 if (ipmp)
333 return ip_map_update(ipmp, udom, NEVER);
334 else
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335 return -ENOMEM;
336}
337
338int auth_unix_forget_old(struct auth_domain *dom)
339{
340 struct unix_domain *udom;
341
NeilBrownefc36aa2006-03-27 01:14:59 -0800342 if (dom->flavour != &svcauth_unix)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343 return -EINVAL;
344 udom = container_of(dom, struct unix_domain, h);
345 udom->addr_changes++;
346 return 0;
347}
348
349struct auth_domain *auth_unix_lookup(struct in_addr addr)
350{
Greg Banks40f10522006-10-02 02:17:43 -0700351 struct ip_map *ipm;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352 struct auth_domain *rv;
353
NeilBrown1a9917c2006-03-27 01:15:02 -0800354 ipm = ip_map_lookup("nfsd", addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700355
356 if (!ipm)
357 return NULL;
358 if (cache_check(&ip_map_cache, &ipm->h, NULL))
359 return NULL;
360
361 if ((ipm->m_client->addr_changes - ipm->m_add_change) >0) {
362 if (test_and_set_bit(CACHE_NEGATIVE, &ipm->h.flags) == 0)
363 auth_domain_put(&ipm->m_client->h);
364 rv = NULL;
365 } else {
366 rv = &ipm->m_client->h;
NeilBrownefc36aa2006-03-27 01:14:59 -0800367 kref_get(&rv->ref);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368 }
NeilBrownbaab9352006-03-27 01:15:09 -0800369 cache_put(&ipm->h, &ip_map_cache);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700370 return rv;
371}
372
373void svcauth_unix_purge(void)
374{
375 cache_purge(&ip_map_cache);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376}
377
378static int
379svcauth_unix_set_client(struct svc_rqst *rqstp)
380{
NeilBrown1a9917c2006-03-27 01:15:02 -0800381 struct ip_map *ipm;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700382
383 rqstp->rq_client = NULL;
384 if (rqstp->rq_proc == 0)
385 return SVC_OK;
386
NeilBrown1a9917c2006-03-27 01:15:02 -0800387 ipm = ip_map_lookup(rqstp->rq_server->sv_program->pg_class,
388 rqstp->rq_addr.sin_addr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700389
390 if (ipm == NULL)
391 return SVC_DENIED;
392
393 switch (cache_check(&ip_map_cache, &ipm->h, &rqstp->rq_chandle)) {
394 default:
395 BUG();
396 case -EAGAIN:
397 return SVC_DROP;
398 case -ENOENT:
399 return SVC_DENIED;
400 case 0:
401 rqstp->rq_client = &ipm->m_client->h;
NeilBrownefc36aa2006-03-27 01:14:59 -0800402 kref_get(&rqstp->rq_client->ref);
NeilBrownbaab9352006-03-27 01:15:09 -0800403 cache_put(&ipm->h, &ip_map_cache);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404 break;
405 }
406 return SVC_OK;
407}
408
409static int
Alexey Dobriyand8ed0292006-09-26 22:29:38 -0700410svcauth_null_accept(struct svc_rqst *rqstp, __be32 *authp)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411{
412 struct kvec *argv = &rqstp->rq_arg.head[0];
413 struct kvec *resv = &rqstp->rq_res.head[0];
414 struct svc_cred *cred = &rqstp->rq_cred;
415
416 cred->cr_group_info = NULL;
417 rqstp->rq_client = NULL;
418
419 if (argv->iov_len < 3*4)
420 return SVC_GARBAGE;
421
422 if (svc_getu32(argv) != 0) {
423 dprintk("svc: bad null cred\n");
424 *authp = rpc_autherr_badcred;
425 return SVC_DENIED;
426 }
Alexey Dobriyan76994312006-09-26 22:28:46 -0700427 if (svc_getu32(argv) != htonl(RPC_AUTH_NULL) || svc_getu32(argv) != 0) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428 dprintk("svc: bad null verf\n");
429 *authp = rpc_autherr_badverf;
430 return SVC_DENIED;
431 }
432
433 /* Signal that mapping to nobody uid/gid is required */
434 cred->cr_uid = (uid_t) -1;
435 cred->cr_gid = (gid_t) -1;
436 cred->cr_group_info = groups_alloc(0);
437 if (cred->cr_group_info == NULL)
438 return SVC_DROP; /* kmalloc failure - client must retry */
439
440 /* Put NULL verifier */
Alexey Dobriyan76994312006-09-26 22:28:46 -0700441 svc_putnl(resv, RPC_AUTH_NULL);
442 svc_putnl(resv, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443
444 return SVC_OK;
445}
446
447static int
448svcauth_null_release(struct svc_rqst *rqstp)
449{
450 if (rqstp->rq_client)
451 auth_domain_put(rqstp->rq_client);
452 rqstp->rq_client = NULL;
453 if (rqstp->rq_cred.cr_group_info)
454 put_group_info(rqstp->rq_cred.cr_group_info);
455 rqstp->rq_cred.cr_group_info = NULL;
456
457 return 0; /* don't drop */
458}
459
460
461struct auth_ops svcauth_null = {
462 .name = "null",
463 .owner = THIS_MODULE,
464 .flavour = RPC_AUTH_NULL,
465 .accept = svcauth_null_accept,
466 .release = svcauth_null_release,
467 .set_client = svcauth_unix_set_client,
468};
469
470
471static int
Alexey Dobriyand8ed0292006-09-26 22:29:38 -0700472svcauth_unix_accept(struct svc_rqst *rqstp, __be32 *authp)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473{
474 struct kvec *argv = &rqstp->rq_arg.head[0];
475 struct kvec *resv = &rqstp->rq_res.head[0];
476 struct svc_cred *cred = &rqstp->rq_cred;
477 u32 slen, i;
478 int len = argv->iov_len;
479
480 cred->cr_group_info = NULL;
481 rqstp->rq_client = NULL;
482
483 if ((len -= 3*4) < 0)
484 return SVC_GARBAGE;
485
486 svc_getu32(argv); /* length */
487 svc_getu32(argv); /* time stamp */
Alexey Dobriyan76994312006-09-26 22:28:46 -0700488 slen = XDR_QUADLEN(svc_getnl(argv)); /* machname length */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489 if (slen > 64 || (len -= (slen + 3)*4) < 0)
490 goto badcred;
Alexey Dobriyand8ed0292006-09-26 22:29:38 -0700491 argv->iov_base = (void*)((__be32*)argv->iov_base + slen); /* skip machname */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700492 argv->iov_len -= slen*4;
493
Alexey Dobriyan76994312006-09-26 22:28:46 -0700494 cred->cr_uid = svc_getnl(argv); /* uid */
495 cred->cr_gid = svc_getnl(argv); /* gid */
496 slen = svc_getnl(argv); /* gids length */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497 if (slen > 16 || (len -= (slen + 2)*4) < 0)
498 goto badcred;
499 cred->cr_group_info = groups_alloc(slen);
500 if (cred->cr_group_info == NULL)
501 return SVC_DROP;
502 for (i = 0; i < slen; i++)
Alexey Dobriyan76994312006-09-26 22:28:46 -0700503 GROUP_AT(cred->cr_group_info, i) = svc_getnl(argv);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700504
Alexey Dobriyan76994312006-09-26 22:28:46 -0700505 if (svc_getu32(argv) != htonl(RPC_AUTH_NULL) || svc_getu32(argv) != 0) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700506 *authp = rpc_autherr_badverf;
507 return SVC_DENIED;
508 }
509
510 /* Put NULL verifier */
Alexey Dobriyan76994312006-09-26 22:28:46 -0700511 svc_putnl(resv, RPC_AUTH_NULL);
512 svc_putnl(resv, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700513
514 return SVC_OK;
515
516badcred:
517 *authp = rpc_autherr_badcred;
518 return SVC_DENIED;
519}
520
521static int
522svcauth_unix_release(struct svc_rqst *rqstp)
523{
524 /* Verifier (such as it is) is already in place.
525 */
526 if (rqstp->rq_client)
527 auth_domain_put(rqstp->rq_client);
528 rqstp->rq_client = NULL;
529 if (rqstp->rq_cred.cr_group_info)
530 put_group_info(rqstp->rq_cred.cr_group_info);
531 rqstp->rq_cred.cr_group_info = NULL;
532
533 return 0;
534}
535
536
537struct auth_ops svcauth_unix = {
538 .name = "unix",
539 .owner = THIS_MODULE,
540 .flavour = RPC_AUTH_UNIX,
541 .accept = svcauth_unix_accept,
542 .release = svcauth_unix_release,
543 .domain_release = svcauth_unix_domain_release,
544 .set_client = svcauth_unix_set_client,
545};
546