rshd.c (141589) | rshd.c (141918) |
---|---|
1/*- 2 * Copyright (c) 1988, 1989, 1992, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 2002 Networks Associates Technology, Inc. 5 * All rights reserved. 6 * 7 * Portions of this software were developed for the FreeBSD Project by 8 * ThinkSec AS and NAI Labs, the Security Research Division of Network --- 37 unchanged lines hidden (view full) --- 46 47#ifndef lint 48#if 0 49static const char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; 50#endif 51#endif /* not lint */ 52 53#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1988, 1989, 1992, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * Copyright (c) 2002 Networks Associates Technology, Inc. 5 * All rights reserved. 6 * 7 * Portions of this software were developed for the FreeBSD Project by 8 * ThinkSec AS and NAI Labs, the Security Research Division of Network --- 37 unchanged lines hidden (view full) --- 46 47#ifndef lint 48#if 0 49static const char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; 50#endif 51#endif /* not lint */ 52 53#include <sys/cdefs.h> |
54__FBSDID("$FreeBSD: head/libexec/rshd/rshd.c 141589 2005-02-09 20:36:12Z ru $"); | 54__FBSDID("$FreeBSD: head/libexec/rshd/rshd.c 141918 2005-02-14 17:42:58Z stefanf $"); |
55 56/* 57 * remote shell server: 58 * [port]\0 59 * ruser\0 60 * luser\0 61 * command\0 62 * data --- 59 unchanged lines hidden (view full) --- 122 123#define OPTIONS "aDLln" 124 125int 126main(int argc, char *argv[]) 127{ 128 extern int __check_rhosts_file; 129 struct linger linger; | 55 56/* 57 * remote shell server: 58 * [port]\0 59 * ruser\0 60 * luser\0 61 * command\0 62 * data --- 59 unchanged lines hidden (view full) --- 122 123#define OPTIONS "aDLln" 124 125int 126main(int argc, char *argv[]) 127{ 128 extern int __check_rhosts_file; 129 struct linger linger; |
130 int ch, on = 1, fromlen; | 130 socklen_t fromlen; 131 int ch, on = 1; |
131 struct sockaddr_storage from; 132 133 openlog("rshd", LOG_PID | LOG_ODELAY, LOG_DAEMON); 134 135 opterr = 0; 136 while ((ch = getopt(argc, argv, OPTIONS)) != -1) 137 switch (ch) { 138 case 'a': --- 74 unchanged lines hidden (view full) --- 213 numericname, sizeof numericname); 214 } else { 215 syslog(LOG_ERR, "malformed \"from\" address (af %d)", af); 216 exit(1); 217 } 218#ifdef IP_OPTIONS 219 if (af == AF_INET) { 220 u_char optbuf[BUFSIZ/3]; | 132 struct sockaddr_storage from; 133 134 openlog("rshd", LOG_PID | LOG_ODELAY, LOG_DAEMON); 135 136 opterr = 0; 137 while ((ch = getopt(argc, argv, OPTIONS)) != -1) 138 switch (ch) { 139 case 'a': --- 74 unchanged lines hidden (view full) --- 214 numericname, sizeof numericname); 215 } else { 216 syslog(LOG_ERR, "malformed \"from\" address (af %d)", af); 217 exit(1); 218 } 219#ifdef IP_OPTIONS 220 if (af == AF_INET) { 221 u_char optbuf[BUFSIZ/3]; |
221 int optsize = sizeof(optbuf), ipproto, i; | 222 socklen_t optsize = sizeof(optbuf), ipproto, i; |
222 struct protoent *ip; 223 224 if ((ip = getprotobyname("ip")) != NULL) 225 ipproto = ip->p_proto; 226 else 227 ipproto = IPPROTO_IP; 228 if (!getsockopt(0, ipproto, IP_OPTIONS, optbuf, &optsize) && 229 optsize != 0) { --- 358 unchanged lines hidden --- | 223 struct protoent *ip; 224 225 if ((ip = getprotobyname("ip")) != NULL) 226 ipproto = ip->p_proto; 227 else 228 ipproto = IPPROTO_IP; 229 if (!getsockopt(0, ipproto, IP_OPTIONS, optbuf, &optsize) && 230 optsize != 0) { --- 358 unchanged lines hidden --- |