From 8dd5883b8497e4dcc7cf4f0577e45040c5f43430 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 17 Jan 2008 00:21:00 +0000 Subject: 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. --- client/keytab.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'client/keytab.c') 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; -- cgit v1.2.3