summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-07-22 06:59:40 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-07-22 06:59:40 +0000
commitce513b9ea5f11e15aa04e3a5ad45ee23cf7d55f5 (patch)
tree3ed8354019f28ba631fef424a8d095424b6c204e
parentd6d8429ebb0802a2585b8a8b4dc7df7a29e33898 (diff)
Use our rcmdsh(3) and support $RSH.
-rw-r--r--usr.bin/rdist/Makefile4
-rw-r--r--usr.bin/rdist/docmd.c9
-rw-r--r--usr.bin/rdist/os-openbsd.h8
-rw-r--r--usr.bin/rdist/rdist.15
-rw-r--r--usr.bin/rdist/rdist.c9
5 files changed, 18 insertions, 17 deletions
diff --git a/usr.bin/rdist/Makefile b/usr.bin/rdist/Makefile
index c57652a8b1e..c7381ed0fc5 100644
--- a/usr.bin/rdist/Makefile
+++ b/usr.bin/rdist/Makefile
@@ -1,11 +1,11 @@
-# $OpenBSD: Makefile,v 1.8 1997/04/27 13:01:27 downsj Exp $
+# $OpenBSD: Makefile,v 1.9 1997/07/22 06:59:37 millert Exp $
#
# from: @(#)Makefile 5.11 (Berkeley) 3/12/91
PROG= rdist
CFLAGS+=-I. -DOS_H=\"os-openbsd.h\"
SRCS= gram.y child.c client.c common.c distopt.c docmd.c expand.c \
- isexec.c lookup.c message.c rdist.c rshrcmd.c signal.c
+ isexec.c lookup.c message.c rdist.c signal.c
CLEANFILES+=gram.c y.tab.h
LDADD= -lcompat
diff --git a/usr.bin/rdist/docmd.c b/usr.bin/rdist/docmd.c
index 851692f1547..83715f1296c 100644
--- a/usr.bin/rdist/docmd.c
+++ b/usr.bin/rdist/docmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: docmd.c,v 1.5 1997/02/12 19:48:24 dm Exp $ */
+/* $OpenBSD: docmd.c,v 1.6 1997/07/22 06:59:38 millert Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -35,7 +35,7 @@
#ifndef lint
static char RCSid[] =
-"$OpenBSD: docmd.c,v 1.5 1997/02/12 19:48:24 dm Exp $";
+"$OpenBSD: docmd.c,v 1.6 1997/07/22 06:59:38 millert Exp $";
static char sccsid[] = "@(#)docmd.c 5.1 (Berkeley) 6/6/85";
@@ -285,9 +285,10 @@ static int remotecmd(rhost, luser, ruser, cmd)
if (becomeuser() != 0)
exit(1);
#else /* !DIRECT_RCMD */
- debugmsg(DM_MISC, "Remote shell command = '%s'\n", path_remsh);
+ debugmsg(DM_MISC, "Remote shell command = '%s'\n",
+ path_remsh ? path_remsh : "default");
(void) signal(SIGPIPE, SIG_IGN);
- desc = rshrcmd(&rhost, -1, luser, ruser, cmd, 0);
+ desc = rcmdsh(&rhost, -1, luser, ruser, cmd, path_remsh);
if (desc > 0)
(void) signal(SIGPIPE, sighandler);
#endif /* DIRECT_RCMD */
diff --git a/usr.bin/rdist/os-openbsd.h b/usr.bin/rdist/os-openbsd.h
index 0989b1dfdd5..698bce42c12 100644
--- a/usr.bin/rdist/os-openbsd.h
+++ b/usr.bin/rdist/os-openbsd.h
@@ -1,4 +1,4 @@
-/* * $OpenBSD: os-openbsd.h,v 1.8 1997/07/22 04:42:06 millert Exp $*/
+/* * $OpenBSD: os-openbsd.h,v 1.9 1997/07/22 06:59:39 millert Exp $*/
/*
* Copyright (c) 1993 Michael A. Cooper
* Copyright (c) 1993 Regents of the University of California.
@@ -157,9 +157,3 @@ typedef void POINTER;
* We have <paths.h>
*/
#define PATHS_H <paths.h>
-
-/*
- * Path to the remote shell command.
- * May be overridden via the environment variable RSH.
- */
-#define _PATH_REMSH _PATH_RSH /**/
diff --git a/usr.bin/rdist/rdist.1 b/usr.bin/rdist/rdist.1
index 0a0bea56b9b..def39b215b4 100644
--- a/usr.bin/rdist/rdist.1
+++ b/usr.bin/rdist/rdist.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rdist.1,v 1.4 1996/06/26 05:38:16 deraadt Exp $
+.\" $OpenBSD: rdist.1,v 1.5 1997/07/22 06:59:39 millert Exp $
.\"
.\" Copyright (c) 1983 Regents of the University of California.
.\" All rights reserved.
@@ -831,6 +831,9 @@ ${FILES} :: stamp.cory
.IP TMPDIR
Name of temporary directory to use. Default is
.B /tmp.
+.IP RSH
+Name of the default remote shell program to use. Default is
+.B /usr/bin/rsh.
.SH FILES
.nf
.ta \w'/tmp/rdist* 'u
diff --git a/usr.bin/rdist/rdist.c b/usr.bin/rdist/rdist.c
index 2fd211cc276..9279120e4a4 100644
--- a/usr.bin/rdist/rdist.c
+++ b/usr.bin/rdist/rdist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rdist.c,v 1.3 1996/06/26 05:38:17 deraadt Exp $ */
+/* $OpenBSD: rdist.c,v 1.4 1997/07/22 06:59:39 millert Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -35,7 +35,7 @@
#ifndef lint
static char RCSid[] =
-"$OpenBSD: rdist.c,v 1.3 1996/06/26 05:38:17 deraadt Exp $";
+"$OpenBSD: rdist.c,v 1.4 1997/07/22 06:59:39 millert Exp $";
static char sccsid[] = "@(#)main.c 5.1 (Berkeley) 6/6/85";
@@ -66,7 +66,7 @@ char *remotemsglist = NULL;
char optchars[] = "A:a:bcd:DFf:hil:L:M:m:NnOo:p:P:qRrst:Vvwxy";
FILE *opendist();
char *path_rdistd = _PATH_RDISTD;
-char *path_remsh = _PATH_REMSH;
+char *path_remsh = NULL;
/*
* Add a hostname to the host list
@@ -281,6 +281,9 @@ main(argc, argv, envp)
fatalerr(
"The -n flag and \"verify\" mode may not both be used.");
+ if (path_remsh == NULL)
+ path_remsh = getenv("RSH");
+
/*
* Don't fork children for nflag
*/