Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/23252#discussion_r239898432
  
    --- Diff: core/src/main/scala/org/apache/spark/SecurityManager.scala ---
    @@ -380,6 +400,12 @@ private[spark] class SecurityManager(
         }
       }
     
    +  private def readSecretFile(secretFilePath: String): String = {
    +    val secretFile = new File(secretFilePath)
    +    require(secretFile.isFile, s"No file found containing the secret key 
at $secretFilePath.")
    +    Base64.getEncoder.encodeToString(Files.readAllBytes(secretFile.toPath))
    --- End diff --
    
    It would be good to validate that this is at least not empty; optionally if 
it at least contain the number of expected bytes (there's a config for that).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to