summaryrefslogtreecommitdiffstats
path: root/sbin/dump/main.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1997-04-29 17:46:27 +0000
committerwollman <wollman@FreeBSD.org>1997-04-29 17:46:27 +0000
commitd226ef144b03696dab14ff5d54530d5632e71d16 (patch)
treeebc627df80aa6100a7cf763ecac36982be183b46 /sbin/dump/main.c
parent939a1f6d87a9bbf63fbf92964aa5a4d35038aaac (diff)
downloadFreeBSD-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/dump/main.c')
-rw-r--r--sbin/dump/main.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/sbin/dump/main.c b/sbin/dump/main.c
index 5257efb..1b6553b 100644
--- a/sbin/dump/main.c
+++ b/sbin/dump/main.c
@@ -79,6 +79,7 @@ int tapeno = 0; /* current tape number */
int density = 0; /* density in bytes/0.1" " <- this is for hilit19 */
int ntrec = NTREC; /* # tape blocks in each tape record */
int cartridge = 0; /* Assume non-cartridge tape */
+int dokerberos = 0; /* Use Kerberos authentication */
long dev_bsize = 1; /* recalculated below */
long blocksperfile; /* output blocks per file */
char *host = NULL; /* remote host (if any) */
@@ -117,7 +118,13 @@ main(argc, argv)
usage();
obsolete(&argc, &argv);
- while ((ch = getopt(argc, argv, "0123456789aB:b:cd:f:h:ns:T:uWw")) != -1)
+#ifdef KERBEROS
+#define optstring "0123456789aB:b:cd:f:h:kns:T:uWw"
+#else
+#define optstring "0123456789aB:b:cd:f:h:ns:T:uWw"
+#endif
+ while ((ch = getopt(argc, argv, optstring)) != -1)
+#undef optstring
switch (ch) {
/* dump level */
case '0': case '1': case '2': case '3': case '4':
@@ -171,6 +178,12 @@ main(argc, argv)
honorlevel = numarg("honor level", 0L, 10L);
break;
+#ifdef KERBEROS
+ case 'k':
+ dokerberos = 1;
+ break;
+#endif
+
case 'n': /* notify operators */
notify = 1;
break;
@@ -481,9 +494,13 @@ main(argc, argv)
static void
usage()
{
-
- (void)fprintf(stderr, "usage: dump [-0123456789acnu] [-B records] [-b blocksize] [-d density] [-f file]\n [-h level] [-s feet] [-T date] filesystem\n");
- (void)fprintf(stderr, " dump [-W | -w]\n");
+ fprintf(stderr, "usage: dump [-0123456789ac"
+#ifdef KERBEROS
+ "k"
+#endif
+ "nu] [-B records] [-b blocksize] [-d density] [-f file]\n"
+ " [-h level] [-s feet] [-T date] filesystem\n"
+ " dump [-W | -w]\n");
exit(1);
}
OpenPOWER on IntegriCloud