[Patch] add --as-sddl option to getntacl and create setntacl

Matthieu Patou mat+Informatique.Samba at matws.net
Sun Oct 25 15:33:42 MDT 2009


Hello,

Find attach 2 patchs, the first one for creating the setntacl tool and 
for improving command line parsing in getntacl.
The second one is an improvement of the provision to put all the GPO 
stuff together (and out of setup_samdb). It also include calls to 
setntacl for  setting ACL on files as they are in the AD so that GPMC 
will be more happy.

Matthieu.
On 10/24/2009 03:41 PM, Matthieu Patou wrote:
> Hello Andrew,
>
> This is a take two on this patch as now I made it so it use getopt for
> getntacl and setntacl.
>
> I will issue a patch shortly for provision in order to get ACL on sysvol
> right so that GPO really works correctly and GPMC stop yelling !
>
> Matthieu.
> On 09/24/2009 09:07 PM, Andrew Bartlett wrote:
>> On Wed, 2009-09-23 at 13:21 +0400, Matthieu Patou wrote:
>>> - if (argc != 2) {
>>> - fprintf(stderr, "Usage: getntacl FILENAME\n");
>>> + if (argc< 2 || argc>3) {
>>> + fprintf(stderr, "Usage: getntacl [--as-sddl] FILENAME
>>> \n");
>>> return 1;
>>> }
>>> -
>>> - status = get_ntacl(NULL, argv[1],&ntacl,&ntacl_len);
>>> + if (strncmp(argv[1],AS_SDDL_TEXT,strlen(AS_SDDL_TEXT) )== 0) {
>>> + status = get_ntacl(NULL, argv[2],&ntacl,&ntacl_len);
>>> + print_as_sddl = 1;
>>> + } else {
>>> + status = get_ntacl(NULL, argv[1],&ntacl,&ntacl_len);
>>> + }
>>
>> The main issue with this patch is that it adds -- options but does not
>> use POPT. It really needs to rework the getntacl utility to use the
>> common popt handler (as a separate prerequisite patch)
>>
>> Andrew Bartlett
>>
>



More information about the samba-technical mailing list