Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve all dfs referrals instead of 1 #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sparkforreg
Copy link

No description provided.

@sparkforreg
Copy link
Author

How to reproduce:
try (SmbFile smbFile = new SmbFile(filePath, context)) {
var list = smbFile.listFiles();
System.out.println(list);
}

where the filePath is a dfs with 2 nodes: active and passive.
dr = getDfsReferrals(getContext(), path, req.getServer(), req.getDomain(), 1); resolves only one node because of last parameter equals to 1. If this method resolves the passive node then below code fails with error:

`Exception in thread "main" jcifs.smb.SmbException: 0xC000026E
at jcifs.smb.SmbTransportImpl.checkStatus2(SmbTransportImpl.java:1496)
at jcifs.smb.SmbTransportImpl.checkStatus(SmbTransportImpl.java:1607)
at jcifs.smb.SmbTransportImpl.sendrecv(SmbTransportImpl.java:1014)
at jcifs.smb.SmbTransportImpl.send(SmbTransportImpl.java:1578)
at jcifs.smb.SmbSessionImpl.send(SmbSessionImpl.java:409)
at jcifs.smb.SmbSessionImpl.send(SmbSessionImpl.java:347)
at jcifs.smb.SmbTreeImpl.treeConnect(SmbTreeImpl.java:611)
at jcifs.smb.SmbTreeConnection.connectTree(SmbTreeConnection.java:614)
at jcifs.smb.SmbTreeConnection.connectHost(SmbTreeConnection.java:568)
at jcifs.smb.SmbTreeConnection.connectHost(SmbTreeConnection.java:489)
at jcifs.smb.SmbTreeConnection.connect(SmbTreeConnection.java:465)
at jcifs.smb.SmbTreeConnection.connectWrapException(SmbTreeConnection.java:426)
at jcifs.smb.SmbTreeConnection.resolveDfs0(SmbTreeConnection.java:703)
at jcifs.smb.SmbTreeConnection.ensureDFSResolved(SmbTreeConnection.java:672)
at jcifs.smb.SmbTreeConnection.send0(SmbTreeConnection.java:398)
at jcifs.smb.SmbTreeConnection.send(SmbTreeConnection.java:318)
at jcifs.smb.SmbTreeConnection.send(SmbTreeConnection.java:298)
at jcifs.smb.SmbTreeHandleImpl.send(SmbTreeHandleImpl.java:130)
at jcifs.smb.SmbTreeHandleImpl.send(SmbTreeHandleImpl.java:117)
at jcifs.smb.DirFileEntryEnumIterator2.open(DirFileEntryEnumIterator2.java:96)
at jcifs.smb.DirFileEntryEnumIteratorBase.(DirFileEntryEnumIteratorBase.java:67)
at jcifs.smb.DirFileEntryEnumIterator2.(DirFileEntryEnumIterator2.java:57)
at jcifs.smb.SmbEnumerationUtil.doEnum(SmbEnumerationUtil.java:223)
at jcifs.smb.SmbEnumerationUtil.listFiles(SmbEnumerationUtil.java:279)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1227)

@bmstr-ru
Copy link

bmstr-ru commented Oct 29, 2024

Thumbs up for this fix! Helped me to bypass the same issue.

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.

2 participants