summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-02-28 00:51:02 +0000
committerJeremy Allison <jra@samba.org>2001-02-28 00:51:02 +0000
commit0f2799aaf1e33aa474a12b9389728d57af926cb3 (patch)
treee2cf9efcc996a3b8f08184e204e8af0810e7b8c9 /source3/smbd
parent545649a05f4d634bb93471bd946a92b1c5644684 (diff)
downloadsamba-0f2799aaf1e33aa474a12b9389728d57af926cb3.tar.gz
samba-0f2799aaf1e33aa474a12b9389728d57af926cb3.tar.bz2
samba-0f2799aaf1e33aa474a12b9389728d57af926cb3.zip
Move to talloc control of SPOOL_XXX structs. Move to talloc control of
security descriptors and pointers. Syncup with 2.2 tree. Jeremy. (This used to be commit 14d5997dc841e78a619e865288486d50c245896d)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/nttrans.c9
-rw-r--r--source3/smbd/posix_acls.c13
2 files changed, 6 insertions, 16 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index cf2bdef314..c326dd561f 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -1099,7 +1099,6 @@ static BOOL set_sd(files_struct *fsp, char *data, uint32 sd_len, uint security_i
*/
if(!sec_io_desc( "sd data", &psd, &pd, 1)) {
- free_sec_desc(&psd);
DEBUG(0,("set_sd: Error in unmarshalling security descriptor.\n"));
/*
* Return access denied for want of a better error message..
@@ -1122,14 +1121,12 @@ static BOOL set_sd(files_struct *fsp, char *data, uint32 sd_len, uint security_i
ret = set_nt_acl( fsp, security_info_sent, psd);
if (!ret) {
- free_sec_desc(&psd);
talloc_destroy(mem_ctx);
*pdef_class = ERRDOS;
*pdef_code = ERRnoaccess;
return False;
}
- free_sec_desc(&psd);
talloc_destroy(mem_ctx);
*pdef_class = 0;
@@ -1638,8 +1635,6 @@ static int call_nt_transact_query_security_desc(connection_struct *conn,
if(max_data_count < sd_size) {
- free_sec_desc(&psd);
-
send_nt_replies(inbuf, outbuf, bufsize, NT_STATUS_BUFFER_TOO_SMALL,
params, 4, *ppdata, 0);
return -1;
@@ -1651,7 +1646,6 @@ static int call_nt_transact_query_security_desc(connection_struct *conn,
data = Realloc(*ppdata, sd_size);
if(data == NULL) {
- free_sec_desc(&psd);
return(ERROR(ERRDOS,ERRnomem));
}
@@ -1665,7 +1659,6 @@ static int call_nt_transact_query_security_desc(connection_struct *conn,
if ((mem_ctx = talloc_init()) == NULL) {
DEBUG(0,("call_nt_transact_query_security_desc: talloc_init failed.\n"));
- free_sec_desc(&psd);
return(ERROR(ERRDOS,ERRnomem));
}
@@ -1683,7 +1676,6 @@ static int call_nt_transact_query_security_desc(connection_struct *conn,
*/
if(!sec_io_desc( "sd data", &psd, &pd, 1)) {
- free_sec_desc(&psd);
DEBUG(0,("call_nt_transact_query_security_desc: Error in marshalling \
security descriptor.\n"));
/*
@@ -1697,7 +1689,6 @@ security descriptor.\n"));
* Now we can delete the security descriptor.
*/
- free_sec_desc(&psd);
talloc_destroy(mem_ctx);
send_nt_replies(inbuf, outbuf, bufsize, 0, params, 4, data, (int)sd_size);
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index da457604bb..9c5afad9c1 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -41,6 +41,7 @@ typedef struct canon_ace {
static void free_canon_ace_list( canon_ace *list_head );
+#if !defined(HAVE_NO_ACLS)
/****************************************************************************
Function to duplicate a canon_ace entry.
****************************************************************************/
@@ -56,6 +57,7 @@ static canon_ace *dup_canon_ace( canon_ace *src_ace)
dst_ace->prev = dst_ace->next = NULL;
return dst_ace;
}
+#endif /* HAVE_NO_ACLS */
/****************************************************************************
Function to create owner and group SIDs from a SMB_STRUCT_STAT.
@@ -243,6 +245,7 @@ static BOOL unpack_nt_owners(SMB_STRUCT_STAT *psbuf, uid_t *puser, gid_t *pgrp,
return True;
}
+#if !defined(HAVE_NO_ACLS)
/****************************************************************************
Merge aces with a common user.
****************************************************************************/
@@ -378,6 +381,7 @@ static BOOL ensure_canon_entry_valid(canon_ace **pp_ace,
return True;
}
+#endif /* HAVE_NO_ACLS */
/****************************************************************************
Unpack a SEC_DESC into two canonical ace lists. We don't depend on this
@@ -577,7 +581,6 @@ static BOOL unpack_canon_ace(files_struct *fsp,
*/
DEBUG(10,("unpack_canon_ace: Win2k inherit acl traverse. Ignoring DACL.\n"));
- free_sec_acl(&psd->dacl);
}
/*
@@ -788,7 +791,6 @@ static BOOL unpack_posix_permissions(files_struct *fsp, SMB_STRUCT_STAT *psbuf,
*/
DEBUG(10,("unpack_posix_permissions: Win2k inherit acl traverse. Ignoring DACL.\n"));
- free_sec_acl(&psd->dacl);
}
/*
@@ -1403,13 +1405,13 @@ size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc)
}
if (num_acls) {
- if((psa = make_sec_acl( ACL_REVISION, num_aces, nt_ace_list)) == NULL) {
+ if((psa = make_sec_acl( main_loop_talloc_get(), ACL_REVISION, num_aces, nt_ace_list)) == NULL) {
DEBUG(0,("get_nt_acl: Unable to malloc space for acl.\n"));
goto done;
}
}
- *ppdesc = make_standard_sec_desc( &owner_sid, &group_sid, psa, &sd_size);
+ *ppdesc = make_standard_sec_desc( main_loop_talloc_get(), &owner_sid, &group_sid, psa, &sd_size);
if(!*ppdesc) {
DEBUG(0,("get_nt_acl: Unable to malloc space for security descriptor.\n"));
@@ -1426,8 +1428,6 @@ size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc)
free_canon_ace_list(dir_ace);
if (nt_ace_list)
free(nt_ace_list);
- if (psa)
- free_sec_acl(&psa);
return sd_size;
}
@@ -1700,5 +1700,4 @@ int fchmod_acl(int fd, mode_t mode)
sys_acl_free_acl(posix_acl);
return ret;
}
-
#undef OLD_NTDOMAIN