Questions tagged [directory-security]

20 questions
79
votes
3 answers

Add "Everyone" privilege to folder using C#.NET

I have used the code below to allow Everyone access to a folder: System.Security.AccessControl.DirectorySecurity sec = System.IO.Directory.GetAccessControl(directory, AccessControlSections.All); FileSystemAccessRule accRule = new…
Suresh Chaudhary
  • 1,609
  • 5
  • 25
  • 40
12
votes
3 answers

How to create directory with all rights granted to everyone

I need to programmatically create a directory that grants "Full Control" to the group "Everyone". If I use CreateDirectory(path, NULL); This will, according to the Win32 SDK documentation, create a directory that inherits from its parent…
Jeff Stong
  • 1,506
  • 4
  • 14
  • 26
9
votes
2 answers

Directory Security

My app is creating a directory so that I can store log files in it. I'm adding user security to the directory, but I don't know how to make it propagate. For example, I'm adding the user everyone to the directory, with read and write access, but…
David
  • 1,435
  • 4
  • 13
  • 17
4
votes
2 answers

How we can add write access to a directory programmatically in C#?

I have an ASP.NET page that creates directories, and in another page I upload some files in these folders, but when I upload a file in a directory, the below error appears: Access to the path 'my path' is denied.
masoud ramezani
  • 22,228
  • 29
  • 98
  • 151
3
votes
1 answer

PHP create password protected folders

I would like to know if there is a way in PHP to create a password protected folder on the fly. I need to create a specific folder INSIDE a main folder and password protect the new folder with a password chosen by the user. Is there a way in PHP to…
DiegoP.
  • 45,177
  • 34
  • 89
  • 107
2
votes
2 answers

Using System.Security.AccessControl to remove an ACE from a folder ACL is very slow if the target folder size is very large

I need to remove certain accounts (like the "Everyone" trustee or some global group that is giving everyone access to a folder) from an ACL on a particular subfolder of a share. I get a DirectorySecurity object, get and loop through the…
achaetes
  • 93
  • 1
  • 8
2
votes
1 answer

C# File/Directory Permissions for local share

I need a file to be editable by all local users. The application saves common information to all users in its own folder under ProgramData. I need to guarantee reading and writing to all users, it is so little information that it does not merit the…
2
votes
1 answer

Windows File security, removing an access rule

I have the following code, that should remove the access of users from a certain folder. Unfortunately it doesn't (the access rule remains in place). No exception is thrown. AuthorizationRuleCollection arc = ds.GetAccessRules(true, true,…
C. Ross
  • 31,137
  • 42
  • 147
  • 238
2
votes
0 answers

RemoveAccessRule c# not removing username from security (folder properties)

I am new to Stack Overflow - So be nice :) Have a question, I have been learning c# on an off for about a year now on and off (first language), I have created a project that created folders and assigns permissions to a user based on their username…
user2270653
  • 207
  • 3
  • 16
1
vote
1 answer

How can I create a protected directory that I can guarantee has only been modified by a specific user?

I am developing a .NET Windows Service using C# that runs as the SYSTEM user so that it has permissions to install software updates etc. I want the service to download an executable file to a protected directory and launch it. However, I want to…
1
vote
1 answer

Get file's permissions for current user .net

I'm scanning the folder for files and I need to get each file's permissions for current user in any way to be represented as a string. So for the attached file's properties I would like to represent something like f-m-r-w string. I'm trying to…
Madcode
  • 81
  • 1
  • 7
1
vote
1 answer

DirectorySecurity C# assign permissions of local group from remote server

I'm using the following code to assign domain groups permissions to a folder from a C# application: DirectoryInfo myDirectoryInfo = new DirectoryInfo(@"\\Server002\G$\permissionTest"); DirectorySecurity myDirectorySecurity =…
Vito
  • 718
  • 4
  • 16
  • 37
1
vote
2 answers

CommonApplicationData is giving incorrect permissions

I have been all over google and back trying to figure this out. Let me tell you the problem and then tell/show you what I'm trying to do to fix said problem. So the problem is that I install the program I wrote to another computer with only 1…
Robert Snyder
  • 2,399
  • 4
  • 33
  • 65
0
votes
1 answer

C# DirectorySecurity SetOwner on subcontainers and objects

I am trying to change ownership of a windows folder and everything inside it. Basially I am trying to check the box that would be there if you did this manually in windows that says "Replace owner on subcontainers and objects". This will need to…
Sephira
  • 15
  • 3
0
votes
1 answer

IIS6, VBS & XMLHTTP: Execute Access Denied

I've got a VBS file that is pulling XML from our website. It going to run on our local server once it is finished. Te problem I'm having is that when I run the file on my workstation (Running IIS6 on XP SP3), I get the error: "Execute Access…
Dexter
  • 245
  • 2
  • 4
  • 17
1
2