| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: p2k.c,v 1.11 2009/04/02 09:30:41 pooka Exp $ */ | | 1 | /* $NetBSD: p2k.c,v 1.12 2009/05/03 17:10:20 pooka Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2007 Antti Kantee. All Rights Reserved. | | 4 | * Copyright (c) 2007 Antti Kantee. All Rights Reserved. |
5 | * | | 5 | * |
6 | * Development of this software was supported by Google Summer of Code. | | 6 | * Development of this software was supported by Google Summer of Code. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -74,27 +74,27 @@ cred_create(const struct puffs_cred *pcr | | | @@ -74,27 +74,27 @@ cred_create(const struct puffs_cred *pcr |
74 | uid = 0; | | 74 | uid = 0; |
75 | if (puffs_cred_getgid(pcr, &gid) == -1) | | 75 | if (puffs_cred_getgid(pcr, &gid) == -1) |
76 | gid = 0; | | 76 | gid = 0; |
77 | puffs_cred_getgroups(pcr, groups, &ngroups); | | 77 | puffs_cred_getgroups(pcr, groups, &ngroups); |
78 | | | 78 | |
79 | /* LINTED: ngroups is ok */ | | 79 | /* LINTED: ngroups is ok */ |
80 | return rump_cred_create(uid, gid, ngroups, groups); | | 80 | return rump_cred_create(uid, gid, ngroups, groups); |
81 | } | | 81 | } |
82 | | | 82 | |
83 | static __inline void | | 83 | static __inline void |
84 | cred_destroy(kauth_cred_t cred) | | 84 | cred_destroy(kauth_cred_t cred) |
85 | { | | 85 | { |
86 | | | 86 | |
87 | rump_cred_destroy(cred); | | 87 | rump_cred_put(cred); |
88 | } | | 88 | } |
89 | | | 89 | |
90 | static struct componentname * | | 90 | static struct componentname * |
91 | makecn(const struct puffs_cn *pcn) | | 91 | makecn(const struct puffs_cn *pcn) |
92 | { | | 92 | { |
93 | kauth_cred_t cred; | | 93 | kauth_cred_t cred; |
94 | | | 94 | |
95 | cred = cred_create(pcn->pcn_cred); | | 95 | cred = cred_create(pcn->pcn_cred); |
96 | /* LINTED: prehistoric types in first two args */ | | 96 | /* LINTED: prehistoric types in first two args */ |
97 | return rump_makecn(pcn->pcn_nameiop, pcn->pcn_flags, pcn->pcn_name, | | 97 | return rump_makecn(pcn->pcn_nameiop, pcn->pcn_flags, pcn->pcn_name, |
98 | pcn->pcn_namelen, cred, curlwp); | | 98 | pcn->pcn_namelen, cred, curlwp); |
99 | } | | 99 | } |
100 | | | 100 | |