From e0f6e1222ede4a7545ca995a8aacaae0b591cb9c Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 27 Sep 2007 03:22:46 +0000 Subject: Initial cut at srvtab support in the wallet client. This still requires additional work and cleanup, particularly support for the sync attribute. --- client/wallet.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'client/wallet.c') diff --git a/client/wallet.c b/client/wallet.c index 304856c..8d8bb58 100644 --- a/client/wallet.c +++ b/client/wallet.c @@ -13,16 +13,9 @@ #include #include - #include -/* Temporary until we have some real configuration. */ -#ifndef SERVER -# define SERVER "wallet.stanford.edu" -#endif -#ifndef PORT -# define PORT 4444 -#endif +#include /* Usage message. */ static const char usage_message[] = "\ @@ -120,11 +113,16 @@ main(int argc, char *argv[]) fprintf(stderr, "wallet: -f only supported for get\n"); exit(1); } - if (srvtab != NULL) + if (srvtab != NULL) { if (strcmp(argv[0], "get") != 0 || strcmp(argv[1], "keytab") != 0) { fprintf(stderr, "wallet: -S only supported for get keytab\n"); exit(1); } + if (file == NULL) { + fprintf(stderr, "wallet: -S requires -f\n"); + exit(1); + } + } /* Allocate space for the command to send to the server. */ command = malloc(sizeof(char *) * (argc + 2)); @@ -169,6 +167,8 @@ main(int argc, char *argv[]) fprintf(stderr, "close of %s failed: %s", file, strerror(errno)); exit(1); } + if (srvtab != NULL) + write_srvtab(srvtab, command[3], file); } else { fwrite(result->stdout_buf, 1, result->stdout_len, stdout); } -- cgit v1.2.3