fix: use the jcifs 3.x property names for NTLM parameters and SMB1 logging - #205
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to codelibs/jcifs#81 / codelibs/jcifs#87, which found that jcifs 3.0.0
renamed every configuration key (dropping the
.smbsegment) and that old keys areignored without any diagnostic. Two places in this repository still use the old names.
NTLM parameters
WebAuthenticationConfig#ntlmParametersdocuments what a crawler config may put inthat map:
All three are dead names.
jcifs.smb.client.domainis a real property under its new name,jcifs.client.domain. The map is turned into aPropertiesbyHc5HttpClient/Hc4HttpClientand handed toHc5JcifsEngine/JcifsEngine,which do
new BaseContext(new PropertyConfiguration(props)).PropertyConfigurationlooks 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_SNDBUFandSO_RCVBUFwere never jcifs property names under any prefix,in 2.x or 3.x. The socket buffer properties are
snd_buf_sizeandrcv_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 jcifsLogStreamlevel from SLF4J, butonly when the user has not pinned one:
Since jcifs 3.0.0 the legacy stack reads
jcifs.util.loglevel— its ownConfigstatic block does exactly that. So the guard never fires: a user who sets
-Djcifs.util.loglevel=3has it applied by jcifs and then immediately overwrittenhere. 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_RCVBUFbecomesnd_buf_size/rcv_buf_size.Verification
mvn -pl fess-crawler testfor the five affected classes — 94 tests, 0 failures,0 errors.
mvn formatter:format && mvn license:format— no further changes.fess-parentpins):PropertyConfigurationreadsjcifs.client.domain,jcifs.client.snd_buf_sizeand
jcifs.client.rcv_buf_size;org.codelibs.jcifs.smb1.Config's static blockreads
jcifs.util.loglevel.