473,486 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Change directory permission under windows

Hi.

I would like to add users with full control access to a directory. I
can do it to a file in the following way:

info=win32security.DACL_SECURITY_INFORMATION
sd=win32security.GetFileSecurity(DIR, info)
acl=sd.GetSecurityDescriptorDacl()
sidUser=win32security.LookupAccountName(None,USER)[0]
acl.AddAccessAllowedAce(win32file.FILE_ALL_ACCESS, sidUser)
sd.SetSecurityDescriptorDacl(1, acl, 0)
win32security.SetFileSecurity(dir, info, sd)

and it work correctly, but if I try to do the same to a directory only
the "special permission" checkbox is checked and this is not useful to
me because I need a "full control" so that files under the directory
can inheritage the directory rigths.

Can anybody help me

Thank's

Nov 8 '06 #1
1 5467

__schronos__ wrote:
Hi.

I would like to add users with full control access to a directory. I
can do it to a file in the following way:

info=win32security.DACL_SECURITY_INFORMATION
sd=win32security.GetFileSecurity(DIR, info)
acl=sd.GetSecurityDescriptorDacl()
sidUser=win32security.LookupAccountName(None,USER)[0]
acl.AddAccessAllowedAce(win32file.FILE_ALL_ACCESS, sidUser)
sd.SetSecurityDescriptorDacl(1, acl, 0)
win32security.SetFileSecurity(dir, info, sd)

and it work correctly, but if I try to do the same to a directory only
the "special permission" checkbox is checked and this is not useful to
me because I need a "full control" so that files under the directory
can inheritage the directory rigths.

Can anybody help me

Thank's
AddAccessAllowedAce doesn't have a parm for inheritance flags.
Try AddAccessAllowedAceEx instead:

acl.AddAccessAllowedAceEx(win32security.ACL_REVISI ON_DS,
win32security.OBJECT_INHERIT_ACE|win32security.CON TAINER_INHERIT_ACE,
win32file.FILE_ALL_ACCESS, sidUser)

Roger

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
3576
by: See Sharp | last post by:
Hello all, I have a set of admin pages which are put in a subfolder called admin inside my application folder. I want to limit access to these admin pages. How can I do this? In Linux, I can...
0
2075
by: Jeff Reed | last post by:
I am experiencing the the problem outlined the below. Unfortunately, I am using WinXP and I not sure if I can apply the solution due to lack of security control Any feed back would be apreciated ...
7
2379
by: Jaydeep | last post by:
Hi, Anybody knows how to create virtual directory programmatically under root directory ofcourse from code-behind. I am developing web-based application where I need to create a folder and making...
0
1209
by: Jeremy | last post by:
I have an ASP.net application which needs to retreive images from multiple remote machines. It is reterieveing images generated by a web cam service on those machines. All of these machines,...
6
2446
by: varkey.mathew | last post by:
Dear all, Bear with me, a poor newbie(atleast in AD).. I have to authenticate a user ID and password for a user as a valid Active Directory user or not. I have created the IsAuthenticated...
3
11265
by: Lucky | last post by:
Hi guys, after long long time. i'm back again with another problem. this time i think the problem is very very interesting and i really need you help on this. i'm trying to connect to the...
0
1183
by: landesjoe | last post by:
Hi, Here's the problem: We have an app that we open by default for the user logged into the Windows box on a Windows Domain (using active directory). Let's say that's "Hans". That works great,...
0
351
by: __schronos__ | last post by:
Hi. I would like to add people with full control access to a directory. I can do it to a file in the following way: info=win32security.DACL_SECURITY_INFORMATION...
0
4354
by: oritc123 | last post by:
Hello . I am having the following error when I run my application under Windows Vista ( it runs fine under Windows XP ) : "Access to the temp directory is denied. Identity 'ORITSLAPTOP\orit'...
0
6831
by: phil469 | last post by:
I'm having an issue when trying to read a file in a user's homedir from a cgi script. I have a virtual host section in my httpd.conf file which I'll include. The cgi script is a very basic script...
0
7094
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6839
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.