mirror of
https://github.com/samba-team/samba.git
synced 2025-02-22 05:57:43 +03:00
Some C++ fixes
(This used to be commit 5c392c4c6e277a24d0d477902dc7856b2b46ee53)
This commit is contained in:
parent
addf598cde
commit
99b86e4a26
@ -54,7 +54,8 @@ void sec_ace_copy(SEC_ACE *ace_dest, SEC_ACE *ace_src)
|
||||
Sets up a SEC_ACE structure.
|
||||
********************************************************************/
|
||||
|
||||
void init_sec_ace(SEC_ACE *t, const DOM_SID *sid, uint8 type, uint32 mask, uint8 flag)
|
||||
void init_sec_ace(SEC_ACE *t, const DOM_SID *sid, enum security_ace_type type,
|
||||
uint32 mask, uint8 flag)
|
||||
{
|
||||
t->type = type;
|
||||
t->flags = flag;
|
||||
@ -83,7 +84,7 @@ NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, SEC_ACE **pp_new, SEC_ACE *old, unsign
|
||||
for (i = 0; i < *num - 1; i ++)
|
||||
sec_ace_copy(&(*pp_new)[i], &old[i]);
|
||||
|
||||
(*pp_new)[i].type = 0;
|
||||
(*pp_new)[i].type = SEC_ACE_TYPE_ACCESS_ALLOWED;
|
||||
(*pp_new)[i].flags = 0;
|
||||
(*pp_new)[i].size = SEC_ACE_HEADER_SIZE + sid_size(sid);
|
||||
(*pp_new)[i].access_mask = mask;
|
||||
|
@ -26,7 +26,8 @@
|
||||
Create a SEC_ACL structure.
|
||||
********************************************************************/
|
||||
|
||||
SEC_ACL *make_sec_acl(TALLOC_CTX *ctx, uint16 revision, int num_aces, SEC_ACE *ace_list)
|
||||
SEC_ACL *make_sec_acl(TALLOC_CTX *ctx, enum security_acl_revision revision,
|
||||
int num_aces, SEC_ACE *ace_list)
|
||||
{
|
||||
SEC_ACL *dst;
|
||||
int i;
|
||||
|
@ -182,7 +182,9 @@ SEC_DESC_BUF *sec_desc_merge(TALLOC_CTX *ctx, SEC_DESC_BUF *new_sdb, SEC_DESC_BU
|
||||
Creates a SEC_DESC structure
|
||||
********************************************************************/
|
||||
|
||||
SEC_DESC *make_sec_desc(TALLOC_CTX *ctx, uint16 revision, uint16 type,
|
||||
SEC_DESC *make_sec_desc(TALLOC_CTX *ctx,
|
||||
enum security_descriptor_revision revision,
|
||||
uint16 type,
|
||||
const DOM_SID *owner_sid, const DOM_SID *grp_sid,
|
||||
SEC_ACL *sacl, SEC_ACL *dacl, size_t *sd_size)
|
||||
{
|
||||
@ -329,8 +331,9 @@ NTSTATUS unmarshall_sec_desc(TALLOC_CTX *mem_ctx, uint8 *data, size_t len,
|
||||
SEC_DESC *make_standard_sec_desc(TALLOC_CTX *ctx, const DOM_SID *owner_sid, const DOM_SID *grp_sid,
|
||||
SEC_ACL *dacl, size_t *sd_size)
|
||||
{
|
||||
return make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE,
|
||||
owner_sid, grp_sid, NULL, dacl, sd_size);
|
||||
return make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1,
|
||||
SEC_DESC_SELF_RELATIVE, owner_sid, grp_sid, NULL,
|
||||
dacl, sd_size);
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
@ -557,7 +560,8 @@ SEC_DESC_BUF *se_create_child_secdesc(TALLOC_CTX *ctx, SEC_DESC *parent_ctr,
|
||||
correct. Perhaps the user and group should be passed in as
|
||||
parameters by the caller? */
|
||||
|
||||
sd = make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE,
|
||||
sd = make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1,
|
||||
SEC_DESC_SELF_RELATIVE,
|
||||
parent_ctr->owner_sid,
|
||||
parent_ctr->group_sid,
|
||||
parent_ctr->sacl,
|
||||
|
@ -92,7 +92,9 @@ SEC_DESC *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32 def
|
||||
init_sec_ace(&ace, &global_sid_World, SEC_ACE_TYPE_ACCESS_ALLOWED, sa, 0);
|
||||
|
||||
if ((psa = make_sec_acl(ctx, NT4_ACL_REVISION, 1, &ace)) != NULL) {
|
||||
psd = make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL, psa, psize);
|
||||
psd = make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1,
|
||||
SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL,
|
||||
psa, psize);
|
||||
}
|
||||
|
||||
if (!psd) {
|
||||
@ -291,7 +293,7 @@ bool parse_usershare_acl(TALLOC_CTX *ctx, const char *acl_str, SEC_DESC **ppsd)
|
||||
uint32 s_access;
|
||||
DOM_SID sid;
|
||||
char *sidstr;
|
||||
uint8 type = SEC_ACE_TYPE_ACCESS_ALLOWED;
|
||||
enum security_ace_type type = SEC_ACE_TYPE_ACCESS_ALLOWED;
|
||||
|
||||
if (!next_token_talloc(ctx, &pacl, &sidstr, ":")) {
|
||||
DEBUG(0,("parse_usershare_acl: malformed usershare acl looking "
|
||||
@ -339,7 +341,9 @@ bool parse_usershare_acl(TALLOC_CTX *ctx, const char *acl_str, SEC_DESC **ppsd)
|
||||
}
|
||||
|
||||
if ((psa = make_sec_acl(ctx, NT4_ACL_REVISION, num_aces, ace_list)) != NULL) {
|
||||
psd = make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL, psa, &sd_size);
|
||||
psd = make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1,
|
||||
SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL,
|
||||
psa, &sd_size);
|
||||
}
|
||||
|
||||
if (!psd) {
|
||||
|
@ -350,7 +350,9 @@ NTSTATUS samr_make_sam_obj_sd(TALLOC_CTX *ctx, SEC_DESC **psd, size_t *sd_size)
|
||||
if ((psa = make_sec_acl(ctx, NT4_ACL_REVISION, 3, ace)) == NULL)
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
||||
if ((*psd = make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL, psa, sd_size)) == NULL)
|
||||
if ((*psd = make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1,
|
||||
SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL,
|
||||
psa, sd_size)) == NULL)
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
|
@ -463,7 +463,9 @@ static NTSTATUS lsa_get_generic_sd(TALLOC_CTX *mem_ctx, SEC_DESC **sd, size_t *s
|
||||
if((psa = make_sec_acl(mem_ctx, NT4_ACL_REVISION, 3, ace)) == NULL)
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
||||
if((*sd = make_sec_desc(mem_ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE, &adm_sid, NULL, NULL, psa, sd_size)) == NULL)
|
||||
if((*sd = make_sec_desc(mem_ctx, SECURITY_DESCRIPTOR_REVISION_1,
|
||||
SEC_DESC_SELF_RELATIVE, &adm_sid, NULL, NULL,
|
||||
psa, sd_size)) == NULL)
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
|
@ -149,7 +149,9 @@ static NTSTATUS make_samr_object_sd( TALLOC_CTX *ctx, SEC_DESC **psd, size_t *sd
|
||||
if ((psa = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace)) == NULL)
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
||||
if ((*psd = make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL, psa, sd_size)) == NULL)
|
||||
if ((*psd = make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1,
|
||||
SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL,
|
||||
psa, sd_size)) == NULL)
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
|
@ -162,7 +162,9 @@ static SEC_DESC* construct_scm_sd( TALLOC_CTX *ctx )
|
||||
if ( !(acl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace)) )
|
||||
return NULL;
|
||||
|
||||
if ( !(sd = make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL, acl, &sd_size)) )
|
||||
if ( !(sd = make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1,
|
||||
SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL,
|
||||
acl, &sd_size)) )
|
||||
return NULL;
|
||||
|
||||
return sd;
|
||||
|
@ -934,7 +934,9 @@ static WERROR make_default_reg_sd( TALLOC_CTX *ctx, SEC_DESC **psd )
|
||||
if ((psa = make_sec_acl(ctx, NT4_ACL_REVISION, 2, ace)) == NULL)
|
||||
return WERR_NOMEM;
|
||||
|
||||
if ((*psd = make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE, &owner_sid, NULL, NULL, psa, &sd_size)) == NULL)
|
||||
if ((*psd = make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1,
|
||||
SEC_DESC_SELF_RELATIVE, &owner_sid, NULL,
|
||||
NULL, psa, &sd_size)) == NULL)
|
||||
return WERR_NOMEM;
|
||||
|
||||
return WERR_OK;
|
||||
|
@ -112,7 +112,9 @@ static SEC_DESC* construct_service_sd( TALLOC_CTX *ctx )
|
||||
if ( !(acl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace)) )
|
||||
return NULL;
|
||||
|
||||
if ( !(sd = make_sec_desc(ctx, SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL, acl, &sd_size)) )
|
||||
if ( !(sd = make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1,
|
||||
SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL,
|
||||
acl, &sd_size)) )
|
||||
return NULL;
|
||||
|
||||
return sd;
|
||||
|
@ -891,7 +891,7 @@ static bool nt4_compatible_acls(void)
|
||||
****************************************************************************/
|
||||
|
||||
static SEC_ACCESS map_canon_ace_perms(int snum,
|
||||
int *pacl_type,
|
||||
enum security_ace_type *pacl_type,
|
||||
mode_t perms,
|
||||
bool directory_ace)
|
||||
{
|
||||
@ -2869,7 +2869,7 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn,
|
||||
|
||||
{
|
||||
canon_ace *ace;
|
||||
int nt_acl_type;
|
||||
enum security_ace_type nt_acl_type;
|
||||
int i;
|
||||
|
||||
if (nt4_compatible_acls() && dir_ace) {
|
||||
@ -3210,7 +3210,7 @@ static NTSTATUS append_ugw_ace(files_struct *fsp,
|
||||
{
|
||||
mode_t perms;
|
||||
SEC_ACCESS acc;
|
||||
int nt_acl_type;
|
||||
enum security_ace_type nt_acl_type;
|
||||
DOM_SID trustee;
|
||||
|
||||
switch (ugw) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user