You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by ka...@apache.org on 2017/07/10 01:05:01 UTC

[1/3] storm git commit: [STORM-2093] Fix permissions in multi-tenant, secure mode

Repository: storm
Updated Branches:
  refs/heads/master d7c781891 -> 03578ca99


[STORM-2093] Fix permissions in multi-tenant, secure mode


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/0201ae79
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/0201ae79
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/0201ae79

Branch: refs/heads/master
Commit: 0201ae79a5f4fc7ba7ee1c524818a29a92f140f1
Parents: 43fde85
Author: Ethan Li <et...@gmail.com>
Authored: Wed Jul 5 20:56:26 2017 +0000
Committer: Ethan Li <et...@gmail.com>
Committed: Fri Jul 7 06:17:01 2017 -0500

----------------------------------------------------------------------
 .../src/clj/org/apache/storm/daemon/logviewer.clj   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/0201ae79/storm-core/src/clj/org/apache/storm/daemon/logviewer.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/daemon/logviewer.clj b/storm-core/src/clj/org/apache/storm/daemon/logviewer.clj
index 8720fca..27b4ba1 100644
--- a/storm-core/src/clj/org/apache/storm/daemon/logviewer.clj
+++ b/storm-core/src/clj/org/apache/storm/daemon/logviewer.clj
@@ -21,6 +21,7 @@
   (:use [org.apache.storm config daemon-config util log])
   (:use [org.apache.storm.ui helpers])
   (:import [org.apache.storm StormTimer]
+           [org.apache.storm.daemon.supervisor ClientSupervisorUtils]
            [org.apache.storm.daemon.supervisor SupervisorUtils]
            [org.apache.storm.metric StormMetricsRegistry])
   (:import [org.apache.storm.utils Time VersionInfo ConfigUtils Utils ServerUtils ServerConfigUtils])
@@ -502,6 +503,19 @@
       (-> (resp/response "Page not found")
           (resp/status 404)))))
 
+(defnk set-log-file-permissions [fname root-dir]
+  (let [file (.getCanonicalFile (File. root-dir fname))
+        run-as-user (*STORM-CONF* SUPERVISOR-RUN-WORKER-AS-USER)
+        parent (.getParent (File. root-dir fname))
+        md-file (if (nil? parent) nil (get-metadata-file-for-wroker-logdir parent))
+        topo-owner (if (nil? md-file) nil (get-topo-owner-from-metadata-file (.getCanonicalPath md-file)))]
+    (when (and run-as-user
+          (not-nil? topo-owner)
+          (.exists file)
+          (not (Files/isReadable (.toPath file))))     
+      (log-debug "Setting permissions on file " fname " with topo-owner " topo-owner)
+      (ClientSupervisorUtils/processLauncherAndWait *STORM-CONF* topo-owner ["blob" (.getCanonicalPath file)] nil (str "setup group read permissions for file: " fname)))))
+
 (defnk download-log-file [fname req resp user ^String root-dir :is-daemon false]
   (let [file (.getCanonicalFile (File. root-dir fname))]
     (if (.exists file)
@@ -1020,6 +1034,7 @@
             start (if (:start m) (parse-long-from-map m :start))
             length (if (:length m) (parse-long-from-map m :length))
             file (URLDecoder/decode (:file m))]
+        (set-log-file-permissions file log-root)
         (log-template (log-page file start length (:grep m) user log-root)
           file user))
       (catch InvalidRequestException ex
@@ -1098,6 +1113,7 @@
       (.mark logviewer:num-download-log-file-http-requests)
       (let [user (.getUserName http-creds-handler servlet-request)
             file (URLDecoder/decode (:file m))]
+        (set-log-file-permissions file log-root)
         (download-log-file file servlet-request servlet-response user log-root))
       (catch InvalidRequestException ex
         (log-error ex)


[3/3] storm git commit: STORM-2093: CHANGELOG

Posted by ka...@apache.org.
STORM-2093: CHANGELOG


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/03578ca9
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/03578ca9
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/03578ca9

Branch: refs/heads/master
Commit: 03578ca9961fd1ad1ffc5432839fc4ad04455d96
Parents: 8172b63
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Mon Jul 10 10:04:47 2017 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Mon Jul 10 10:04:47 2017 +0900

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/03578ca9/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 669cfee..5c55e68 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## 2.0.0
+ * STORM-2093: Fix permissions in multi-tenant, secure mode
  * STORM-2610: Fixed throttle metrics
  * STORM-2609: Simple command line DRPC Client
  * STORM-2613: Tuples that aren't sampled shouldn't be considered for execute latency calculations


[2/3] storm git commit: Merge branch 'STORM-2093' of https://github.com/Ethanlm/storm into STORM-2093-merge

Posted by ka...@apache.org.
Merge branch 'STORM-2093' of https://github.com/Ethanlm/storm into STORM-2093-merge


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/8172b63a
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/8172b63a
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/8172b63a

Branch: refs/heads/master
Commit: 8172b63a46cb660dfbbae2b37a4b79f1481fb065
Parents: d7c7818 0201ae7
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Mon Jul 10 09:37:58 2017 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Mon Jul 10 09:37:58 2017 +0900

----------------------------------------------------------------------
 .../src/clj/org/apache/storm/daemon/logviewer.clj   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------