Bareos Bug Tracker
Bareos Bug Tracker

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000905bareos-core[All Projects] webuipublic2018-02-08 16:092018-02-13 18:56
Reporterstephane 
Assigned Tofrank 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformWindows 8OSWindowsOS Version8
Product Version17.2.4 
Target VersionFixed in Version 
Summary0000905: Restore WebUI - Enable to browse directory when a file name contain a single quote
DescriptionIn the restore menu select a job and browse accross directory with a file contain a single quote , it say "Oops, something went wrong, probably too many files."

in the file Restore/src/Restore/Controller/RestoreController.php in Buildsubtree function for a file, the addslaches function escape the file name for the "text" value :
…{"id":"194117","text":"l\'aurore.txt","icon":"glyphicon glyphicon-file","state":"","data":{"lstat":"A A IH\/ B A A g J A A BafE\/H BafE\/m BafFJS A A L","type":"F","linkfileindex":0,"pathid":6335,"stat":{"atime":1518096327,"dev":0,"size":9,"ino":0,"mode":33279,"nlink":1,"user":"root","group":"root","rdev":32,"mtime":1518096358,"ctime":1518096978},"fileid":194117,"jobid":62,"name":"l\u0027aurore.txt"}}…

without the addslashes function json is ok and you can browse the directory:

{"id":"194117","text":"l'aurore.txt","icon":"glyphicon glyphicon-file","state":"","data":{"lstat":"A A IH\/ B A A g J A A BafE\/H BafE\/m BafFJS A A L","type":"F","linkfileindex":0,"pathid":6335,"stat":{"atime":1518096327,"dev":0,"size":9,"ino":0,"mode":33279,"nlink":1,"user":"root","group":"root","rdev":32,"mtime":1518096358,"ctime":1518096978},"fileid":194117,"jobid":62,"name":"l\u0027aurore.txt"}

regards
TagsNo tags attached.
bareos-master: impact
bareos-master: 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
Attached Files

- Relationships
child of 0000910closed Release bareos-17.2.5 

-  Notes
(0002910)
frank (manager)
2018-02-13 18:52

Fix committed to bareos-webui bareos-17.2 branch with changesetid 7738.

- Related Changesets
bareos-webui: bareos-17.2 ee232a6f
Timestamp: 2018-02-13 18:43:11
Author: frank
Ported: N/A
Details ] Diff ]
Fix to bugreport 0000905 and 0000893

Regarding 0000905:

When returning an Ajax result, inside a json string value don't use addslashes.
You don't want both " and ' escaped at the same time. Instead just use
str_replace('"','\"',$Str).

Regarding 0000893:

A misplaced dir and file separator ',' lead to malformed json which could result in
a non loadable subtree.

Fixes 0000893: webui cannot list dirs with only files in them
Fixes 0000905: Restore WebUI - Enable to browse directory when a file name contain a single quote
mod - module/Restore/src/Restore/Controller/RestoreController.php Diff ] File ]

- Issue History
Date Modified Username Field Change
2018-02-08 16:09 stephane New Issue
2018-02-08 18:13 joergs Assigned To => frank
2018-02-08 18:13 joergs Status new => assigned
2018-02-13 18:16 frank Status assigned => confirmed
2018-02-13 18:52 frank Changeset attached => bareos-webui bareos-17.2 ee232a6f
2018-02-13 18:52 frank Note Added: 0002910
2018-02-13 18:52 frank Status confirmed => resolved
2018-02-13 18:52 frank Resolution open => fixed
2018-02-13 18:56 frank Relationship added child of 0000910


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker