Problem with user impersonation and access rights

From: Frank C. (frankc_at_hotmail.com)
Date: 08/04/03


Date: Sun, 3 Aug 2003 21:52:54 -0300


I want to copy files from a given directory 'A', for instance, to 'B'.

Lets consider two users: FIRST, the user that runs the application and have
rights to access the directory 'A' but have full rights on 'B' and SECOND
that have rights to access the directory 'B' but have full rights on 'A'
(the opposite).

Without impersonation, I cannot copy from A to B because the user FIRST
doesn't have permission to access A.

If I use LogonUser and ImpersonateLoggedOnUser to impersonate the user
SECOND, but I cannot copy because SECOND doesn have permission to access B.

Well, I could impersonate SECOND, then copy the files to a temporary
directory where both users can access, the revert and copy to B.

But I am wondering if is there a more intelligent way, by merging the rights
of FIRST and SECOND and copying the files directly in one pass.

Any idea?



Relevant Pages

  • MOSS 2007 - Changing ListItem permissions in EventReciever
    ... Feature registrates FeatureEventReciever ... ItemAdded event changes access rights of item that was created to ... So I need to impersonate programmatically Admin user. ... bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, ...
    (microsoft.public.sharepoint.portalserver)
  • Re: System.Security.Principal.WindowsImpersonation
    ... This posting is provided "AS IS" with no warranties, and confers no rights. ... >>' This sample can be run only on Windows XP. ... >>' proper execution presents a security risk. ... >>impersonate a user on this machine. ...
    (microsoft.public.dotnet.security)
  • Re: System.Diagnostic.Process and disfunctional process
    ... I think you will still need to impersonate a user that has rights to ... > connections. ... The process is a service that accepts incoming tcp ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: anonymous access + impersonation
    ... If i understood your problem exactly, my advice u to impersonate your com+ ... application(or you can modify IIS application protection level). ... ASPNET user and give directory listing rights on that hard drive... ... > apppool user & its password. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Problem with user impersonation and access rights
    ... rights to access the directory 'A' but have full rights on 'B' and SECOND ... If I use LogonUser and ImpersonateLoggedOnUser to impersonate the user ... but I cannot copy because SECOND doesn have permission to access B. ... of FIRST and SECOND and copying the files directly in one pass. ...
    (microsoft.public.win2000.security)