diff options
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; |