This should be the correct fix for the lack of a prototype for
[ira/wip.git] / source3 / utils / smbcacls.c
index 9d8a6577263379200e76edcbc3b5f29783e36b09..5a70d1688421c72402129b3f616f2fb0eff3c28d 100644 (file)
@@ -30,7 +30,6 @@ static int test_args = False;
 static TALLOC_CTX *ctx;
 
 #define CREATE_ACCESS_READ READ_CONTROL_ACCESS
-#define CREATE_ACCESS_WRITE (WRITE_DAC_ACCESS | WRITE_OWNER_ACCESS)
 
 /* numeric is set when the user wants numeric SIDs and ACEs rather
    than going via LSA calls to resolve them */
@@ -390,7 +389,7 @@ static SEC_DESC *sec_desc_parse(char *str)
                return NULL;
        }
 
-       ret = make_sec_desc(ctx,revision, owner_sid, grp_sid, 
+       ret = make_sec_desc(ctx,revision, SEC_DESC_SELF_RELATIVE, owner_sid, grp_sid, 
                            NULL, dacl, &sd_size);
 
        SAFE_FREE(grp_sid);
@@ -505,12 +504,12 @@ static int owner_set(struct cli_state *cli, enum chown_mode change_mode,
                return EXIT_FAILED;
        }
 
-       sd = make_sec_desc(ctx,old->revision,
-                               (change_mode == REQUEST_CHOWN) ? &sid : old->owner_sid,
-                               (change_mode == REQUEST_CHGRP) ? &sid : old->grp_sid,
-                          NULL, old->dacl, &sd_size);
+       sd = make_sec_desc(ctx,old->revision, old->type,
+                               (change_mode == REQUEST_CHOWN) ? &sid : NULL,
+                               (change_mode == REQUEST_CHGRP) ? &sid : NULL,
+                          NULL, NULL, &sd_size);
 
-       fnum = cli_nt_create(cli, filename, CREATE_ACCESS_WRITE);
+       fnum = cli_nt_create(cli, filename, WRITE_OWNER_ACCESS);
 
        if (fnum == -1) {
                printf("Failed to open %s: %s\n", filename, cli_errstr(cli));
@@ -680,10 +679,10 @@ static int cacl_set(struct cli_state *cli, char *filename,
        sort_acl(old->dacl);
 
        /* Create new security descriptor and set it */
-       sd = make_sec_desc(ctx,old->revision, old->owner_sid, old->grp_sid, 
+       sd = make_sec_desc(ctx,old->revision, old->type, NULL, NULL,
                           NULL, old->dacl, &sd_size);
 
-       fnum = cli_nt_create(cli, filename, CREATE_ACCESS_WRITE);
+       fnum = cli_nt_create(cli, filename, WRITE_DAC_ACCESS);
 
        if (fnum == -1) {
                printf("cacl_set failed to open %s: %s\n", filename, cli_errstr(cli));
@@ -725,7 +724,8 @@ static struct cli_state *connect_one(const char *share)
                                                            &ip, 0,
                                                            share, "?????",  
                                                            cmdline_auth_info.username, lp_workgroup(),
-                                                           cmdline_auth_info.password, 0, NULL))) {
+                                                           cmdline_auth_info.password, 0,
+                                                           cmdline_auth_info.signing_state, NULL))) {
                return c;
        } else {
                DEBUG(0,("cli_full_connection failed! (%s)\n", nt_errstr(nt_status)));
@@ -751,7 +751,7 @@ static struct cli_state *connect_one(const char *share)
                POPT_AUTOHELP
                { "delete", 'D', POPT_ARG_STRING, NULL, 'D', "Delete an acl", "ACL" },
                { "modify", 'M', POPT_ARG_STRING, NULL, 'M', "Modify an acl", "ACL" },
-               { "add", 'A', POPT_ARG_STRING, NULL, 'A', "Add an acl", "ACL" },
+               { "add", 'a', POPT_ARG_STRING, NULL, 'a', "Add an acl", "ACL" },
                { "set", 'S', POPT_ARG_STRING, NULL, 'S', "Set acls", "ACLS" },
                { "chown", 'C', POPT_ARG_STRING, NULL, 'C', "Change ownership of a file", "USERNAME" },
                { "chgrp", 'G', POPT_ARG_STRING, NULL, 'G', "Change group ownership of a file", "GROUPNAME" },
@@ -796,7 +796,7 @@ static struct cli_state *connect_one(const char *share)
                        mode = SMB_ACL_MODIFY;
                        break;
 
-               case 'A':
+               case 'a':
                        the_acl = smb_xstrdup(poptGetOptArg(pc));
                        mode = SMB_ACL_ADD;
                        break;