]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Restrict the use of local files during the restore file selection process when using...
authorEric Bollengier <eric@baculasystems.com>
Tue, 4 Apr 2023 09:58:16 +0000 (11:58 +0200)
committerEric Bollengier <eric@baculasystems.com>
Tue, 2 May 2023 07:07:18 +0000 (09:07 +0200)
In different restore menus, it is possible to fill a list of files to restore
from a local file. It is now not authorized from Restricted Console.

bacula/src/dird/ua_restore.c

index 4c8b03aab2e7877dde0a40b41e8a74b6240966ba..379f7f213d514a9d05f475ac6e51aa97ed00dad9 100644 (file)
@@ -1256,6 +1256,10 @@ static void insert_one_file_or_dir(UAContext *ua, RESTORE_CTX *rx, char *date, b
 
    switch (*p) {
    case '<':
+      if (ua->cons) { /* Do not open local files from a restricted console */
+         ua->error_msg(_("Operation not allowed for restricted console\n"));
+         break;
+      }
       p++;
       if ((ffd = bfopen(p, "rb")) == NULL) {
          berrno be;