473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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

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

May 2 '06 #1
2 2069
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
"James" <jz******@gmail.com> wrote in message
news:11*********************@i39g2000cwa.googlegro ups.com...
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

May 2 '06 #2
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).

--
Patrice

"James" <jz******@gmail.com> a écrit dans le message de news:
11*********************@i39g2000cwa.googlegroups.c om...
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

May 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: varlagas | last post by:
We disabled the antivirus software but the problem persists. Any clues? Many thanks in advance! Panagiotis Varlagas ======================================================================= ...
2
by: ykgoh | last post by:
Hi. I've a problem of being able to create and remove a directory but unable to write a file inside the created directory for some strange reason. I suspect that this problem could be vaguely...
3
by: David Thielen | last post by:
Hi; I created a virtual directory in IIS 6.0 and my asp.net app runs fine. But when it tries to write a file I get: Access to the path is denied. - C:\Inetpub\wwwroot\RunReportASP\images ...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
0
by: daniele.balducci | last post by:
Hi All, I'm experiencing troubles in a simple .net web application. The applicatione is made up by a single form looping to move some files to a different folder . the main loop is as follows...
13
by: George | last post by:
Hi, I am re-writing part of my application using C#. This application starts another process which execute a "legacy" program. This legacy program writes to a log file and before it ends, it...
17
by: Peter Duniho | last post by:
I searched using Google, on the web and in the newsgroups, and found nothing on this topic. Hopefully that means I just don't understand what I'm supposed to be doing here. :) The problem: ...
16
by: Mich | last post by:
Hi, i'm building an web application for anonymous users. They can take a look in the website, nothing more. In order to perform other actions, the anonymous user must be logged. So i create an...
30
by: Adam Baker | last post by:
Hello, I'm writing a site where a handful of people will be able to edit the content using PHP scripts (FCKeditor). The content is stored as individual files in a directory. I'd like to validate...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.