kern.c (83653) | kern.c (86186) |
---|---|
1/*- 2 * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 12 unchanged lines hidden (view full) --- 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * from BSDI kern.c,v 1.2 1998/11/25 22:38:27 don Exp | 1/*- 2 * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 12 unchanged lines hidden (view full) --- 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * from BSDI kern.c,v 1.2 1998/11/25 22:38:27 don Exp |
29 * $FreeBSD: head/usr.sbin/rpc.lockd/kern.c 83653 2001-09-18 23:34:44Z peter $ | 29 * $FreeBSD: head/usr.sbin/rpc.lockd/kern.c 86186 2001-11-08 10:33:41Z alfred $ |
30 */ 31 32#include <sys/param.h> 33#include <sys/mount.h> 34#include <sys/queue.h> 35#include <sys/socket.h> 36#include <sys/stat.h> 37 --- 177 unchanged lines hidden (view full) --- 215 /* Reached only on error. */ 216err: 217 (void)lockd_seteuid(0); 218 (void)unlink(_PATH_LCKFIFO); 219 _exit (1); 220} 221 222void | 30 */ 31 32#include <sys/param.h> 33#include <sys/mount.h> 34#include <sys/queue.h> 35#include <sys/socket.h> 36#include <sys/stat.h> 37 --- 177 unchanged lines hidden (view full) --- 215 /* Reached only on error. */ 216err: 217 (void)lockd_seteuid(0); 218 (void)unlink(_PATH_LCKFIFO); 219 _exit (1); 220} 221 222void |
223set_auth( 224 CLIENT *cl, 225 struct ucred *ucred 226) | 223set_auth(cl, ucred) 224 CLIENT *cl; 225 struct ucred *ucred; |
227{ 228 if (cl->cl_auth != NULL) 229 cl->cl_auth->ah_ops->ah_destroy(cl->cl_auth); 230 cl->cl_auth = authunix_create(hostname, 231 ucred->cr_uid, 232 ucred->cr_groups[0], 233 ucred->cr_ngroups-1, 234 &ucred->cr_groups[1]); --- 209 unchanged lines hidden (view full) --- 444 if (netcookie->n_len != sizeof(ans.la_msg_ident)) { 445 if (pid == -1) { /* we're screwed */ 446 syslog(LOG_ERR, "inedible nlm cookie"); 447 return -1; 448 } 449 ans.la_msg_ident.pid = pid; 450 ans.la_msg_ident.msg_seq = -1; 451 } else { | 226{ 227 if (cl->cl_auth != NULL) 228 cl->cl_auth->ah_ops->ah_destroy(cl->cl_auth); 229 cl->cl_auth = authunix_create(hostname, 230 ucred->cr_uid, 231 ucred->cr_groups[0], 232 ucred->cr_ngroups-1, 233 &ucred->cr_groups[1]); --- 209 unchanged lines hidden (view full) --- 443 if (netcookie->n_len != sizeof(ans.la_msg_ident)) { 444 if (pid == -1) { /* we're screwed */ 445 syslog(LOG_ERR, "inedible nlm cookie"); 446 return -1; 447 } 448 ans.la_msg_ident.pid = pid; 449 ans.la_msg_ident.msg_seq = -1; 450 } else { |
452 memcpy(&ans.la_msg_ident, netcookie->n_bytes, 453 sizeof(ans.la_msg_ident)); | 451 memcpy(&ans.la_msg_ident, netcookie->n_bytes, 452 sizeof(ans.la_msg_ident)); |
454 } 455 456 if (d_calls) 457 syslog(LOG_DEBUG, "lock answer: pid %lu: %s %d", 458 ans.la_msg_ident.pid, 459 version == NLM_VERS4 ? "nlmv4" : "nlmv3", 460 result); 461 --- 122 unchanged lines hidden --- | 453 } 454 455 if (d_calls) 456 syslog(LOG_DEBUG, "lock answer: pid %lu: %s %d", 457 ans.la_msg_ident.pid, 458 version == NLM_VERS4 ? "nlmv4" : "nlmv3", 459 result); 460 --- 122 unchanged lines hidden --- |