You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/12/09 16:26:24 UTC

[GitHub] [hadoop] steveloughran commented on pull request #5205: HADOOP-18546. log/probes of HADOOP-18546 presence.

steveloughran commented on PR #5205:
URL: https://github.com/apache/hadoop/pull/5205#issuecomment-1344508771

   how to use this
   ```scala
   
   // ********************************************************************************************
   // probe a FS for the bug using path capabilities checks
   // ********************************************************************************************
   
   def isVulnerable(fspath: String): Boolean = {
     val p = path(fspath)
     if (!Set("abfs", "abfss").contains(p.toUri.getScheme)) {
       println("not an azure filesystem")
       return false;
     }
     val targetFS = bind(p);
     if (!targetFS.hasPathCapability(p, "fs.capability.paths.acls")) {
       println("The release predates the bugs addition to the codebase")
       return false;
     }
       if (!targetFS.hasPathCapability(p, "HADOOP-18546")) {
       println("The release has the HADOOP-18546 fix")
       return false;
     }
   
     println("The release is recent enough to contain the bug, and does not have the fix")
     val fsconf = targetFS.getConf
     if (fsconf.getBoolean("fs.azure.enable.readahead", false)) {
       println("readahead disabled (cloudera releases and hadoop 3.3.5+)")
       return false;
     }
     val depth = "fs.azure.readaheadqueue.depth"
     val queue = fsconf.getInt(depth, -1)
     if (queue == 0) {
       println(s"${depth} set to 0: safe")
       return false;
     }
     queue match {
       case -1 =>
         println(s"${depth} will be the default: unsafe")
         true;
       case 0 =>
         println(s"${depth} set to zero: safe")
         false
       case _ =>
         println(s"${depth} set to ${queue}: unsafe")
         false
     }
   }
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org