chat.c (55145) | chat.c (55252) |
---|---|
1/*- 2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/usr.sbin/ppp/chat.c 55145 1999-12-27 11:43:31Z brian $ | 26 * $FreeBSD: head/usr.sbin/ppp/chat.c 55252 1999-12-30 03:36:11Z brian $ |
27 */ 28 29#include <sys/param.h> 30#include <netinet/in.h> 31#include <netinet/in_systm.h> 32#include <netinet/ip.h> 33#include <sys/un.h> 34 --- 691 unchanged lines hidden (view full) --- 726 dup2(physical->fd, STDIN_FILENO); 727 dup2(fids[1], STDERR_FILENO); 728 dup2(STDIN_FILENO, STDOUT_FILENO); 729 close(3); 730 if (open(_PATH_TTY, O_RDWR) != 3) 731 open(_PATH_DEVNULL, O_RDWR); /* Leave it closed if it fails... */ 732 for (i = getdtablesize(); i > 3; i--) 733 fcntl(i, F_SETFD, 1); | 27 */ 28 29#include <sys/param.h> 30#include <netinet/in.h> 31#include <netinet/in_systm.h> 32#include <netinet/ip.h> 33#include <sys/un.h> 34 --- 691 unchanged lines hidden (view full) --- 726 dup2(physical->fd, STDIN_FILENO); 727 dup2(fids[1], STDERR_FILENO); 728 dup2(STDIN_FILENO, STDOUT_FILENO); 729 close(3); 730 if (open(_PATH_TTY, O_RDWR) != 3) 731 open(_PATH_DEVNULL, O_RDWR); /* Leave it closed if it fails... */ 732 for (i = getdtablesize(); i > 3; i--) 733 fcntl(i, F_SETFD, 1); |
734 setuid(geteuid()); | 734 setuid(ID0realuid()); |
735 execvp(argv[0], argv); 736 fprintf(stderr, "execvp: %s: %s\n", argv[0], strerror(errno)); 737 _exit(127); 738 } else { 739 char *name = strdup(vector[0]); 740 741 close(fids[1]); 742 endout = out + olen - 1; --- 42 unchanged lines hidden --- | 735 execvp(argv[0], argv); 736 fprintf(stderr, "execvp: %s: %s\n", argv[0], strerror(errno)); 737 _exit(127); 738 } else { 739 char *name = strdup(vector[0]); 740 741 close(fids[1]); 742 endout = out + olen - 1; --- 42 unchanged lines hidden --- |