Introduce $TAR_RSH to enable use of ssh as transport.
This commit is contained in:
parent
f245d81e46
commit
3044e76324
@ -8,7 +8,7 @@ CFLAGS+= -DRETSIGTYPE=void -DDIRENT=1 -DHAVE_SYS_MTIO_H=1 -DHAVE_UNISTD_H=1
|
||||
CFLAGS+= -DHAVE_GETGRGID=1 -DHAVE_GETPWUID=1 -DHAVE_STRING_H=1
|
||||
CFLAGS+= -DHAVE_LIMITS_H=1 -DHAVE_STRSTR=1 -DHAVE_VALLOC=1 -DHAVE_MKDIR=1
|
||||
CFLAGS+= -DHAVE_MKNOD=1 -DHAVE_RENAME=1 -DHAVE_FTRUNCATE=1 -DHAVE_GETCWD=1
|
||||
CFLAGS+= -DBSD42=1 -DHAVE_VPRINTF=1 -DNEEDPAD -I${.CURDIR}
|
||||
CFLAGS+= -DBSD42=1 -DHAVE_VPRINTF=1 -DNEEDPAD -DSTDC_HEADERS=1 -I${.CURDIR}
|
||||
CFLAGS+= -DDEF_AR_FILE=\"/dev/sa0\" -DDEFBLOCKING=20
|
||||
YFLAGS=
|
||||
NOSHARED?=yes
|
||||
|
@ -31,6 +31,8 @@
|
||||
Modified to make all rmtXXX calls into macros for speed by Jay Fenlason.
|
||||
Use -DHAVE_NETDB_H for rexec code, courtesy of Dan Kegel, srs!dan. */
|
||||
|
||||
/* $FreeBSD$ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <signal.h>
|
||||
@ -276,6 +278,7 @@ __rmt_open (path, oflag, mode, bias)
|
||||
char device[CMDBUFSIZE]; /* The remote device name. */
|
||||
char login[CMDBUFSIZE]; /* The remote user name. */
|
||||
char *sys, *dev, *user; /* For copying into the above buffers. */
|
||||
char *tar_rsh;
|
||||
|
||||
sys = system;
|
||||
dev = device;
|
||||
@ -370,19 +373,31 @@ __rmt_open (path, oflag, mode, bias)
|
||||
setuid (getuid ());
|
||||
setgid (getgid ());
|
||||
|
||||
tar_rsh = getenv("TAR_RSH");
|
||||
|
||||
if (*login)
|
||||
{
|
||||
execl ("/usr/bin/rsh", "rsh", "-l", login, system,
|
||||
"/etc/rmt", (char *) 0);
|
||||
execlp ("rsh", "rsh", "-l", login, system,
|
||||
"/etc/rmt", (char *) 0);
|
||||
if (tar_rsh) {
|
||||
execlp (tar_rsh, tar_rsh, "-l", login, system,
|
||||
"/etc/rmt", (char *) 0);
|
||||
} else {
|
||||
execl ("/usr/bin/rsh", "rsh", "-l", login, system,
|
||||
"/etc/rmt", (char *) 0);
|
||||
execlp ("rsh", "rsh", "-l", login, system,
|
||||
"/etc/rmt", (char *) 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
execl ("/usr/bin/rsh", "rsh", system,
|
||||
"/etc/rmt", (char *) 0);
|
||||
execlp ("rsh", "rsh", system,
|
||||
"/etc/rmt", (char *) 0);
|
||||
if (tar_rsh) {
|
||||
execlp (tar_rsh, tar_rsh, system,
|
||||
"/etc/rmt", (char *) 0);
|
||||
} else {
|
||||
execl ("/usr/bin/rsh", "rsh", system,
|
||||
"/etc/rmt", (char *) 0);
|
||||
execlp ("rsh", "rsh", system,
|
||||
"/etc/rmt", (char *) 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Bad problems if we get here. */
|
||||
|
@ -483,6 +483,10 @@ Changes
|
||||
default tape drive (which is still overridden by the
|
||||
.Fl f
|
||||
flag).
|
||||
.It TAR_RSH
|
||||
The TAR_RSH environment variable allows you to override the default
|
||||
shell used as the transport for
|
||||
.Nm tar.
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width "/dev/sa0"
|
||||
|
Loading…
Reference in New Issue
Block a user