Skip to content

Commit

Permalink
Merge pull request #290 from stevegrubb/usability
Browse files Browse the repository at this point in the history
Make error message a little more clear
  • Loading branch information
Daniel Kopeček authored May 22, 2019
2 parents 74a7ac2 + ce3070d commit f011198
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Daemon/Daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,20 @@ namespace usbguard
if ( !( file_stat.st_mode & permissions ) ||
( file_stat.st_mode & permission_bad)
) {
USBGUARD_LOG(Error) << "Policy leaks are possible with this permissions!";
throw Exception("Check permissions", path, "Policy leaks possible");
std::ostringstream strm ;
strm.width(4) ;
strm.fill('0') ;
strm << std::oct << permissions ;
USBGUARD_LOG(Error) << "Permissions for " << path << " should be " << strm.str() ;
throw Exception("Check permissions", path, "Policy may be readable");
}
else {
USBGUARD_LOG(Info) << "File has correct permissions.";
}
}
else {
USBGUARD_LOG(Error) << "ERROR: File is not a regular file.";
throw Exception("Check permissions", path, "File not exists");
throw Exception("Check permissions", path, "Path is not a file");
}
}
else {
Expand Down

0 comments on commit f011198

Please sign in to comment.