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 | |
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.
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | client/keytab.c | 7 |
2 files changed, 10 insertions, 1 deletions
@@ -6,6 +6,10 @@ wallet 0.6 (unreleased) type from krb5.conf as well as from compile-time defaults and command-line options. + 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. + The build system now probes for GSS-API, Kerberos v5 and v4, and AFS libraries as necessary rather than hard-coding libraries. Building on systems without strong shared library dependencies and building 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; |