Bug 1308564 - Tie logging to MOZ_SANDBOX_VERBOSE instead of DEBUG. r?jld draft
authorGian-Carlo Pascutto <gcp@mozilla.com>
Fri, 07 Oct 2016 21:33:12 +0200
changeset 422286 e1eda2831208fd11b5462dfda3d4518ac152de7d
parent 422283 446920b7e832e6c665092406794b7f8382b8ffa8
child 533294 58a0b11ce1d7753da602e4cac64fc107262a8c5a
push id31729
push usergpascutto@mozilla.com
push dateFri, 07 Oct 2016 19:33:44 +0000
reviewersjld
bugs1308564
milestone52.0a1
Bug 1308564 - Tie logging to MOZ_SANDBOX_VERBOSE instead of DEBUG. r?jld MozReview-Commit-ID: JHIzIvbjA0Q
security/sandbox/linux/broker/SandboxBroker.cpp
--- a/security/sandbox/linux/broker/SandboxBroker.cpp
+++ b/security/sandbox/linux/broker/SandboxBroker.cpp
@@ -715,17 +715,17 @@ SandboxBroker::AuditPermissive(int aOp, 
   SANDBOX_LOG_ERROR("SandboxBroker: would have denied op=%d rflags=%o perms=%d path=%s for pid=%d" \
                     " permissive=1 error=\"%s\"", aOp, aFlags, aPerms,
                     aPath, mChildPid, strerror(errno));
 }
 
 void
 SandboxBroker::AuditDenial(int aOp, int aFlags, int aPerms, const char* aPath)
 {
-#ifdef DEBUG
-  SANDBOX_LOG_ERROR("SandboxBroker: denied op=%d rflags=%o perms=%d path=%s for pid=%d" \
-                    " error=\"%s\"", aOp, aFlags, aPerms, aPath, mChildPid,
-                    strerror(errno));
-#endif
+  if (SandboxInfo::Get().Test(SandboxInfo::kVerbose)) {
+    SANDBOX_LOG_ERROR("SandboxBroker: denied op=%d rflags=%o perms=%d path=%s for pid=%d" \
+                      " error=\"%s\"", aOp, aFlags, aPerms, aPath, mChildPid,
+                      strerror(errno));
+  }
 }
 
 
 } // namespace mozilla