Changing folder Attributs/Security

  • Thread starter Thread starter Feldman Alex
  • Start date Start date
F

Feldman Alex

Hi everyone!

I need to write a simple application that will change folder attributes for
a user that doesn't have administrative privileges.
(Example : I'll login as administrator, run an application and will give a
permission to all users to write to program files)
Is anyone know which classes/namespaces to change a folder/file permissions
should I use?

Thanks a lot
Alex
 
Feldman Alex said:
I need to write a simple application that will change folder attributes for
a user that doesn't have administrative privileges.
(Example : I'll login as administrator, run an application and will give a
permission to all users to write to program files)
Is anyone know which classes/namespaces to change a folder/file permissions
should I use?

This can be done in the new beta version of the .NET Framework. This page
explains how:

http://pluralsight.com/wiki/default.aspx/Keith.GuideBook/HowToProgramACLs.html

However, I would heed its warning about thinking about whether it's the
right thing to do. Giving all users write access to Program Files, in
particular, makes your system completely insecure - anyone who can access
your system at that time can replace any application binary, change any
application configuration, or execute a variety of other malicious actions.
If you just want the users to be able to install things, create a group
which has access to Program Files and temporarily move users in and out of
this group. Even better, have them identify the directory they wish to
install to beforehand, and create and give them temporary write access to
only this subdirectory. I hope this helps.
 
Back
Top