Skip to content

fix: use the jcifs 3.x property names for NTLM parameters and SMB1 logging - #205

Merged
marevol merged 1 commit into
mainfrom
fix/ntlm-parameter-property-names
Sep 10, 2026
Merged

marevol merged 1 commit into
mainfrom
fix/ntlm-parameter-property-names

Conversation

@marevol

@marevol marevol commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Follow-up to codelibs/jcifs#81 / codelibs/jcifs#87, which found that jcifs 3.0.0
renamed every configuration key (dropping the .smb segment) and that old keys are
ignored without any diagnostic. Two places in this repository still use the old names.

NTLM parameters

WebAuthenticationConfig#ntlmParameters documents what a crawler config may put in
that map:

 * <li>jcifs.smb.client.SO_SNDBUF - TCP send buffer size</li>
 * <li>jcifs.smb.client.SO_RCVBUF - TCP receive buffer size</li>
 * <li>jcifs.smb.client.domain - Default domain</li>

All three are dead names.

  • jcifs.smb.client.domain is a real property under its new name,
    jcifs.client.domain. The map is turned into a Properties by
    Hc5HttpClient / Hc4HttpClient and handed to Hc5JcifsEngine / JcifsEngine,
    which do new BaseContext(new PropertyConfiguration(props)). PropertyConfiguration
    looks the key up verbatim, does not find it, and uses the default — so an NTLM
    domain configured this way has been silently ignored since the jcifs 3.x upgrade.
  • SO_SNDBUF and SO_RCVBUF were never jcifs property names under any prefix,
    in 2.x or 3.x. The socket buffer properties are snd_buf_size and rcv_buf_size.

The list is corrected and gains a line naming the rename, so the 2.x spelling does not
get copied back in from an old example. Once jcifs#87 ships, a configuration still
carrying the old key will also log a warning naming the replacement.

SMB1 log level

smb1/SmbClient's static block derives the jcifs LogStream level from SLF4J, but
only when the user has not pinned one:

if (Config.getInt("jcifs.smb1.util.loglevel", -1) == -1) {

Since jcifs 3.0.0 the legacy stack reads jcifs.util.loglevel — its own Config
static block does exactly that. So the guard never fires: a user who sets
-Djcifs.util.loglevel=3 has it applied by jcifs and then immediately overwritten
here. Changed to test the key jcifs actually reads.

Tests

Five test classes use these key strings as the example NTLM parameters. The keys are
opaque to the assertions — they only check the map round-trips — so this is a rename,
not a behaviour change, but leaving dead names in the tests is how the old spelling
keeps getting copied. SO_SNDBUF / SO_RCVBUF become snd_buf_size /
rcv_buf_size.

Verification

  • mvn -pl fess-crawler test for the five affected classes — 94 tests, 0 failures,
    0 errors.
  • mvn formatter:format && mvn license:format — no further changes.
  • Property names checked against jcifs 3.0.3 (the version fess-parent pins):
    PropertyConfiguration reads jcifs.client.domain, jcifs.client.snd_buf_size
    and jcifs.client.rcv_buf_size; org.codelibs.jcifs.smb1.Config's static block
    reads jcifs.util.loglevel.

…gging

WebAuthenticationConfig advertised jcifs.smb.client.domain,
jcifs.smb.client.SO_SNDBUF and jcifs.smb.client.SO_RCVBUF as the NTLM
parameters a crawler configuration may carry. All three are dead:

- jcifs 3.0.0 dropped the .smb segment from every key, so the real name
  is jcifs.client.domain. NTLM parameters go straight into
  PropertyConfiguration through Hc5JcifsEngine and JcifsEngine, which
  looks the key up verbatim and falls back to its default, so a domain
  set this way has been silently ignored.
- SO_SNDBUF and SO_RCVBUF were never jcifs property names under any
  prefix. The buffer sizes are jcifs.client.snd_buf_size and
  jcifs.client.rcv_buf_size.

Correct the list and note the rename so the old spelling is not
copied back in.

The SMB1 client had the matching problem in code: its static block skips
deriving the jcifs log level from SLF4J when the user has set one, but
tested jcifs.smb1.util.loglevel. Since 3.0.0 the legacy stack reads
jcifs.util.loglevel, so an explicit level was read by jcifs and then
overwritten here. Test the key jcifs actually reads.

The NTLM parameter maps in the affected tests use the same key strings as
examples; renamed with the javadoc so they stay in step. The keys are
opaque to those assertions, so behaviour is unchanged.
marevol added a commit to codelibs/fess-parent that referenced this pull request Sep 10, 2026
jcifs was pinned to the released 3.0.3 by #68, which was the 15.8 release
pin. The 15.9 line moved on in #72 and the CodeLibs libraries were only
partly bumped back to development snapshots afterwards, in #75 and #76,
so jcifs stayed on the 15.8 release while its repository develops 3.0.4.

That matters now: 3.0.4 carries the configuration property fixes from
codelibs/jcifs#81, including the warning that tells an operator when a
property is being ignored because it still uses a pre-3.0.0 prefix.
codelibs/fess#3433 and codelibs/fess-crawler#205 correct Fess's own uses
of those names, and this is the dependency that makes the diagnostic
reach anyone whose configuration still has them.

3.0.4-SNAPSHOT resolves from the Central Portal snapshot repository this
pom already declares.
@marevol marevol self-assigned this Sep 10, 2026
@marevol marevol added this to the 15.9.0 milestone Sep 10, 2026
@marevol
marevol merged commit 243c0b9 into main Sep 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant