]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
totp: Display the keyname on creation
authorEric Bollengier <eric@baculasystems.com>
Fri, 17 Sep 2021 15:25:32 +0000 (17:25 +0200)
committerEric Bollengier <eric@baculasystems.com>
Wed, 6 Sep 2023 07:49:00 +0000 (09:49 +0200)
bacula/src/plugins/dir/totp/totp-dir.c

index 560c937970884bb5a2918d0c1b8d6ada635a510f..1d5cf23eedd0613273c2def9e5a956f30975bb26 100644 (file)
@@ -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;