summaryrefslogtreecommitdiff
path: root/client/wallet.c
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2008-01-19 00:37:31 +0000
committerRuss Allbery <rra@stanford.edu>2008-01-19 00:37:31 +0000
commitaa57ab48cc9df24ab756b5651959b36a2d81cad3 (patch)
treeff27773218cb6d2677032d18f6872dd45493b82a /client/wallet.c
parent275cc7eac5d693bffec19884bf37322df59a871c (diff)
When downloading a keytab to a file that already exists, merge the new
keytab keys into that file rather than moving aside the old keytab and creating a new keytab with only the new keys. Also fix get handling in the client for all types other than keytabs. This isn't visible yet since the server doesn't yet support other types of objects.
Diffstat (limited to 'client/wallet.c')
-rw-r--r--client/wallet.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/client/wallet.c b/client/wallet.c
index d48a52c..9dc97c2 100644
--- a/client/wallet.c
+++ b/client/wallet.c
@@ -207,12 +207,16 @@ main(int argc, char *argv[])
if (!remctl_open(r, options.server, options.port, options.principal))
die("%s", remctl_error(r));
- /* Most commands, we handle ourselves, but keytab get commands with -f are
- special. */
- if (strcmp(argv[0], "get") == 0 && strcmp(argv[1], "keytab") == 0) {
+ /* Most commands, we handle ourselves, but get commands are special and
+ keytab get commands with -f are doubly special. */
+ if (strcmp(argv[0], "get") == 0) {
if (argc > 3)
die("too many arguments");
- status = get_keytab(r, ctx, options.type, argv[2], file, srvtab);
+ if (strcmp(argv[1], "keytab") == 0 && file != NULL) {
+ status = get_keytab(r, ctx, options.type, argv[2], file, srvtab);
+ } else {
+ status = get_file(r, options.type, argv[1], argv[2], file);
+ }
} else {
command = xmalloc(sizeof(char *) * (argc + 2));
command[0] = options.type;