Skip to content

[pull] master from apache:master - #640

Merged
pull[bot] merged 1 commit into
miqdigital:masterfrom
apache:master
Jul 30, 2026
Merged

[pull] master from apache:master#640
pull[bot] merged 1 commit into
miqdigital:masterfrom
apache:master

Conversation

@pull

@pull pull Bot commented Jul 30, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…make isWindowsPath null-safe

### 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


Closes #5353 from dev-donghwan/ZEPPELIN-6530.

Signed-off-by: ChanHo Lee <chanholee@apache.org>
@pull pull Bot locked and limited conversation to collaborators Jul 30, 2026
@pull pull Bot added the ⤵️ pull label Jul 30, 2026
@pull
pull Bot merged commit c11fe27 into miqdigital:master Jul 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant