file sharing violation. Which permission should I give to the directory and files?

J

James

Hi all,

I am new to ASP.NET. I am currently working on a project with VB, .NET
1.1 on
a Windows 2000 server.
I have two files
C:\Inetpub\wwwroot\test\test.aspx
C:\Inetpub\wwwroot\test\test.exe

test.exe is a C program, it will be executed if the user click the
button in test.aspx page.

some code from test.aspx
....
Dim fname As String = Server.MapPath("test.exe")
Dim cmdline As String = fname & " > c:\temp\stdout.txt 2>
c:\temp\stderr.txt"
Dim retval As Integer
retval = Shell(Environ("COMSPEC") & " /c " & cmdline, AppWinStyle.Hide,
True, 100000)
....

I redirect stdout and stderr of test.exe to two files. Initially I want
to redirect them to
C:\Inetpub\wwwroot\test\stdout.txt, and
C:\Inetpub\wwwroot\test\stderr.txt, but failed.
It looks like the program does not have permissions to write to
C:\Inetpub\wwwroot\test\
directory. So I have to redirect them to c:\temp, where "Everyone" has
read&write
permissions, which is not secure. Even worse, the program cannot write
new data to
stdout.txt, neither can I delete the file manually. It says "There has
been a sharing
violation. The source or destination file may be in use"

My question is what kind of permissions should I give to directories
and files, and
where I should store files.

Thanks,

James
 
J

Jeff Dillon

You really should rethink this whole process. Shelling out to a program on
the server is a bad idea in general. You are already seeing some of the
issues.

What does this application do?

User Basic authentication for the users, then put the files where you need
to, and set the permissions for those users.

Jeff
 
P

Patrice

You could easily test this by just creating the text file.

Also what if several people are uisng this page roughly at the same time.
You should use a unique name for each (or think the process as suggested).
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top