]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
totp-bpam: Add support for qrencode 3.x on Redhat
authorEric Bollengier <eric@baculasystems.com>
Fri, 15 Oct 2021 11:50:05 +0000 (13:50 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:56 +0000 (13:56 +0200)
bacula/src/plugins/dir/totp/totp-dir.c

index 1d5cf23eedd0613273c2def9e5a956f30975bb26..83bd3b6c7ee265eaa1bda94f94c227b535e83fa5 100644 (file)
@@ -478,7 +478,7 @@ public:
       fclose(fp);
 
       // Call qrencode to generate the QR code, else display the URL
-      Mmsg(tmp, "qrencode -t ansiutf8 -r \"%s\"", urlfile);
+      Mmsg(tmp, "sh -c 'cat \"%s\" | qrencode -t ansiutf8'", urlfile);
       if (run_program_full_output (tmp.c_str(), 0, *ret, NULL) != 0) {
          berrno be;
          Dmsg1(DINFO, "Unable to call qrencode on a new key. ERR=%s\n", be.bstrerror());
@@ -536,7 +536,7 @@ public:
       }
 
       // Call qrencode to generate the QR code, else display the URL
-      Mmsg(tmp, "qrencode -s 10 -t png -o \"%s\" -r \"%s\"", pngfile, urlfile);
+      Mmsg(tmp, "sh -c 'cat \"%s\" | qrencode -s 10 -t png -o \"%s\"'", urlfile, pngfile);
       if (run_program_full_output (tmp.c_str(), 0, *ret, NULL) != 0) {
          Dmsg0(0, "Unable to generate the totp png file from the key\n");
          goto bail_out;