View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000971 | bareos-core | webui | public | 2018-06-25 11:54 | 2021-12-21 13:56 |
Reporter | Masanetz | Assigned To | frank | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Linux | OS | any | OS Version | 3 |
Product Version | 17.2.5 | ||||
Summary | 0000971: Error building tree for filenames with backslashes | ||||
Description | WebUI 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 Reproduce | 1. 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 Information | Attached diff of my "workaround" | ||||
Tags | No tags attached. | ||||
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); |
|
Fix committed to bareos master branch with changesetid 15067. | |
Fix committed to bareos bareos-19.2 branch with changesetid 15080. | |
bareos: master 0df1caaf 2021-07-15 20:14 Ported: N/A Details Diff |
webui: handle filenames containing backslashes properly Fixes 0000971: Error building tree for filenames with backslashes |
Affected Issues 0000971 |
|
mod - webui/module/Restore/src/Restore/Controller/RestoreController.php | Diff File | ||
bareos: bareos-19.2 cabfa11c 2021-07-15 20:14 Ported: N/A Details Diff |
webui: handle filenames containing backslashes properly Fixes 0000971: Error building tree for filenames with backslashes (cherry picked from commit 0df1caafed8428ad531a2b8a5a7b5a2e054d0f22) |
Affected Issues 0000971 |
|
mod - webui/module/Restore/src/Restore/Controller/RestoreController.php | Diff File | ||
bareos: bareos-18.2 861f6189 2021-07-21 18:29 Ported: N/A Details Diff |
webui: handle filenames containing backslashes properly Fixes 0000971: Error building tree for filenames with backslashes |
Affected Issues 0000971 |
|
mod - webui/module/Restore/src/Restore/Controller/RestoreController.php | Diff File | ||
bareos: bareos-19.2 a3873fec 2021-07-22 16:54 Committer: GitHub Ported: N/A Details Diff |
Merge pull request 0000895 from bareos/dev/fbergkemper/bareos-19.2/backport-971-1020 webui: backport to fix issue 0000971 and issue 0001020 |
Affected Issues 0000971, 0001020 |
|
mod - webui/module/Restore/src/Restore/Controller/RestoreController.php | Diff File | ||
mod - webui/vendor/Bareos/library/Bareos/BSock/BareosBSock.php | Diff File | ||
bareos: bareos-18.2 7fc53502 2021-07-22 16:55 Committer: GitHub Ported: N/A Details Diff |
Merge pull request 0000896 from bareos/dev/fbergkemper/bareos-18.2/backport-971-1020 webui: backport to fix issue 0000971 and issue 0001020 |
Affected Issues 0000971, 0001020 |
|
mod - webui/module/Restore/src/Restore/Controller/RestoreController.php | Diff File | ||
mod - webui/vendor/Bareos/library/Bareos/BSock/BareosBSock.php | Diff File |
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 |
2021-07-15 18:17 | frank | Status | assigned => confirmed |
2021-07-15 18:19 | frank | Summary | Restore WebUI - Error building tree for filenames with backslashes => Error building tree for filenames with backslashes |
2021-07-21 15:22 | frank | Changeset attached | => bareos master 0df1caaf |
2021-07-21 15:22 | frank | Note Added: 0004184 | |
2021-07-21 15:22 | frank | Status | confirmed => resolved |
2021-07-21 15:22 | frank | Resolution | open => fixed |
2021-07-22 15:22 | frank | Changeset attached | => bareos bareos-18.2 7fc53502 |
2021-07-22 15:22 | frank | Changeset attached | => bareos bareos-18.2 861f6189 |
2021-07-22 15:22 | frank | Changeset attached | => bareos bareos-19.2 a3873fec |
2021-07-22 15:22 | frank | Changeset attached | => bareos bareos-19.2 cabfa11c |
2021-07-22 15:22 | frank | Note Added: 0004189 | |
2021-07-26 10:36 | frank | Relationship added | related to 0001025 |
2021-09-13 10:37 | arogge | Relationship added | related to 0001383 |
2021-09-14 10:54 | arogge_adm | Relationship added | related to 0001384 |
2021-09-14 12:19 | arogge_adm | Relationship added | related to 0001361 |
2021-12-21 13:56 | arogge | Relationship added | related to 0001289 |