473,387 Members | 1,416 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,387 software developers and data experts.

Granting file delete permission to another user

I have a Windows Service that is running as an administrator account. Some
of it methods create files for a COM+ client to digest and puts them in
C:\Documents and Settings\All Users\Application Data\... The file is
created with a StreamWriter.

When the COM+ client (running as a non-admin user) is finished with the
file, it tries to clean it up but gets a Permission denied error.

How can the service programmatically grant delete privileges so the
non-admin user (COM+ clients) can delete the file?

Thanks,
Tim
Nov 22 '05 #1
3 1865
Tim,

I think you have to use Win32 API to do this. Please take a look at the
method SetFileSecurity in Win32 API.
In general files are not a very reliable way of passing data between
components. Do you have an option to exclude files from the components
communication?

--
Victor Urnyshev [MSFT]
This post is "AS IS" with no warranties, and confers no rights.
--------------------
|Reply-To: "Tim Werth" <tw****@onlineziimaging.com>
|From: "Tim Werth" <tw****@onlineziimaging.com>
|Subject: Granting file delete permission to another user
|Date: Wed, 14 Jul 2004 17:34:39 -0500
|Lines: 15
|X-Priority: 3
|X-MSMail-Priority: Normal
|X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
|X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
|Message-ID: <OQ**************@TK2MSFTNGP11.phx.gbl>
|Newsgroups: microsoft.public.dotnet.general
|NNTP-Posting-Host: ckpnt02.intergraph.com 63.75.137.129
|Path:
cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTF EED01.phx.gbl!TK2MSFTNGP08
.phx.gbl!TK2MSFTNGP11.phx.gbl
|Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:139577
|X-Tomcat-NG: microsoft.public.dotnet.general
|
|I have a Windows Service that is running as an administrator account. Some
|of it methods create files for a COM+ client to digest and puts them in
|C:\Documents and Settings\All Users\Application Data\... The file is
|created with a StreamWriter.
|
|When the COM+ client (running as a non-admin user) is finished with the
|file, it tries to clean it up but gets a Permission denied error.
|
|How can the service programmatically grant delete privileges so the
|non-admin user (COM+ clients) can delete the file?
|
|Thanks,
|Tim
|
|
|

Nov 22 '05 #2
Tim Werth wrote:
I have a Windows Service that is running as an administrator account.
Some of it methods create files for a COM+ client to digest and puts them
in
C:\Documents and Settings\All Users\Application Data\... The file is
created with a StreamWriter.

When the COM+ client (running as a non-admin user) is finished with the
file, it tries to clean it up but gets a Permission denied error.

How can the service programmatically grant delete privileges so the
non-admin user (COM+ clients) can delete the file?

Thanks,
Tim


Did you check security settings in the assembly cache ?
Nov 22 '05 #3
Victor,

Thanks for the suggestion. I ended up solving it by calling
AddAccessAllowedAceEx. I found this solution in a post by Willy Denoyette
(Subj: Re: dotNEt File Permissions LONG).

But to answer you question, no, unfortunately at this point I don't have
another option for the component's communication than using files.

Tim

"Victor Urnyshev [MSFT]" <vi*****@online.microsoft.com> wrote in message
news:La**************@cpmsftngxa06.phx.gbl...
Tim,

I think you have to use Win32 API to do this. Please take a look at the
method SetFileSecurity in Win32 API.
In general files are not a very reliable way of passing data between
components. Do you have an option to exclude files from the components
communication?

--
Victor Urnyshev [MSFT]
This post is "AS IS" with no warranties, and confers no rights.

Nov 22 '05 #4

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

Similar topics

5
by: Phil Powell | last post by:
print_r(is_file("$logPath/$logFileName")); // RETURNS 1 unlink("$logPath/$logFileName"); // RETURNS WARNING: PERMISSION DENIED This code should tell me that the file located at...
0
by: Fran Tirimo | last post by:
I am developing a small website using ASP scripts to format data retrieved from an Access database. It will run on a Windows 2003 server supporting FrontPage extensions 2002 hosted by the company...
2
by: Fran Tirimo | last post by:
I am developing a small website using ASP scripts to format data retrieved from an Access database. It will run on a Windows 2003 server supporting FrontPage extensions 2002 hosted by the company...
2
by: Ted | last post by:
How do I grant all privileges for a schema that has a large number of existing tables, procedures, functions, etc to a newly created role, without having to issue a grant statement for each object...
3
by: Tim Werth | last post by:
I have a Windows Service that is running as an administrator account. Some of it methods create files for a COM+ client to digest and puts them in C:\Documents and Settings\All Users\Application...
23
by: da Vinci | last post by:
Greetings, Onwards with the school studying. Working on a program and need to delete a file from a known location on the hard drive but cannot get anything I do to work. I have tried to use...
2
by: LazyAnt | last post by:
Hello, I have DB2 v8.1 for Linux for a class environment; each user has his/her own database as dbadm and they are suppose to study queries from another database. They have the right...
13
by: Bob Darlington | last post by:
I have a repair and backup database routine which runs when a user closes down my application. It works fine in my development machine, but breaks on a client's at the following line: If...
12
by: MA | last post by:
Hi all! I created a webservice that check folder for incoming and outgoing files. If a file exists in my inbox (incoming file) I read it and want to delete it. It looks like this: ...
15
by: sunchunkui | last post by:
Dear all, I have an Access mdb file which I updated every other week on a server. There are multiple users to access it. Usually when if somebody is using it, I can see .ldb file under that...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.