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

Information question about DfsImpl class #335

Open
Dirk-A opened this issue May 12, 2023 · 1 comment
Open

Information question about DfsImpl class #335

Dirk-A opened this issue May 12, 2023 · 1 comment

Comments

@Dirk-A
Copy link

Dirk-A commented May 12, 2023

Hi,

In the getLinkReferral method, in case of domain referral this line of code:

link = path != null && dr.getPathConsumed() > 0 ? path.substring(0, dr.getPathConsumed()) : "\";

determines the new deferral link, but in some cases it returns the parent folder of the actual intended folder. It is caused by taking a substring of the current using the dr.getPathConsumed()
Question: can anyone explain why a substring is taken at this point? How is dr.getPathConsumed() constructed?

Tnx in advance

@mbechler
Copy link
Contributor

dr.getPathConsumed() provided by the server to indicate how much of the requested path is replaced by the referral target.

E.g. if you have \domain\dfsroot\some\subdir\foo\bar and a DFS link is configured for \some\subdir to e.g. point to \server2\share\other\dir:

pathConsumed returned in the refereral should be len("\some\subdir"), the client can then determine that a) the redirection should be applied to the resources below that path (stored in link for caching), and also the remaining path \foo\bar that indicates the portion that needs to be appended to the referral target, \server2\share\other\dir + \foo\bar

If the parent folder in that case is the path for which the DFS referral is configured, that would be the expected behavior.

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

No branches or pull requests

2 participants