Problem with access to shared folder

Petr Hanák 0 Reputation points
2023-09-29T13:11:53.01+00:00
  • Question is related to the own MSRPC service developed in C++ using VisualStudio 2022.
  • Service runs on domain server (win 2016).
  • Authentication to service is done by SCHANNEL using TLS
  • Client accessing the service is a domain user.
  • Service impersonates an authenticated client and starts the next own process by the function CreateProcessAsUser with the impersonated client access token.
  • The process needs access to local folders on domain server and shared folders on the next computer (win 7) in domain.
  • Starting process and access to local folders works without any problem.
  • Access rights to shared folder are set as full access for anyone but attempt to access shared folder doesn't work.
  • Unfortunately attempting to access shared folder by the function GetFileAttributes return INVALID_FILE_ATTRIBUTES and function GetLastError returns ACCESS DENIED.

Can you please advise me what I need to set/change to allow access to shared folders?

Thanks a lot, best regards

Petr

Windows for business Windows Client for IT Pros User experience Other
Developer technologies Visual Studio Other
{count} votes

1 answer

Sort by: Most helpful
  1. Gary Nebbett 6,216 Reputation points
    2023-10-02T10:34:54.54+00:00

    Hello Petr,

    This looks like a "double hop" authentication problem (see https://techcommunity.microsoft.com/t5/ask-the-directory-services-team/understanding-kerberos-double-hop/ba-p/395463).

    Impersonating the client on the ("first") server allows resources local to that server to be accessed, but there are probably no credentials available to authenticate with a second server. The link above contains a more detailed description of the problem and a potential solution ("delegation").

    Gary


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.