469,904 Members | 1,921 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,904 developers. It's quick & easy.

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 1752
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Fran Tirimo | last post: by
23 posts views Thread by da Vinci | last post: by
2 posts views Thread by LazyAnt | last post: by
13 posts views Thread by Bob Darlington | last post: by
12 posts views Thread by MA | last post: by
15 posts views Thread by sunchunkui | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.