diff options
author | Russ Allbery <rra@stanford.edu> | 2008-01-17 00:21:00 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2008-01-17 00:21:00 +0000 |
commit | 8dd5883b8497e4dcc7cf4f0577e45040c5f43430 (patch) | |
tree | fea709d06cb438b8737f03bb6ce9d7322a408f1e /client | |
parent | 426e3bc5f2af3f30524060812625204de73f78d0 (diff) |
When getting a keytab with the client with no -f option, correctly
write the keytab to standard output rather than dying with a cryptic
error.
Diffstat (limited to 'client')
-rw-r--r-- | client/keytab.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/client/keytab.c b/client/keytab.c index 04b34c9..7554f50 100644 --- a/client/keytab.c +++ b/client/keytab.c @@ -79,7 +79,12 @@ get_keytab(struct remctl *r, krb5_context ctx, const char *type, warn("no data returned by wallet server"); return 255; } - write_file(file, data, length); + if (file != NULL) + write_file(file, data, length); + else { + if (fwrite(data, length, 1, stdout) != 1) + sysdie("write to standard output failed"); + } if (srvtab != NULL) write_srvtab(ctx, srvtab, name, file); return 0; |