473,785 Members | 2,391 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\wwwr oot\test\test.a spx
C:\Inetpub\wwwr oot\test\test.e xe

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.Hid e,
True, 100000)
....

I redirect stdout and stderr of test.exe to two files. Initially I want
to redirect them to
C:\Inetpub\wwwr oot\test\stdout .txt, and
C:\Inetpub\wwwr oot\test\stderr .txt, but failed.
It looks like the program does not have permissions to write to
C:\Inetpub\wwwr oot\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 2092
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******** *************@i 39g2000cwa.goog legroups.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\wwwr oot\test\test.a spx
C:\Inetpub\wwwr oot\test\test.e xe

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.Hid e,
True, 100000)
...

I redirect stdout and stderr of test.exe to two files. Initially I want
to redirect them to
C:\Inetpub\wwwr oot\test\stdout .txt, and
C:\Inetpub\wwwr oot\test\stderr .txt, but failed.
It looks like the program does not have permissions to write to
C:\Inetpub\wwwr oot\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************* ********@i39g20 00...legro 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\wwwr oot\test\test.a spx
C:\Inetpub\wwwr oot\test\test.e xe

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.Hid e,
True, 100000)
...

I redirect stdout and stderr of test.exe to two files. Initially I want
to redirect them to
C:\Inetpub\wwwr oot\test\stdout .txt, and
C:\Inetpub\wwwr oot\test\stderr .txt, but failed.
It looks like the program does not have permissions to write to
C:\Inetpub\wwwr oot\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
5911
by: varlagas | last post by:
We disabled the antivirus software but the problem persists. Any clues? Many thanks in advance! Panagiotis Varlagas ======================================================================= 2005-07-28-10.39.02.015001 Instance:DB2 Node:000 PID:1568(db2syscs.exe) TID:2440 Appid:0A00153A.C90B.050728083720
2
4909
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 linked to Safe mode being set to On since my site is using shared server hosting and probably insufficient/incorrect Unix file permission. Below is my test script that helps me narrow down the problem....
3
7965
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 C:\Inetpub\wwwroot\RunReportASP is the directory of my virtual directory for my app. In it's properties I did check "Write" as a permission. What else do I need to do?
15
2837
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. Everything is the default settings I believe. IIS is running under Local System. In IIS the DefaultAppPool is running under Network Service. Annonymous access uses the account IUSR_JASMINE (machine name is Jasmine).
0
1304
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 : C Const CurrUploadDir= ..... Const CurrSentDir= ..... Dim CurFile as string CurFile = Dir(CurrUploadDir & "*.*")
13
11154
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 writes a specific string to the log file. My original program (MKS Toolkit shell program) which keeps running "grep" checking the "exit string" on the "log files". There are no file sharing problem.
17
8029
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: I am trying to use the SaveFileDialog class to get a filename, which is subsequently opened for writing (write access, read sharing, but using read/write sharing doesn't make the problem go away anyway). Sometimes, on the statement where I...
16
3894
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 aspx page with the CreateUserWizard control. The user can fill his username, password etc .... My problem is: when an user fills everything and clicks on button "create an account", nothing happens (no error, but no user account created). I...
30
1981
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 the "editors" using PHP, cookies, etc. The question is what file permissions I need to allow for the content to be writable by my PHP script. Do I really need to give write permissions to the "other" group. Are all wikis really that vulnerable?...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10148
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.