diff options
author | wollman <wollman@FreeBSD.org> | 1997-04-29 17:46:27 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1997-04-29 17:46:27 +0000 |
commit | d226ef144b03696dab14ff5d54530d5632e71d16 (patch) | |
tree | ebc627df80aa6100a7cf763ecac36982be183b46 /sbin/restore | |
parent | 939a1f6d87a9bbf63fbf92964aa5a4d35038aaac (diff) | |
download | FreeBSD-src-d226ef144b03696dab14ff5d54530d5632e71d16.zip FreeBSD-src-d226ef144b03696dab14ff5d54530d5632e71d16.tar.gz |
Implement Kerberized rcmd for rdump/rrestore. This is lacking the
options one would normally expect to set the realm, enable encryption,
and whatnot, but this actually is able to contact the remote server,
so at least it's a start. (As a bonus, the stripped static binary is
unquestionably exportable.)
Diffstat (limited to 'sbin/restore')
-rw-r--r-- | sbin/restore/Makefile | 7 | ||||
-rw-r--r-- | sbin/restore/main.c | 23 |
2 files changed, 24 insertions, 6 deletions
diff --git a/sbin/restore/Makefile b/sbin/restore/Makefile index 916e6f0..65f0d55 100644 --- a/sbin/restore/Makefile +++ b/sbin/restore/Makefile @@ -12,4 +12,11 @@ MAN8= restore.8 MLINKS+=restore.8 rrestore.8 .PATH: ${.CURDIR}/../dump +.if exists(${DESTDIR}/usr/lib/libkrb.a) && defined(MAKE_EBONES) +.PATH: ${.CURDIR}/../../usr.bin/rlogin +SRCS+= krcmd.c kcmd.c +LDADD+= -lkrb -ldes +CFLAGS+=-DKERBEROS +.endif + .include <bsd.prog.mk> diff --git a/sbin/restore/main.c b/sbin/restore/main.c index dbb895b..6cb87d8 100644 --- a/sbin/restore/main.c +++ b/sbin/restore/main.c @@ -62,6 +62,7 @@ static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/4/95"; int bflag = 0, cvtflag = 0, dflag = 0, vflag = 0, yflag = 0; int hflag = 1, mflag = 1, Nflag = 0; +int dokerberos = 0; char command = '\0'; long dumpnum = 1; long volno = 0; @@ -96,7 +97,12 @@ main(argc, argv) if ((inputdev = getenv("TAPE")) == NULL) inputdev = _PATH_DEFTAPE; obsolete(&argc, &argv); - while ((ch = getopt(argc, argv, "b:cdf:himNRrs:tvxy")) != -1) +#ifdef KERBEROS +#define optlist "b:cdf:hikmNRrs:tvxy" +#else +#define optlist "b:cdf:himNRrs:tvxy" +#endif + while ((ch = getopt(argc, argv, optlist)) != -1) switch(ch) { case 'b': /* Change default tape blocksize. */ @@ -119,6 +125,11 @@ main(argc, argv) case 'h': hflag = 0; break; +#ifdef KERBEROS + case 'k': + dokerberos = 1; + break; +#endif case 'i': case 'R': case 'r': @@ -278,11 +289,11 @@ static void usage() { (void)fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n\t%s\n\t%s\n", - "restore -i [-chmvy] [-b blocksize] [-f file] [-s fileno]", - "restore -r [-cvy] [-b blocksize] [-f file] [-s fileno]", - "restore -R [-cvy] [-b blocksize] [-f file] [-s fileno]", - "restore -x [-chmvy] [-b blocksize] [-f file] [-s fileno] [file ...]", - "restore -t [-chvy] [-b blocksize] [-f file] [-s fileno] [file ...]"); + "restore -i [-chkmvy] [-b blocksize] [-f file] [-s fileno]", + "restore -r [-ckvy] [-b blocksize] [-f file] [-s fileno]", + "restore -R [-ckvy] [-b blocksize] [-f file] [-s fileno]", + "restore -x [-chkmvy] [-b blocksize] [-f file] [-s fileno] [file ...]", + "restore -t [-chkvy] [-b blocksize] [-f file] [-s fileno] [file ...]"); done(1); } |