diff options
author | Yoshinobu Inoue <shin@FreeBSD.org> | 2000-02-15 15:11:40 +0000 |
---|---|---|
committer | Yoshinobu Inoue <shin@FreeBSD.org> | 2000-02-15 15:11:40 +0000 |
commit | 1132b408c592a6681bca15d2ce53eff8cc608c78 (patch) | |
tree | c2c6fe8f895f76c6fd4c1c6934c5845f2ddb4079 /usr.bin/rsh | |
parent | f5abb8467c0bdac41477465058f9bb5b2ccd82b3 (diff) | |
download | src-1132b408c592a6681bca15d2ce53eff8cc608c78.tar.gz src-1132b408c592a6681bca15d2ce53eff8cc608c78.zip |
Notes
Diffstat (limited to 'usr.bin/rsh')
-rw-r--r-- | usr.bin/rsh/rsh.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/usr.bin/rsh/rsh.c b/usr.bin/rsh/rsh.c index aecb81888e7c..69579ffe9240 100644 --- a/usr.bin/rsh/rsh.c +++ b/usr.bin/rsh/rsh.c @@ -85,6 +85,8 @@ extern char *krb_realmofhost(); */ int rfd2; +int family = PF_UNSPEC; + char *copyargs __P((char **)); void sendsig __P((int)); void talk __P((int, long, pid_t, int, int)); @@ -129,15 +131,23 @@ main(argc, argv) #ifdef KERBEROS #ifdef CRYPT -#define OPTIONS "8KLde:k:l:nt:wx" +#define OPTIONS "468KLde:k:l:nt:wx" #else -#define OPTIONS "8KLde:k:l:nt:w" +#define OPTIONS "468KLde:k:l:nt:w" #endif #else -#define OPTIONS "8KLde:l:nt:w" +#define OPTIONS "468KLde:l:nt:w" #endif while ((ch = getopt(argc - argoff, argv + argoff, OPTIONS)) != -1) switch(ch) { + case '4': + family = PF_INET; + break; + + case '6': + family = PF_INET6; + break; + case 'K': #ifdef KERBEROS use_kerberos = 0; @@ -270,11 +280,11 @@ try_connect: if (doencrypt) errx(1, "the -x flag requires Kerberos authentication"); rem = rcmd_af(&host, sp->s_port, pw->pw_name, user, args, - &rfd2, PF_UNSPEC); + &rfd2, family); } #else rem = rcmd_af(&host, sp->s_port, pw->pw_name, user, args, &rfd2, - PF_UNSPEC); + family); #endif if (rem < 0) @@ -479,7 +489,7 @@ usage() { (void)fprintf(stderr, - "usage: rsh [-nd%s]%s[-l login] [-t timeout] host [command]\n", + "usage: rsh [-46] [-nd%s]%s[-l login] [-t timeout] host [command]\n", #ifdef KERBEROS #ifdef CRYPT "x", " [-k realm] "); |