rtsol.c (119026) | rtsol.c (124524) |
---|---|
1/* $KAME: rtsol.c,v 1.26 2003/05/27 06:48:27 jinmei Exp $ */ | 1/* $KAME: rtsol.c,v 1.27 2003/10/05 00:09:36 itojun Exp $ */ |
2 3/* 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: --- 13 unchanged lines hidden (view full) --- 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * | 2 3/* 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: --- 13 unchanged lines hidden (view full) --- 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * |
31 * $FreeBSD: head/usr.sbin/rtsold/rtsol.c 119026 2003-08-17 11:11:32Z ume $ | 31 * $FreeBSD: head/usr.sbin/rtsold/rtsol.c 124524 2004-01-14 17:16:19Z ume $ |
32 */ 33 34#include <sys/param.h> 35#include <sys/socket.h> 36#include <sys/uio.h> 37#include <sys/time.h> 38#include <sys/queue.h> 39#include <sys/wait.h> --- 34 unchanged lines hidden (view full) --- 74 75static struct sockaddr_in6 sin6_allrouters = 76{sizeof(sin6_allrouters), AF_INET6}; 77 78static void call_script __P((char *, char *)); 79static int safefile __P((const char *)); 80 81int | 32 */ 33 34#include <sys/param.h> 35#include <sys/socket.h> 36#include <sys/uio.h> 37#include <sys/time.h> 38#include <sys/queue.h> 39#include <sys/wait.h> --- 34 unchanged lines hidden (view full) --- 74 75static struct sockaddr_in6 sin6_allrouters = 76{sizeof(sin6_allrouters), AF_INET6}; 77 78static void call_script __P((char *, char *)); 79static int safefile __P((const char *)); 80 81int |
82sockopen() | 82sockopen(void) |
83{ 84 static u_char *rcvcmsgbuf = NULL, *sndcmsgbuf = NULL; 85 int sndcmsglen, on; 86 static u_char answer[1500]; 87 struct icmp6_filter filt; 88 89 sndcmsglen = rcvcmsglen = CMSG_SPACE(sizeof(struct in6_pktinfo)) + 90 CMSG_SPACE(sizeof(int)); --- 273 unchanged lines hidden (view full) --- 364 ifi->state = IFS_IDLE; 365 ifi->probes = 0; 366 rtsol_timer_update(ifi); 367 break; 368 } 369} 370 371static void | 83{ 84 static u_char *rcvcmsgbuf = NULL, *sndcmsgbuf = NULL; 85 int sndcmsglen, on; 86 static u_char answer[1500]; 87 struct icmp6_filter filt; 88 89 sndcmsglen = rcvcmsglen = CMSG_SPACE(sizeof(struct in6_pktinfo)) + 90 CMSG_SPACE(sizeof(int)); --- 273 unchanged lines hidden (view full) --- 364 ifi->state = IFS_IDLE; 365 ifi->probes = 0; 366 rtsol_timer_update(ifi); 367 break; 368 } 369} 370 371static void |
372call_script(scriptpath, ifname) 373 char *scriptpath, *ifname; | 372call_script(char *scriptpath, char *ifname) |
374{ 375 pid_t pid, wpid; 376 377 if (scriptpath == NULL) 378 return; 379 380 /* launch the script */ 381 pid = fork(); --- 44 unchanged lines hidden (view full) --- 426 strerror(errno)); 427 exit(0); 428 } 429 430 return; 431} 432 433static int | 373{ 374 pid_t pid, wpid; 375 376 if (scriptpath == NULL) 377 return; 378 379 /* launch the script */ 380 pid = fork(); --- 44 unchanged lines hidden (view full) --- 425 strerror(errno)); 426 exit(0); 427 } 428 429 return; 430} 431 432static int |
434safefile(path) 435 const char *path; | 433safefile(const char *path) |
436{ 437 struct stat s; 438 uid_t myuid; 439 440 /* no setuid */ 441 if (getuid() != geteuid()) { 442 warnmsg(LOG_NOTICE, __func__, 443 "setuid'ed execution not allowed\n"); --- 29 unchanged lines hidden --- | 434{ 435 struct stat s; 436 uid_t myuid; 437 438 /* no setuid */ 439 if (getuid() != geteuid()) { 440 warnmsg(LOG_NOTICE, __func__, 441 "setuid'ed execution not allowed\n"); --- 29 unchanged lines hidden --- |