Link to home
Create AccountLog in
Avatar of Tomazaz
Tomazaz

asked on

Why newly created file do not inherit IUSR permission

Hi,

I am hosting ASP.NET application, the main purpose of it is file manipulation. My ASP.NET application use one external program(exe) to convert file from one format to another. I have "c:\files" folder which has IUSR permission and it is set as virtual folder in IIS6.
The problem is that when my ASP.NEt application run external program to create file, the newly created file in "c:\files" folder do not has IUSR permission. How to solve it?

The application(exe) which I run from ASP.NET is .NET application. We have used win32 application instead of .NET app before and it was OK, all created files were with IUSR permission.

Regards,
Tomas
Avatar of meverest
meverest
Flag of Australia image

do you have 'allow inherit' set on the containing folder?

do you set any access rights from within the asp.net application?

Cheers.
Avatar of Tomazaz
Tomazaz

ASKER

I have attached permissions dialog screenshot of "c:\files" folder.

My asp.net web page has access to this folder.

per.gif
Hello,

I see that the IUSR permission is set explicitly on that folder, and is not inherited from the parent.

Now I'm not 100% certain of this, but one way to interpret the meaning of the text "Allow inheritable permissions from the PARENT to propogate to this object and child objects" may be that child object of this node may only inherit properties of the PARENT (i.e. C:\) and not necessarily the c:\files.

Try setting the read access for the IUSR account on the c:\ path and see if that makes a difference.  Caution though!  I would not recommend to leave it that way for longer than it takes to run a quick test/

I'm interested to hear the result.

Cheers.
Avatar of Tomazaz

ASKER

Nothing changed.

I have tried to move any file from c:\ disc to c:\files folder and file inherited permission correctly. But when ASP.NET execute our exe application, newly created file with application in that directory do not has IUSR permission.
OK,

It is probably a .NET thing then rather than any IIS issue - I see that you cross linked to the .NET topic area, so hopefully someone else will chip in too.

what is the file creation routine you use, and what arguments do you give it?

Cheers.
Avatar of Tomazaz

ASKER

Just found even strange issue.

If I run that application(exe) from Administrator account and try to convert file in c:\File directory(it has IUSR permission), the newly created file with that application do not has IUSR permission.
If I run notepad and save txt file into that directory, it has IUSR permission.

Can anyone explain what is going on? Meverest, I agree with you that it is .NET incorrect behaviour because our application which convert files is .NET application.
Hi it probably has something to do with access rights of the interactive user then.  What user does the .NET application run as?  When you look at the newly created file, who is the 'owner'?

Cheers.
Avatar of Tomazaz

ASKER

The file(created with .NET app) owner is Administrators and that file has these permissions
Administrator(Inherited from parent c:\)
System(Inherited from parent c:\)
And now intresting things...
Power User(Parent Object)
Networ Service(Parent Object)
What is parent object? Also IUSR permission is missing.

Let's see that permission has file created with notepad in the same directory
Owner:Administrator
Permissions
Administrator(Inherited from parent c:\)
IUSR(Inherited from parent c:\)
User(Inherited from parent c:\)
System(Inherited from parent c:\)

I have noticed that .NET application use DCOM object to create files, don't know if this can make any side effect.

<<What user does the .NET application run as?>>
How to check this?
ASKER CERTIFIED SOLUTION
Avatar of meverest
meverest
Flag of Australia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account