Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to change the folder's permmision in NTFS?

Posted on 1999-07-09
3
Medium Priority
?
130 Views
Last Modified: 2013-11-20
I'd like to change the permmision of some folder in NTFS, How to do it?
0
Comment
Question by:wk123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 60 total points
ID: 1309451
Simply use 'SetFileSecurity()' specifying a valid SECURITY_DESCRIPTOR, e.g.

SECURITY_DESCRIPTOR         sd;
PSID psidWorldSid; // a SID representing "everyone"
SID_IDENTIFIER_AUTHORITY siaWorldSidAuthority = SECURITY_WORLD_SID_AUTHORITY;

psidWorldSid = (PSID) LocalAlloc(LPTR, GetSidLengthRequired(1));
InitializeSid(psidWorldSid, &siaWorldSidAuthority, 1);
*(GetSidSubAuthority(psidWorldSid, 0)) = SECURITY_WORLD_RID;

if  (   !InitializeSecurityDescriptor   (   &sd,    SECURITY_DESCRIPTOR_REVISION)
    )
    {
        //  error
    }

// here I set the _group_ to 'world', but you could also use
// 'owner'...
if  (   !SetSecurityDescriptorGroup (   &sd,    psidWorldSid,   TRUE)
    )
    {
        //  error
    }

SetFileSecurity ( "C:\\temp",  GROUP_SECURITY_INFORMATION, &sd);



0
 

Expert Comment

by:wk124
ID: 1309452
if "SID_IDENTIFIER_AUTHORITY siaWorldSidAuthority = SECURITY_CREATOR_SID_AUTHORITY"
how to write "*(GetSidSubAuthority(psidWorldSid, 0)) = ???"

0
 
LVL 86

Expert Comment

by:jkr
ID: 1309453
Its the same a writing

PDWORD pdw = GetSidSubAuthority(psidWorldSid, 0);

*pdw = SECURITY_WORLD_RID;
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question