From fc2ce85d72f77cefdfff096b540d2056ca321949 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 17 Sep 2021 17:25:32 +0200 Subject: [PATCH] totp: Display the keyname on creation --- bacula/src/plugins/dir/totp/totp-dir.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bacula/src/plugins/dir/totp/totp-dir.c b/bacula/src/plugins/dir/totp/totp-dir.c index 560c93797..1d5cf23ee 100644 --- a/bacula/src/plugins/dir/totp/totp-dir.c +++ b/bacula/src/plugins/dir/totp/totp-dir.c @@ -822,11 +822,16 @@ int main(int argc, char **argv) Pmsg0(0, _("Unable to generate the key\n")); usage(2); } + } else { Pmsg0(0, _("Unable to read the key. Use -c to create a key.\n")); usage(2); } } + if (docreate) { + printf("%s\n", totp.keyname); + return 0; + } if (displayURL || displayQR) { POOL_MEM tmp; char buf[512]; @@ -856,6 +861,7 @@ int main(int argc, char **argv) usage(2); } } + return 0; } uint32_t c=99; -- 2.47.3