Impersonating for [Local] File Access

Discussion in 'ASP .Net Security' started by David Williams, Feb 17, 2004.

  1. I have a DLL that I am writing that will be used from our web site. Within this DLL I must change the user that the code is running under so that I have access to several unmanaged API's, WMI, Registry read/write access, and creation and update of a number of files. The user that I am changing to is in a group (NOT an administator) that has the rights assigned in the group policy that I need. Changing to the user using the LoginUser API and setting the WindowsIndenity is fairly trival (once you know what needs to be done!).

    The problem that I am currently struggling with is that a number of temporary files need to be created. When the call IO.Path.GetTempFileName is made an exception of "Invalid Directory Name" is thrown. I suppect that the problem is security related as when during debugging I attempt to see the Environment.SpecialFolders.ApplicationData directory it returns an empty string. Can anyone give me a pointer to what I need to do to continue forward?

    TIA

    David
     
    David Williams, Feb 17, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason

    impersonating and LogonUser

    Jason, Dec 30, 2003, in forum: ASP .Net
    Replies:
    7
    Views:
    459
    Jim Cheshire [MSFT]
    Jan 5, 2004
  2. Replies:
    4
    Views:
    501
  3. =?Utf-8?B?SW5kZXB0aA==?=
    Replies:
    1
    Views:
    484
    Bruce Barker
    Apr 1, 2005
  4. =?Utf-8?B?QWxpc3RhaXIgTGFjeQ==?=

    Compilation error when impersonating

    =?Utf-8?B?QWxpc3RhaXIgTGFjeQ==?=, Jul 19, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    561
    Patrice
    Jul 19, 2005
  5. =?Utf-8?B?WVNVVA==?=

    Access local port or Running local exe file

    =?Utf-8?B?WVNVVA==?=, Jan 14, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    526
    =?Utf-8?B?WVNVVA==?=
    Jan 14, 2006
Loading...

Share This Page