Minor. Relax the permission constraint of recovery state store folder. (#291)
Emit warnings instead of throwing fatal errors. Project: http://git-wip-us.apache.org/repos/asf/incubator-livy/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-livy/commit/f7c434c8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-livy/tree/f7c434c8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-livy/diff/f7c434c8 Branch: refs/heads/master Commit: f7c434c87bd7ea6fd3a410669a3160c2d1c463f9 Parents: b872978 Author: Saisai Shao <sai.sai.s...@gmail.com> Authored: Thu Feb 16 06:04:12 2017 +0800 Committer: Alex Man <tc.technet...@gmail.com> Committed: Wed Feb 15 17:04:12 2017 -0500 ---------------------------------------------------------------------- .../livy/server/recovery/FileSystemStateStore.scala | 10 ++++++---- .../livy/server/recovery/FileSystemStateStoreSpec.scala | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/f7c434c8/server/src/main/scala/com/cloudera/livy/server/recovery/FileSystemStateStore.scala ---------------------------------------------------------------------- diff --git a/server/src/main/scala/com/cloudera/livy/server/recovery/FileSystemStateStore.scala b/server/src/main/scala/com/cloudera/livy/server/recovery/FileSystemStateStore.scala index 2008ef7..e4edc51 100644 --- a/server/src/main/scala/com/cloudera/livy/server/recovery/FileSystemStateStore.scala +++ b/server/src/main/scala/com/cloudera/livy/server/recovery/FileSystemStateStore.scala @@ -72,10 +72,12 @@ class FileSystemStateStore( val fileStatus = fileContext.getFileStatus(absPath(".")) require(fileStatus.getPermission.getUserAction() == FsAction.ALL, s"Livy doesn't have permission to access state store: $fsUri.") - require(fileStatus.getPermission.getGroupAction() == FsAction.NONE, - s"Group users have permission to access state store: $fsUri. This is insecure.") - require(fileStatus.getPermission.getOtherAction() == FsAction.NONE, - s"Other users have permission to access state store: $fsUri. This is insecure.") + if (fileStatus.getPermission.getGroupAction != FsAction.NONE) { + warn(s"Group users have permission to access state store: $fsUri. This is insecure.") + } + if (fileStatus.getPermission.getOtherAction != FsAction.NONE) { + warn(s"Other users have permission to access state store: $fsUri. This is in secure.") + } } override def set(key: String, value: Object): Unit = { http://git-wip-us.apache.org/repos/asf/incubator-livy/blob/f7c434c8/server/src/test/scala/com/cloudera/livy/server/recovery/FileSystemStateStoreSpec.scala ---------------------------------------------------------------------- diff --git a/server/src/test/scala/com/cloudera/livy/server/recovery/FileSystemStateStoreSpec.scala b/server/src/test/scala/com/cloudera/livy/server/recovery/FileSystemStateStoreSpec.scala index 935911b..2b90a52 100644 --- a/server/src/test/scala/com/cloudera/livy/server/recovery/FileSystemStateStoreSpec.scala +++ b/server/src/test/scala/com/cloudera/livy/server/recovery/FileSystemStateStoreSpec.scala @@ -82,9 +82,9 @@ class FileSystemStateStoreSpec extends FunSpec with LivyBaseUnitTestSuite { } test("600") test("400") - test("777") - test("770") - test("707") + test("677") + test("670") + test("607") } it("set should write with an intermediate file") {