summaryrefslogtreecommitdiff
path: root/client/wallet.c
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2007-09-27 03:22:46 +0000
committerRuss Allbery <rra@stanford.edu>2007-09-27 03:22:46 +0000
commite0f6e1222ede4a7545ca995a8aacaae0b591cb9c (patch)
tree2af9d140d13ee321c6fdb81c4444ca2e0e93c4a3 /client/wallet.c
parent7ec47028dbfe6df70d4c07e9546ae1680cf4e91f (diff)
Initial cut at srvtab support in the wallet client. This still requires
additional work and cleanup, particularly support for the sync attribute.
Diffstat (limited to 'client/wallet.c')
-rw-r--r--client/wallet.c18
1 files changed, 9 insertions, 9 deletions
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 <errno.h>
#include <fcntl.h>
-
#include <remctl.h>
-/* Temporary until we have some real configuration. */
-#ifndef SERVER
-# define SERVER "wallet.stanford.edu"
-#endif
-#ifndef PORT
-# define PORT 4444
-#endif
+#include <client/internal.h>
/* 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);
}