You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by pt...@apache.org on 2014/04/29 23:18:36 UTC
[1/6] git commit: STORM-269: prevent logviewer from serving files
outside the log directory
Repository: incubator-storm
Updated Branches:
refs/heads/0.9.1.x [created] 8727e886b
STORM-269: prevent logviewer from serving files outside the log directory
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/8f322601
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/8f322601
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/8f322601
Branch: refs/heads/0.9.1.x
Commit: 8f3226010fdeb0c40f824344b47807e861aa04e7
Parents: ffc7a81
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Fri Apr 25 16:25:47 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Tue Apr 29 15:45:23 2014 -0400
----------------------------------------------------------------------
storm-core/src/clj/backtype/storm/daemon/logviewer.clj | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/8f322601/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
index 71f497f..cb31de4 100644
--- a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
@@ -30,9 +30,10 @@
[clojure.string :as string])
(:gen-class))
-(defn tail-file [path tail]
+(defn tail-file [path tail root-dir]
(let [flen (.length (clojure.java.io/file path))
skip (- flen tail)]
+ (if (.startsWith path root-dir)
(with-open [input (clojure.java.io/input-stream path)
output (java.io.ByteArrayOutputStream.)]
(if (> skip 0) (.skip input skip))
@@ -42,7 +43,7 @@
(when (and (pos? size) (< (.size output) tail))
(do (.write output buffer 0 size)
(recur))))))
- (.toString output))
+ (.toString output)) "File not found")
))
(defn log-root-dir
@@ -61,7 +62,7 @@ Note that if anything goes wrong, this will throw an Error and exit."
tail (if tail
(min 10485760 (Integer/parseInt tail))
10240)
- tail-string (tail-file path tail)]
+ tail-string (tail-file path tail root-dir)]
(if grep
(clojure.string/join "\n<br>"
(filter #(.contains % grep) (.split tail-string "\n")))
[3/6] git commit: switch to java.io.File for directory comparison
Posted by pt...@apache.org.
switch to java.io.File for directory comparison
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/14401609
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/14401609
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/14401609
Branch: refs/heads/0.9.1.x
Commit: 144016099b6aaf222149d6f9b6358e4b8e1f2961
Parents: 9cc40ae
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Mon Apr 28 13:35:25 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Tue Apr 29 15:46:22 2014 -0400
----------------------------------------------------------------------
storm-core/src/clj/backtype/storm/daemon/logviewer.clj | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/14401609/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
index 7d8b7aa..ef6f349 100644
--- a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
@@ -32,8 +32,10 @@
(defn tail-file [path tail root-dir]
(let [flen (.length (clojure.java.io/file path))
- skip (- flen tail)]
- (if (.startsWith path (.getCanonicalPath (File. root-dir)))
+ skip (- flen tail)
+ log-dir (File. root-dir)
+ log-file (File. path)]
+ (if (= log-dir (.getParentFile log-file))
(with-open [input (clojure.java.io/input-stream path)
output (java.io.ByteArrayOutputStream.)]
(if (> skip 0) (.skip input skip))
[5/6] git commit: update poms for 0.9.1.0-incubating release
Posted by pt...@apache.org.
update poms for 0.9.1.0-incubating release
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/98e99177
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/98e99177
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/98e99177
Branch: refs/heads/0.9.1.x
Commit: 98e99177ae2c5d32722f785b622b1acf11aff741
Parents: bb48a5f
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Tue Apr 29 17:02:55 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Tue Apr 29 17:02:55 2014 -0400
----------------------------------------------------------------------
pom.xml | 4 ++--
storm-buildtools/maven-shade-clojure-transformer/pom.xml | 2 +-
storm-core/pom.xml | 2 +-
storm-dist/binary/pom.xml | 2 +-
storm-dist/source/pom.xml | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/98e99177/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a274e3f..9e26703 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,7 +27,7 @@
<groupId>org.apache.storm</groupId>
<artifactId>storm</artifactId>
- <version>0.9.1-incubating</version>
+ <version>0.9.1.0-incubating-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Storm</name>
<description>Distributed and fault-tolerant realtime computation</description>
@@ -135,7 +135,7 @@
<scm>
<connection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-storm.git</connection>
<developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-storm.git</developerConnection>
- <tag>v0.9.1-incubating</tag>
+ <tag>v0.9.1.0-incubating</tag>
<url>https://git-wip-us.apache.org/repos/asf/incubator-storm</url>
</scm>
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/98e99177/storm-buildtools/maven-shade-clojure-transformer/pom.xml
----------------------------------------------------------------------
diff --git a/storm-buildtools/maven-shade-clojure-transformer/pom.xml b/storm-buildtools/maven-shade-clojure-transformer/pom.xml
index bfaafc0..1d19152 100644
--- a/storm-buildtools/maven-shade-clojure-transformer/pom.xml
+++ b/storm-buildtools/maven-shade-clojure-transformer/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>storm</artifactId>
<groupId>org.apache.storm</groupId>
- <version>0.9.1-incubating</version>
+ <version>0.9.1.0-incubating-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/98e99177/storm-core/pom.xml
----------------------------------------------------------------------
diff --git a/storm-core/pom.xml b/storm-core/pom.xml
index af3a338..b6c48f5 100644
--- a/storm-core/pom.xml
+++ b/storm-core/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>storm</artifactId>
<groupId>org.apache.storm</groupId>
- <version>0.9.1-incubating</version>
+ <version>0.9.1.0-incubating-SNAPSHOT</version>
</parent>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/98e99177/storm-dist/binary/pom.xml
----------------------------------------------------------------------
diff --git a/storm-dist/binary/pom.xml b/storm-dist/binary/pom.xml
index 15b76b2..b22c548 100644
--- a/storm-dist/binary/pom.xml
+++ b/storm-dist/binary/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>storm</artifactId>
<groupId>org.apache.storm</groupId>
- <version>0.9.1-incubating</version>
+ <version>0.9.1.0-incubating-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.apache.storm</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/98e99177/storm-dist/source/pom.xml
----------------------------------------------------------------------
diff --git a/storm-dist/source/pom.xml b/storm-dist/source/pom.xml
index aa6c138..1c6f0e3 100644
--- a/storm-dist/source/pom.xml
+++ b/storm-dist/source/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>storm</artifactId>
<groupId>org.apache.storm</groupId>
- <version>0.9.1-incubating</version>
+ <version>0.9.1.0-incubating-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.apache.storm</groupId>
[2/6] git commit: convert log-root to canonical path in case it is
relative
Posted by pt...@apache.org.
convert log-root to canonical path in case it is relative
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/9cc40aec
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/9cc40aec
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/9cc40aec
Branch: refs/heads/0.9.1.x
Commit: 9cc40aec48b7b14eb59cf1bd007ac7582d0328b7
Parents: 8f32260
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Sun Apr 27 17:26:51 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Tue Apr 29 15:46:12 2014 -0400
----------------------------------------------------------------------
.../src/clj/backtype/storm/daemon/logviewer.clj | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/9cc40aec/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
index cb31de4..7d8b7aa 100644
--- a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
@@ -33,17 +33,17 @@
(defn tail-file [path tail root-dir]
(let [flen (.length (clojure.java.io/file path))
skip (- flen tail)]
- (if (.startsWith path root-dir)
+ (if (.startsWith path (.getCanonicalPath (File. root-dir)))
(with-open [input (clojure.java.io/input-stream path)
output (java.io.ByteArrayOutputStream.)]
(if (> skip 0) (.skip input skip))
- (let [buffer (make-array Byte/TYPE 1024)]
- (loop []
- (let [size (.read input buffer)]
- (when (and (pos? size) (< (.size output) tail))
- (do (.write output buffer 0 size)
- (recur))))))
- (.toString output)) "File not found")
+ (let [buffer (make-array Byte/TYPE 1024)]
+ (loop []
+ (let [size (.read input buffer)]
+ (when (and (pos? size) (< (.size output) tail))
+ (do (.write output buffer 0 size)
+ (recur))))))
+ (.toString output)) "File not found")
))
(defn log-root-dir
[6/6] git commit: prepare for next development iteration
Posted by pt...@apache.org.
prepare for next development iteration
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/8727e886
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/8727e886
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/8727e886
Branch: refs/heads/0.9.1.x
Commit: 8727e886b5974aa88fe18967f388189917dce715
Parents: 98e9917
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Tue Apr 29 17:17:23 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Tue Apr 29 17:17:23 2014 -0400
----------------------------------------------------------------------
pom.xml | 2 +-
storm-buildtools/maven-shade-clojure-transformer/pom.xml | 2 +-
storm-core/pom.xml | 2 +-
storm-dist/binary/pom.xml | 2 +-
storm-dist/source/pom.xml | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/8727e886/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9e26703..a739255 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,7 +27,7 @@
<groupId>org.apache.storm</groupId>
<artifactId>storm</artifactId>
- <version>0.9.1.0-incubating-SNAPSHOT</version>
+ <version>0.9.1.1-incubating-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Storm</name>
<description>Distributed and fault-tolerant realtime computation</description>
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/8727e886/storm-buildtools/maven-shade-clojure-transformer/pom.xml
----------------------------------------------------------------------
diff --git a/storm-buildtools/maven-shade-clojure-transformer/pom.xml b/storm-buildtools/maven-shade-clojure-transformer/pom.xml
index 1d19152..6a56b0d 100644
--- a/storm-buildtools/maven-shade-clojure-transformer/pom.xml
+++ b/storm-buildtools/maven-shade-clojure-transformer/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>storm</artifactId>
<groupId>org.apache.storm</groupId>
- <version>0.9.1.0-incubating-SNAPSHOT</version>
+ <version>0.9.1.1-incubating-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/8727e886/storm-core/pom.xml
----------------------------------------------------------------------
diff --git a/storm-core/pom.xml b/storm-core/pom.xml
index b6c48f5..1cdbf6e 100644
--- a/storm-core/pom.xml
+++ b/storm-core/pom.xml
@@ -20,7 +20,7 @@
<parent>
<artifactId>storm</artifactId>
<groupId>org.apache.storm</groupId>
- <version>0.9.1.0-incubating-SNAPSHOT</version>
+ <version>0.9.1.1-incubating-SNAPSHOT</version>
</parent>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/8727e886/storm-dist/binary/pom.xml
----------------------------------------------------------------------
diff --git a/storm-dist/binary/pom.xml b/storm-dist/binary/pom.xml
index b22c548..2dd0f73 100644
--- a/storm-dist/binary/pom.xml
+++ b/storm-dist/binary/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>storm</artifactId>
<groupId>org.apache.storm</groupId>
- <version>0.9.1.0-incubating-SNAPSHOT</version>
+ <version>0.9.1.1-incubating-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.apache.storm</groupId>
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/8727e886/storm-dist/source/pom.xml
----------------------------------------------------------------------
diff --git a/storm-dist/source/pom.xml b/storm-dist/source/pom.xml
index 1c6f0e3..9d8ec3d 100644
--- a/storm-dist/source/pom.xml
+++ b/storm-dist/source/pom.xml
@@ -21,7 +21,7 @@
<parent>
<artifactId>storm</artifactId>
<groupId>org.apache.storm</groupId>
- <version>0.9.1.0-incubating-SNAPSHOT</version>
+ <version>0.9.1.1-incubating-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<groupId>org.apache.storm</groupId>
[4/6] git commit: make sure log file path is fully resolved
Posted by pt...@apache.org.
make sure log file path is fully resolved
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/bb48a5f7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/bb48a5f7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/bb48a5f7
Branch: refs/heads/0.9.1.x
Commit: bb48a5f75b4f8743a4c705121f35f18bdd0af1a6
Parents: 1440160
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Mon Apr 28 16:39:46 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Tue Apr 29 15:46:29 2014 -0400
----------------------------------------------------------------------
.../src/clj/backtype/storm/daemon/logviewer.clj | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/bb48a5f7/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
index ef6f349..2a48f55 100644
--- a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
@@ -33,18 +33,18 @@
(defn tail-file [path tail root-dir]
(let [flen (.length (clojure.java.io/file path))
skip (- flen tail)
- log-dir (File. root-dir)
+ log-dir (.getCanonicalFile (File. root-dir))
log-file (File. path)]
(if (= log-dir (.getParentFile log-file))
- (with-open [input (clojure.java.io/input-stream path)
- output (java.io.ByteArrayOutputStream.)]
- (if (> skip 0) (.skip input skip))
- (let [buffer (make-array Byte/TYPE 1024)]
- (loop []
- (let [size (.read input buffer)]
- (when (and (pos? size) (< (.size output) tail))
- (do (.write output buffer 0 size)
- (recur))))))
+ (with-open [input (clojure.java.io/input-stream path)
+ output (java.io.ByteArrayOutputStream.)]
+ (if (> skip 0) (.skip input skip))
+ (let [buffer (make-array Byte/TYPE 1024)]
+ (loop []
+ (let [size (.read input buffer)]
+ (when (and (pos? size) (< (.size output) tail))
+ (do (.write output buffer 0 size)
+ (recur))))))
(.toString output)) "File not found")
))