PC Review


Reply
Thread Tools Rate Thread

Directory.CreateDirectory() issue

 
 
Ken
Guest
Posts: n/a
 
      12th Nov 2007
I'm currently working on framework 1.1 webapplication using C#.
When I test the application located in my local machine, it works fine to
"Directory.CreateDirectory()".
However, I test the application use in server machine, it doesn't work.
it make security log like below.
Anyone has a idea for this????

Thanks

======================
Object Open:

Object Server: Security

Object Type: File

Object Name: D:\

Handle ID: -

Operation ID: {0,15777290}

Process ID: 480

Image File Name: C:\WINDOWS\system32\inetsrv\w3wp.exe

Primary User Name: NETWORK SERVICE

Primary Domain: NT AUTHORITY

Primary Logon ID: (0x0,0x3E4)

Client User Name: www.ken.c

Client Domain: TFken.COM

Client Logon ID: (0x0,0xE4A05E)

Accesses: ReadAttributes


Privileges: -

Restricted Sid Count: 0

Access Mask: 0x80



For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

=====================================






 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      12th Nov 2007
Ken,

It looks pretty obvious to me. The NETWORK SERVICE user doesn't have
rights to the root of the D drive. Change the permissions so that it does.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Ken" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> I'm currently working on framework 1.1 webapplication using C#.
> When I test the application located in my local machine, it works fine to
> "Directory.CreateDirectory()".
> However, I test the application use in server machine, it doesn't work.
> it make security log like below.
> Anyone has a idea for this????
>
> Thanks
>
> ======================
> Object Open:
>
> Object Server: Security
>
> Object Type: File
>
> Object Name: D:\
>
> Handle ID: -
>
> Operation ID: {0,15777290}
>
> Process ID: 480
>
> Image File Name: C:\WINDOWS\system32\inetsrv\w3wp.exe
>
> Primary User Name: NETWORK SERVICE
>
> Primary Domain: NT AUTHORITY
>
> Primary Logon ID: (0x0,0x3E4)
>
> Client User Name: www.ken.c
>
> Client Domain: TFken.COM
>
> Client Logon ID: (0x0,0xE4A05E)
>
> Accesses: ReadAttributes
>
>
> Privileges: -
>
> Restricted Sid Count: 0
>
> Access Mask: 0x80
>
>
>
> For more information, see Help and Support Center at
> http://go.microsoft.com/fwlink/events.asp.
>
> =====================================
>
>
>
>
>
>



 
Reply With Quote
 
Ken
Guest
Posts: n/a
 
      12th Nov 2007
well,
I added the Network service however, it didn't solve the problem.


"Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote in
message news:%(E-Mail Removed)...
> Ken,
>
> It looks pretty obvious to me. The NETWORK SERVICE user doesn't have
> rights to the root of the D drive. Change the permissions so that it
> does.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - (E-Mail Removed)
>
> "Ken" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> I'm currently working on framework 1.1 webapplication using C#.
>> When I test the application located in my local machine, it works fine to
>> "Directory.CreateDirectory()".
>> However, I test the application use in server machine, it doesn't work.
>> it make security log like below.
>> Anyone has a idea for this????
>>
>> Thanks
>>
>> ======================
>> Object Open:
>>
>> Object Server: Security
>>
>> Object Type: File
>>
>> Object Name: D:\
>>
>> Handle ID: -
>>
>> Operation ID: {0,15777290}
>>
>> Process ID: 480
>>
>> Image File Name: C:\WINDOWS\system32\inetsrv\w3wp.exe
>>
>> Primary User Name: NETWORK SERVICE
>>
>> Primary Domain: NT AUTHORITY
>>
>> Primary Logon ID: (0x0,0x3E4)
>>
>> Client User Name: www.ken.c
>>
>> Client Domain: TFken.COM
>>
>> Client Logon ID: (0x0,0xE4A05E)
>>
>> Accesses: ReadAttributes
>>
>>
>> Privileges: -
>>
>> Restricted Sid Count: 0
>>
>> Access Mask: 0x80
>>
>>
>>
>> For more information, see Help and Support Center at
>> http://go.microsoft.com/fwlink/events.asp.
>>
>> =====================================
>>
>>
>>
>>
>>
>>

>
>



 
Reply With Quote
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      12th Nov 2007
Have you tried to run the service as the same user that your test app
runs under? If so, then you didn't give the user the correct permissions.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Ken" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> well,
> I added the Network service however, it didn't solve the problem.
>
>
> "Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote
> in message news:%(E-Mail Removed)...
>> Ken,
>>
>> It looks pretty obvious to me. The NETWORK SERVICE user doesn't have
>> rights to the root of the D drive. Change the permissions so that it
>> does.
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - (E-Mail Removed)
>>
>> "Ken" <(E-Mail Removed)> wrote in message
>> news:%(E-Mail Removed)...
>>> I'm currently working on framework 1.1 webapplication using C#.
>>> When I test the application located in my local machine, it works fine
>>> to
>>> "Directory.CreateDirectory()".
>>> However, I test the application use in server machine, it doesn't work.
>>> it make security log like below.
>>> Anyone has a idea for this????
>>>
>>> Thanks
>>>
>>> ======================
>>> Object Open:
>>>
>>> Object Server: Security
>>>
>>> Object Type: File
>>>
>>> Object Name: D:\
>>>
>>> Handle ID: -
>>>
>>> Operation ID: {0,15777290}
>>>
>>> Process ID: 480
>>>
>>> Image File Name: C:\WINDOWS\system32\inetsrv\w3wp.exe
>>>
>>> Primary User Name: NETWORK SERVICE
>>>
>>> Primary Domain: NT AUTHORITY
>>>
>>> Primary Logon ID: (0x0,0x3E4)
>>>
>>> Client User Name: www.ken.c
>>>
>>> Client Domain: TFken.COM
>>>
>>> Client Logon ID: (0x0,0xE4A05E)
>>>
>>> Accesses: ReadAttributes
>>>
>>>
>>> Privileges: -
>>>
>>> Restricted Sid Count: 0
>>>
>>> Access Mask: 0x80
>>>
>>>
>>>
>>> For more information, see Help and Support Center at
>>> http://go.microsoft.com/fwlink/events.asp.
>>>
>>> =====================================
>>>
>>>
>>>
>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Ken
Guest
Posts: n/a
 
      13th Nov 2007
well, I couldn't do that because that I don't have right to do in that
server.
the odd thing is the application tried to create a folder under
"D:\Hosting\direct.com\www\html-Admin\ProductImages\50" for a example.
but security event log said "Object Name: D:\" not the full name of the
path.


"Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Have you tried to run the service as the same user that your test app
> runs under? If so, then you didn't give the user the correct permissions.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - (E-Mail Removed)
>
> "Ken" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> well,
>> I added the Network service however, it didn't solve the problem.
>>
>>
>> "Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote
>> in message news:%(E-Mail Removed)...
>>> Ken,
>>>
>>> It looks pretty obvious to me. The NETWORK SERVICE user doesn't have
>>> rights to the root of the D drive. Change the permissions so that it
>>> does.
>>>
>>>
>>> --
>>> - Nicholas Paldino [.NET/C# MVP]
>>> - (E-Mail Removed)
>>>
>>> "Ken" <(E-Mail Removed)> wrote in message
>>> news:%(E-Mail Removed)...
>>>> I'm currently working on framework 1.1 webapplication using C#.
>>>> When I test the application located in my local machine, it works fine
>>>> to
>>>> "Directory.CreateDirectory()".
>>>> However, I test the application use in server machine, it doesn't work.
>>>> it make security log like below.
>>>> Anyone has a idea for this????
>>>>
>>>> Thanks
>>>>
>>>> ======================
>>>> Object Open:
>>>>
>>>> Object Server: Security
>>>>
>>>> Object Type: File
>>>>
>>>> Object Name: D:\
>>>>
>>>> Handle ID: -
>>>>
>>>> Operation ID: {0,15777290}
>>>>
>>>> Process ID: 480
>>>>
>>>> Image File Name: C:\WINDOWS\system32\inetsrv\w3wp.exe
>>>>
>>>> Primary User Name: NETWORK SERVICE
>>>>
>>>> Primary Domain: NT AUTHORITY
>>>>
>>>> Primary Logon ID: (0x0,0x3E4)
>>>>
>>>> Client User Name: www.ken.c
>>>>
>>>> Client Domain: TFken.COM
>>>>
>>>> Client Logon ID: (0x0,0xE4A05E)
>>>>
>>>> Accesses: ReadAttributes
>>>>
>>>>
>>>> Privileges: -
>>>>
>>>> Restricted Sid Count: 0
>>>>
>>>> Access Mask: 0x80
>>>>
>>>>
>>>>
>>>> For more information, see Help and Support Center at
>>>> http://go.microsoft.com/fwlink/events.asp.
>>>>
>>>> =====================================
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Ken
Guest
Posts: n/a
 
      13th Nov 2007
Nicholas,
I add some code like
========================================================
IPrincipal ip = Thread.CurrentPrincipal;



string iname= ip.Identity.Name;

lbltest.text=iname.ToString();

==================================================================

on my local web site it shows up the user.

However, the web site on the server doesn't show any user.

is it some issues of Kerberos ?


"Ken" <(E-Mail Removed)> wrote in message
news:O$(E-Mail Removed)...
> well, I couldn't do that because that I don't have right to do in that
> server.
> the odd thing is the application tried to create a folder under
> "D:\Hosting\direct.com\www\html-Admin\ProductImages\50" for a example.
> but security event log said "Object Name: D:\" not the full name of the
> path.
>
>
> "Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote
> in message news:(E-Mail Removed)...
>> Have you tried to run the service as the same user that your test app
>> runs under? If so, then you didn't give the user the correct
>> permissions.
>>
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - (E-Mail Removed)
>>
>> "Ken" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> well,
>>> I added the Network service however, it didn't solve the problem.
>>>
>>>
>>> "Nicholas Paldino [.NET/C# MVP]" <(E-Mail Removed)> wrote
>>> in message news:%(E-Mail Removed)...
>>>> Ken,
>>>>
>>>> It looks pretty obvious to me. The NETWORK SERVICE user doesn't
>>>> have rights to the root of the D drive. Change the permissions so that
>>>> it does.
>>>>
>>>>
>>>> --
>>>> - Nicholas Paldino [.NET/C# MVP]
>>>> - (E-Mail Removed)
>>>>
>>>> "Ken" <(E-Mail Removed)> wrote in message
>>>> news:%(E-Mail Removed)...
>>>>> I'm currently working on framework 1.1 webapplication using C#.
>>>>> When I test the application located in my local machine, it works fine
>>>>> to
>>>>> "Directory.CreateDirectory()".
>>>>> However, I test the application use in server machine, it doesn't
>>>>> work.
>>>>> it make security log like below.
>>>>> Anyone has a idea for this????
>>>>>
>>>>> Thanks
>>>>>
>>>>> ======================
>>>>> Object Open:
>>>>>
>>>>> Object Server: Security
>>>>>
>>>>> Object Type: File
>>>>>
>>>>> Object Name: D:\
>>>>>
>>>>> Handle ID: -
>>>>>
>>>>> Operation ID: {0,15777290}
>>>>>
>>>>> Process ID: 480
>>>>>
>>>>> Image File Name: C:\WINDOWS\system32\inetsrv\w3wp.exe
>>>>>
>>>>> Primary User Name: NETWORK SERVICE
>>>>>
>>>>> Primary Domain: NT AUTHORITY
>>>>>
>>>>> Primary Logon ID: (0x0,0x3E4)
>>>>>
>>>>> Client User Name: www.ken.c
>>>>>
>>>>> Client Domain: TFken.COM
>>>>>
>>>>> Client Logon ID: (0x0,0xE4A05E)
>>>>>
>>>>> Accesses: ReadAttributes
>>>>>
>>>>>
>>>>> Privileges: -
>>>>>
>>>>> Restricted Sid Count: 0
>>>>>
>>>>> Access Mask: 0x80
>>>>>
>>>>>
>>>>>
>>>>> For more information, see Help and Support Center at
>>>>> http://go.microsoft.com/fwlink/events.asp.
>>>>>
>>>>> =====================================
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Directory.CreateDirectory Tom Microsoft Dot NET Framework 1 26th Jul 2008 10:35 AM
Directory.CreateDirectory Tom Microsoft Dot NET 4 26th Jul 2008 10:35 AM
Directory.CreateDirectory followed by Directory.Move Matt MacDonald Microsoft ASP .NET 0 30th Jan 2008 07:34 PM
Directory.CreateDirectory() issue Ken Microsoft Dot NET Framework 1 12th Nov 2007 07:21 PM
CreateDirectory() and Directory::CreateDirectory() conflict ... H.B. Microsoft VC .NET 1 6th Jun 2005 05:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:12 AM.