rcp.c (90110) | rcp.c (96196) |
---|---|
1/* 2 * Copyright (c) 1983, 1990, 1992, 1993 3 * The Regents of the University of California. All rights reserved. | 1/* 2 * Copyright (c) 1983, 1990, 1992, 1993 3 * The Regents of the University of California. All rights reserved. |
4 * Copyright (c) 2002 Networks Associates Technology, Inc. 5 * All rights reserved. |
|
4 * | 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 9 * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 10 * ("CBOSS"), as part of the DARPA CHATS research program. 11 * |
|
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 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. --- 24 unchanged lines hidden (view full) --- 37 The Regents of the University of California. All rights reserved.\n"; 38#endif /* not lint */ 39 40#ifndef lint 41#if 0 42static char sccsid[] = "@(#)rcp.c 8.2 (Berkeley) 4/2/94"; 43#endif 44static const char rcsid[] = | 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 * 1. Redistributions of source code must retain the above copyright 16 * notice, this list of conditions and the following disclaimer. 17 * 2. Redistributions in binary form must reproduce the above copyright 18 * notice, this list of conditions and the following disclaimer in the 19 * documentation and/or other materials provided with the distribution. --- 24 unchanged lines hidden (view full) --- 44 The Regents of the University of California. All rights reserved.\n"; 45#endif /* not lint */ 46 47#ifndef lint 48#if 0 49static char sccsid[] = "@(#)rcp.c 8.2 (Berkeley) 4/2/94"; 50#endif 51static const char rcsid[] = |
45 "$FreeBSD: head/bin/rcp/rcp.c 90110 2002-02-02 06:48:10Z imp $"; | 52 "$FreeBSD: head/bin/rcp/rcp.c 96196 2002-05-08 00:47:01Z des $"; |
46#endif /* not lint */ 47 48#include <sys/param.h> 49#include <sys/stat.h> 50#include <sys/time.h> 51#include <sys/socket.h> 52#include <netinet/in.h> 53#include <netinet/in_systm.h> 54#include <netinet/ip.h> 55 56#include <ctype.h> 57#include <dirent.h> 58#include <err.h> 59#include <errno.h> 60#include <fcntl.h> 61#include <libutil.h> 62#include <limits.h> 63#include <netdb.h> | 53#endif /* not lint */ 54 55#include <sys/param.h> 56#include <sys/stat.h> 57#include <sys/time.h> 58#include <sys/socket.h> 59#include <netinet/in.h> 60#include <netinet/in_systm.h> 61#include <netinet/ip.h> 62 63#include <ctype.h> 64#include <dirent.h> 65#include <err.h> 66#include <errno.h> 67#include <fcntl.h> 68#include <libutil.h> 69#include <limits.h> 70#include <netdb.h> |
71#include <paths.h> |
|
64#include <pwd.h> 65#include <signal.h> 66#include <stdio.h> 67#include <stdlib.h> 68#include <string.h> 69#include <string.h> 70#include <unistd.h> 71 | 72#include <pwd.h> 73#include <signal.h> 74#include <stdio.h> 75#include <stdlib.h> 76#include <string.h> 77#include <string.h> 78#include <unistd.h> 79 |
72#include "pathnames.h" | |
73#include "extern.h" 74 75#ifdef KERBEROS 76#include <openssl/des.h> 77#include <krb.h> 78#include "bsd_locl.h" 79 80char dst_realm_buf[REALM_SZ]; 81char *dest_realm = NULL; 82int use_kerberos = 1; | 80#include "extern.h" 81 82#ifdef KERBEROS 83#include <openssl/des.h> 84#include <krb.h> 85#include "bsd_locl.h" 86 87char dst_realm_buf[REALM_SZ]; 88char *dest_realm = NULL; 89int use_kerberos = 1; |
83CREDENTIALS cred; | 90CREDENTIALS cred; |
84Key_schedule schedule; 85extern char *krb_realmofhost(); 86#ifdef CRYPT 87int doencrypt = 0; 88#define OPTIONS "dfKk:prtx" 89#else 90#define OPTIONS "dfKk:prt" 91#endif --- 332 unchanged lines hidden (view full) --- 424 struct stat stb; 425 static BUF buffer; 426 BUF *bp; 427 off_t i; 428 int amt, fd, haderr, indx, result; 429 char *last, *name, buf[BUFSIZ]; 430 431 for (indx = 0; indx < argc; ++indx) { | 91Key_schedule schedule; 92extern char *krb_realmofhost(); 93#ifdef CRYPT 94int doencrypt = 0; 95#define OPTIONS "dfKk:prtx" 96#else 97#define OPTIONS "dfKk:prt" 98#endif --- 332 unchanged lines hidden (view full) --- 431 struct stat stb; 432 static BUF buffer; 433 BUF *bp; 434 off_t i; 435 int amt, fd, haderr, indx, result; 436 char *last, *name, buf[BUFSIZ]; 437 438 for (indx = 0; indx < argc; ++indx) { |
432 name = argv[indx]; | 439 name = argv[indx]; |
433 if ((fd = open(name, O_RDONLY, 0)) < 0) 434 goto syserr; 435 if (fstat(fd, &stb)) { 436syserr: run_err("%s: %s", name, strerror(errno)); 437 goto next; 438 } 439 switch (stb.st_mode & S_IFMT) { 440 case S_IFREG: --- 482 unchanged lines hidden --- | 440 if ((fd = open(name, O_RDONLY, 0)) < 0) 441 goto syserr; 442 if (fstat(fd, &stb)) { 443syserr: run_err("%s: %s", name, strerror(errno)); 444 goto next; 445 } 446 switch (stb.st_mode & S_IFMT) { 447 case S_IFREG: --- 482 unchanged lines hidden --- |