Github user ptgoetz commented on a diff in the pull request:
https://github.com/apache/incubator-storm/pull/91#discussion_r12031392
--- Diff: 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)
--- End diff --
@d2r I think we're okay with this patch. I tried a couple of things and it
looks like you can't override `root-dir` in the request since the
`conf-middleware` function associates it with the request, so it is ignored if
supplied as a request parameter.
I tried the following url:
```
http://supervisor:8000/log?file=hosts&log-root=/etc/
```
And nothing was returned. I got the following in `logviewer.log`:
```
2014-04-27 14:07:23 o.m.log [WARN] /log?file=hosts&log-root=/etc/
java.io.FileNotFoundException: /var/log/storm/hosts (No such file or
directory)
```
(Note that in this installation, storm is configured to log to
`/var/log/storm/`)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---