Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Overriding System Permissions

Reply
 
Old 09-02-2009   #1 (permalink)
ngrTerry


 
 

Overriding System Permissions

We have a ploicy where the executable resides in a folder which has
only got the permissions set for the user to have:
Read&Execute, ListFolderContents, Read.

We have an INI file and an xml file in the same folder to load
specific parameters such as default servername at startup. We need to
be able to modify these files from within the program.

However when we try to write to these files we get a permissions
error.

We need a means of being able to override these permissions from
within the application temporarily so that the new settings can be
stored.

Does anyone know how this can be achieved?

Thanks in advance.


My System SpecsSystem Spec
Old 09-02-2009   #2 (permalink)
Jeroen Mostert


 
 

Re: Overriding System Permissions

ngrTerry wrote:
Quote:

> We have a ploicy where the executable resides in a folder which has
> only got the permissions set for the user to have:
> Read&Execute, ListFolderContents, Read.
>
> We have an INI file and an xml file in the same folder to load
> specific parameters such as default servername at startup. We need to
> be able to modify these files from within the program.
>
> However when we try to write to these files we get a permissions
> error.
>
> We need a means of being able to override these permissions from
> within the application temporarily so that the new settings can be
> stored.
>
This can't be. If the application can override those permissions, so can the
user, because the application is always acting on behalf of the user. You
could make the application temporarily impersonate a user with more
permissions, but then, again, this means that the original user is able to
do this as well (although they may have to go to some trouble to find out
where the password is stored).

What you can do is reset the permissions on the files that need to be
modifiable so they no longer inherit their permissions from the folder, and
instead allow them to be modified by users. If all you need is a way to make
sure the settings aren't *accidentally* modified, you can simply set the
read-only attribute.

Alternatively and more securely, if the users should not be allowed to
overwrite all settings, you should split the settings into a part that may
not be modified on a per-user basis (storing this within the application
folder) and settings that may be modified on a per-user basis (storing these
within the user's application data folder). .NET uses a cascading mechanism
where multiple configurations are combined to form one. Consult the
documentation on configuration files for more information.

--
J.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
System Permissions (followup) .NET General
Programs - Replace System Program without Modifying System Files or Permissions Tutorials
Vista overriding my permissions General Discussion
Permissions for system files Vista file management
Overriding a password? Vista account administration


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46