obscure cases, but also the blindingly obvious ones...
SCCS-vsn: bin/rcp/rcp.c 5.17
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)rcp.c 5.16 (Berkeley) %G%";
+static char sccsid[] = "@(#)rcp.c 5.17 (Berkeley) %G%";
{
extern int optind;
struct servent *sp;
{
extern int optind;
struct servent *sp;
char *targ, *colon();
struct passwd *getpwuid();
int lostconn();
char *targ, *colon();
struct passwd *getpwuid();
int lostconn();
while ((ch = getopt(argc, argv, "dfkprtx")) != EOF)
switch(ch) {
case 'd':
targetshouldbedirectory = 1;
break;
case 'f': /* "from" */
while ((ch = getopt(argc, argv, "dfkprtx")) != EOF)
switch(ch) {
case 'd':
targetshouldbedirectory = 1;
break;
case 'f': /* "from" */
- iamremote = 1;
- (void)response();
- (void)setuid(userid);
- source(--argc, ++argv);
- exit(errs);
#ifdef KERBEROS
case 'k':
strncpy(krb_realm, ++argv, REALM_SZ);
#ifdef KERBEROS
case 'k':
strncpy(krb_realm, ++argv, REALM_SZ);
++iamrecursive;
break;
case 't': /* "to" */
++iamrecursive;
break;
case 't': /* "to" */
- iamremote = 1;
- (void)setuid(userid);
- sink(--argc, ++argv);
- exit(errs);
#ifdef KERBEROS
case 'x':
encrypt = 1;
#ifdef KERBEROS
case 'x':
encrypt = 1;
argc -= optind;
argv += optind;
argc -= optind;
argv += optind;
+ if (fflag) {
+ iamremote = 1;
+ (void)response();
+ (void)setuid(userid);
+ source(argc, argv);
+ exit(errs);
+ }
+
+ if (tflag) {
+ iamremote = 1;
+ (void)setuid(userid);
+ sink(argc, argv);
+ exit(errs);
+ }
+
if (argc < 2)
usage();
if (argc > 2)
if (argc < 2)
usage();
if (argc > 2)