[Bug] Files with invalid SMACK labels (not allowed to be accessed by app)
caused exception about missing member ("location is required argument").
Fix ignores the files that cannot be accessed.
[Verification] Manually checked with Chrome console and trying to list files
with invalid SMACK label. Files are being ignored.
100% passrate for filesystem module.
Change-Id: I48ed83ebbba5d0c6cfa0e597f083a7a1abce17fa
obj["callbackId"] = picojson::value(callback_id);
for (auto path : paths) {
FilesystemStat stat = FilesystemStat::getStat(path);
- statPaths.push_back(stat.toJSON());
+
+ if (FilesystemError::None == stat.error) {
+ statPaths.push_back(stat.toJSON());
+ } else {
+ LoggerW("File stat for path: %s failed with error: %d. Ignoring this entry.", path.c_str(),
+ static_cast<std::underlying_type<FilesystemError>::type>(stat.error));
+ }
}
ReportSuccess(result, obj);
Instance::PostMessage(this, response.serialize().c_str());