View Issue Details

IDProjectCategoryView StatusLast Update
0000971bareos-core[All Projects] webuipublic2018-10-10 11:16
ReporterMasanetzAssigned Tofrank 
PrioritynormalSeveritymajorReproducibilityalways
Status assignedResolutionopen 
PlatformLinuxOSanyOS Version3
Product Version17.2.5 
Fixed in Version 
Summary0000971: Restore WebUI - Error building tree for filenames with backslashes
DescriptionWebUI Restore fails building the tree if directory contains filenames with backslashes.

Some time ago the adobe reader plugin created a file named "C:\nppdf32Log\debuglog.txt" in the working dir.
Building the restore tree in WebUI fails with popup "Oops, something went wrong, probably too many files.".

Filebname handling for backslashes should be adapted for backslashes (e.g. like https://github.com/bareos/bareos-webui/commit/ee232a6f04eaf2a7c1084fee981f011ede000e8a)
Steps To Reproduce1. Put an empty file with a filename with backslashes (e.g. C:\nppdf32Log\debuglog.txt) in your home directory
2. Backup
3. Try to restore any file from your home directory from this backup via WebUI
Additional InformationAttached diff of my "workaround"
TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-19.2: impact
bareos-19.2: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action

Activities

Masanetz

Masanetz

2018-06-25 11:54

reporter  

RestoreController.php.diff (1,669 bytes)
diff --git a/module/Restore/src/Restore/Controller/RestoreController.php b/module/Restore/src/Restore/Controller/RestoreController.php
index e4080d9..13b9e87 100644
--- a/module/Restore/src/Restore/Controller/RestoreController.php
+++ b/module/Restore/src/Restore/Controller/RestoreController.php
@@ -346,7 +346,7 @@ class RestoreController extends AbstractActionController
                --$dnum;
                $items .= '{';
                $items .= '"id":"-' . $dir['pathid'] . '"';
-               $items .= ',"text":"' . preg_replace('/[\x00-\x1F\x7F]/', '', str_replace('"', '\"', $dir["name"])) . '"';
+               $items .= ',"text":"' . preg_replace('/[\x00-\x1F\x7F]/', '', str_replace('"', '\"', str_replace('\\', '\\\\', $dir["name"]))) . '"';
                $items .= ',"icon":"glyphicon glyphicon-folder-close"';
                $items .= ',"state":""';
                $items .= ',"data":' . \Zend\Json\Json::encode($dir, \Zend\Json\Json::TYPE_OBJECT);
@@ -369,7 +369,7 @@ class RestoreController extends AbstractActionController
          foreach($this->files as $file) {
             $items .= '{';
             $items .= '"id":"' . $file["fileid"] . '"';
-            $items .= ',"text":"' . preg_replace('/[\x00-\x1F\x7F]/', '', str_replace('"', '\"', $file["name"])) . '"';
+            $items .= ',"text":"' . preg_replace('/[\x00-\x1F\x7F]/', '', str_replace('"', '\"', str_replace('\\', '\\\\', $file["name"]))) . '"';
             $items .= ',"icon":"glyphicon glyphicon-file"';
             $items .= ',"state":""';
             $items .= ',"data":' . \Zend\Json\Json::encode($file, \Zend\Json\Json::TYPE_OBJECT);

Issue History

Date Modified Username Field Change
2018-06-25 11:54 Masanetz New Issue
2018-06-25 11:54 Masanetz File Added: RestoreController.php.diff
2018-10-10 11:16 frank Status new => assigned
2018-10-10 11:16 frank Assigned To => frank