You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@zeppelin.apache.org by "dev-donghwan (via GitHub)" <gi...@apache.org> on 2026/07/26 15:57:42 UTC
[PR] [ZEPPELIN-6530] Fix operator precedence in SSL store path checks and make isWindowsPath null-safe [zeppelin]
dev-donghwan opened a new pull request, #5353:
URL: https://github.com/apache/zeppelin/pull/5353
### What is this PR for?
`getKeyStorePath()` and `getTrustStorePath()` in `ZeppelinConfiguration` contain
a mis-parenthesized condition:
```java
if (path != null && path.startsWith("/") || isWindowsPath(path)) {
```
The condition is meant to answer a single question — "is `path` an absolute
path (Unix `/...` or Windows `C:\...`)?" — with `path != null` guarding the
whole check. But since `&&` binds tighter than `||`, it actually parses as
`(path != null && path.startsWith("/")) || isWindowsPath(path)`, leaving
`isWindowsPath(path)` outside the null guard. `isWindowsPath` dereferences its
argument, so a null `path` would throw an NPE.
Note on reachability: with the current defaults this NPE is latent rather than
user-facing. `ZEPPELIN_SSL_KEYSTORE_PATH` has a non-null default (`"keystore"`),
so `getKeyStorePath()` never sees a null path, and `getTrustStorePath()` falls
back to `getKeyStorePath()` when the truststore path is unset. So this PR is a
correctness/hardening fix, not a fix for a currently reproducible crash.
This PR:
- restores the intended grouping in both methods —
`path != null && (path.startsWith("/") || isWindowsPath(path))` — matching
the correctly-parenthesized pattern already used in `getAbsoluteDir()` in the
same class
- makes `isWindowsPath(null)` return `false` instead of throwing, as defense
in depth
### What type of PR is it?
Bug Fix
### Todos
* [x] - Add the missing parentheses in `getKeyStorePath()` / `getTrustStorePath()`
* [x] - Make `isWindowsPath` null-safe
* [x] - Add a unit test for `isWindowsPath(null)`
### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-6530
### How should this be tested?
* `./mvnw test -pl zeppelin-server -Dtest=ZeppelinConfigurationTest`
* The new `isWindowsPathTestNull` asserts `isWindowsPath(null)` returns `false`
(it threw an NPE before this change), following the existing
`isWindowsPathTestTrue` / `isWindowsPathTestFalse` convention.
### Screenshots (if appropriate)
N/A
### Questions:
* Does the license files need to update? No
* Is there breaking changes for older versions? No — behavior is unchanged for
all reachable inputs; only the (previously unreachable) null case changes from
NPE to the intended relative-path fallback
* Does this needs documentation? No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ZEPPELIN-6530] Fix operator precedence in SSL store path checks and make isWindowsPath null-safe [zeppelin]
Posted by "tbonelee (via GitHub)" <gi...@apache.org>.
tbonelee commented on PR #5353:
URL: https://github.com/apache/zeppelin/pull/5353#issuecomment-5132814104
Merged into master
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ZEPPELIN-6530] Fix operator precedence in SSL store path checks and make isWindowsPath null-safe [zeppelin]
Posted by "tbonelee (via GitHub)" <gi...@apache.org>.
tbonelee merged PR #5353:
URL: https://github.com/apache/zeppelin/pull/5353
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org