From: Eric Bollengier Date: Fri, 17 Sep 2021 15:25:32 +0000 (+0200) Subject: totp: Display the keyname on creation X-Git-Tag: Beta-15.0.0~876 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc2ce85d72f77cefdfff096b540d2056ca321949;p=thirdparty%2Fbacula.git totp: Display the keyname on creation --- 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;