Groups | Blog | Home
all groups > dotnet security > june 2006 >

dotnet security : Help : Access denied ???


serge calderara
6/22/2006 2:45:02 AM
Dear all,

I have a windows application that can be use by any user. In order to check
my applciation least priviledge i nee to be sure that my applciation runs
correctly with minimum rights.

One phase of my appliction is that it store some log information in a file
whatever the user logged in. For that I store the log file under
"Application.CommonAppDataPath", as it name explain, its Common. Common to
every use yes but not for writing unless you are an administrator.

Storing it under Application.LocalUserAppDataPath will generate one log file
for every new user. This is not what I want.

What is the best way tohandle that situation ?

regards
serge calderara
6/22/2006 4:48:02 AM
Lets replace the Log file by a database for instance.
That database contains the application configuraton setting based on loged
in user.
So each user is free to modify through a UI its application settings which
get store to that database. The database is then common and unique for the
whole application and every user.

Actually that database is installed with my application deployemen package
under Program File folder. Then a normal user to dot have write access under
sub folders.

If I need to share the database location to be read and write access for
every user do I have to define the user right during my application
deployement or do it manually ?

What is the best ?

regards
serge

[quoted text, click to view]
Dominick Baier [DevelopMentor]
6/22/2006 10:01:36 AM
users are isolated by default under windows - the only writable locations
for normal users is the profile - if you want a shared directory for all
users you must create that manually and ACL it accordingly.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

[quoted text, click to view]

Dominick Baier [DevelopMentor]
6/22/2006 10:02:42 AM
or you could use some standard logging mechanism, like EventLog

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

[quoted text, click to view]

Dominick Baier [DevelopMentor]
6/22/2006 4:09:04 PM
well - you can always set up a directory during deployment and ACL it appropriately
- the System.Security.AccessControl namespace provides everything to do that
programmatically.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

[quoted text, click to view]

AddThis Social Bookmark Button