summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-13 20:51:41 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-15 11:44:50 +1000
commit6ccfd05e72bc010ccb291a169922cedd6a5ab702 (patch)
treeed1b93f65e1a9ce87dc6b203b0924cfe122a16d3
parente25830dcd87387a237b96f0d70deb204a5bf0a54 (diff)
downloadsamba-6ccfd05e72bc010ccb291a169922cedd6a5ab702.tar.gz
samba-6ccfd05e72bc010ccb291a169922cedd6a5ab702.tar.bz2
samba-6ccfd05e72bc010ccb291a169922cedd6a5ab702.zip
s3-sysacls: Remove sys_acl_free_acl() and replace with TALLOC_FREE()
-rw-r--r--source3/include/smb_acls.h1
-rw-r--r--source3/lib/sysacls.c6
-rw-r--r--source3/smbd/posix_acls.c32
-rw-r--r--source3/smbd/pysmbd.c34
-rw-r--r--source3/smbd/trans2.c16
5 files changed, 41 insertions, 48 deletions
diff --git a/source3/include/smb_acls.h b/source3/include/smb_acls.h
index 2a47661ede..d4830bcaa9 100644
--- a/source3/include/smb_acls.h
+++ b/source3/include/smb_acls.h
@@ -50,7 +50,6 @@ int sys_acl_set_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T tag_type);
int sys_acl_set_qualifier(SMB_ACL_ENTRY_T entry_d, void *qual_p);
int sys_acl_set_permset(SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T permset_d);
int sys_acl_free_text(char *text);
-int sys_acl_free_acl(SMB_ACL_T acl_d) ;
int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype);
int sys_acl_valid(SMB_ACL_T acl_d);
SMB_ACL_T sys_acl_get_file(struct vfs_handle_struct *handle,
diff --git a/source3/lib/sysacls.c b/source3/lib/sysacls.c
index 7e387e444b..3f4aeaed99 100644
--- a/source3/lib/sysacls.c
+++ b/source3/lib/sysacls.c
@@ -354,12 +354,6 @@ int sys_acl_free_text(char *text)
return 0;
}
-int sys_acl_free_acl(SMB_ACL_T acl_d)
-{
- TALLOC_FREE(acl_d);
- return 0;
-}
-
int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype)
{
return 0;
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index deef07e900..4efcb33a13 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -3075,7 +3075,7 @@ static bool set_canon_ace_list(files_struct *fsp,
fail:
if (the_acl != NULL) {
- sys_acl_free_acl(the_acl);
+ TALLOC_FREE(the_acl);
}
return ret;
@@ -3108,7 +3108,7 @@ SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T the_acl)
if (!the_acl)
return NULL;
if (sys_acl_get_entry(the_acl, SMB_ACL_FIRST_ENTRY, &entry) != 1) {
- sys_acl_free_acl(the_acl);
+ TALLOC_FREE(the_acl);
return NULL;
}
return the_acl;
@@ -3557,10 +3557,10 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn,
done:
if (posix_acl) {
- sys_acl_free_acl(posix_acl);
+ TALLOC_FREE(posix_acl);
}
if (def_acl) {
- sys_acl_free_acl(def_acl);
+ TALLOC_FREE(def_acl);
}
free_canon_ace_list(file_ace);
free_canon_ace_list(dir_ace);
@@ -4298,7 +4298,7 @@ int get_acl_group_bits( connection_struct *conn, const char *fname, mode_t *mode
}
}
}
- sys_acl_free_acl(posix_acl);
+ TALLOC_FREE(posix_acl);
return result;
}
@@ -4390,7 +4390,7 @@ static int copy_access_posix_acl(connection_struct *conn, const char *from, cons
done:
- sys_acl_free_acl(posix_acl);
+ TALLOC_FREE(posix_acl);
return ret;
}
@@ -4420,7 +4420,7 @@ static bool directory_has_default_posix_acl(connection_struct *conn, const char
}
if (def_acl) {
- sys_acl_free_acl(def_acl);
+ TALLOC_FREE(def_acl);
}
return has_acl;
}
@@ -4460,7 +4460,7 @@ int fchmod_acl(files_struct *fsp, mode_t mode)
done:
- sys_acl_free_acl(posix_acl);
+ TALLOC_FREE(posix_acl);
return ret;
}
@@ -4611,7 +4611,7 @@ static SMB_ACL_T create_posix_acl_from_wire(connection_struct *conn, uint16 num_
fail:
if (the_acl != NULL) {
- sys_acl_free_acl(the_acl);
+ TALLOC_FREE(the_acl);
}
return NULL;
}
@@ -4655,12 +4655,12 @@ bool set_unix_posix_default_acl(connection_struct *conn, const char *fname, cons
if (SMB_VFS_SYS_ACL_SET_FILE(conn, fname, SMB_ACL_TYPE_DEFAULT, def_acl) == -1) {
DEBUG(5,("set_unix_posix_default_acl: acl_set_file failed on directory %s (%s)\n",
fname, strerror(errno) ));
- sys_acl_free_acl(def_acl);
+ TALLOC_FREE(def_acl);
return False;
}
DEBUG(10,("set_unix_posix_default_acl: set default acl for file %s\n", fname ));
- sys_acl_free_acl(def_acl);
+ TALLOC_FREE(def_acl);
return True;
}
@@ -4794,10 +4794,10 @@ static bool remove_posix_acl(connection_struct *conn, files_struct *fsp, const c
done:
if (file_acl) {
- sys_acl_free_acl(file_acl);
+ TALLOC_FREE(file_acl);
}
if (new_file_acl) {
- sys_acl_free_acl(new_file_acl);
+ TALLOC_FREE(new_file_acl);
}
return ret;
}
@@ -4826,20 +4826,20 @@ bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *
if (SMB_VFS_SYS_ACL_SET_FD(fsp, file_acl) == -1) {
DEBUG(5,("set_unix_posix_acl: acl_set_file failed on %s (%s)\n",
fname, strerror(errno) ));
- sys_acl_free_acl(file_acl);
+ TALLOC_FREE(file_acl);
return False;
}
} else {
if (SMB_VFS_SYS_ACL_SET_FILE(conn, fname, SMB_ACL_TYPE_ACCESS, file_acl) == -1) {
DEBUG(5,("set_unix_posix_acl: acl_set_file failed on %s (%s)\n",
fname, strerror(errno) ));
- sys_acl_free_acl(file_acl);
+ TALLOC_FREE(file_acl);
return False;
}
}
DEBUG(10,("set_unix_posix_acl: set acl for file %s\n", fname ));
- sys_acl_free_acl(file_acl);
+ TALLOC_FREE(file_acl);
return True;
}
diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c
index 6bef8af66d..890e66e26f 100644
--- a/source3/smbd/pysmbd.c
+++ b/source3/smbd/pysmbd.c
@@ -164,82 +164,82 @@ static SMB_ACL_T make_simple_acl(uid_t uid, gid_t gid)
}
if (sys_acl_create_entry(&acl, &entry) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_set_tag_type(entry, SMB_ACL_USER_OBJ) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_set_permset(entry, &mode) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_create_entry(&acl, &entry) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_set_tag_type(entry, SMB_ACL_GROUP_OBJ) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_set_permset(entry, &mode) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_create_entry(&acl, &entry) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_set_tag_type(entry, SMB_ACL_OTHER) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_set_permset(entry, &mode0) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_create_entry(&acl, &entry) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_set_tag_type(entry, SMB_ACL_GROUP) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_set_qualifier(entry, &gid) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_set_permset(entry, &mode) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_create_entry(&acl, &entry) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_set_tag_type(entry, SMB_ACL_MASK) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
if (sys_acl_set_permset(entry, &mode0) != 0) {
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
return NULL;
}
return acl;
@@ -264,7 +264,7 @@ static PyObject *py_smbd_set_simple_acl(PyObject *self, PyObject *args)
frame = talloc_stackframe();
status = set_sys_acl_no_snum(fname, SMB_ACL_TYPE_ACCESS, acl);
- sys_acl_free_acl(acl);
+ TALLOC_FREE(acl);
TALLOC_FREE(frame);
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index a178ec5b08..679e3fa828 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -4914,10 +4914,10 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
(unsigned int)((num_file_acls + num_def_acls)*SMB_POSIX_ACL_ENTRY_SIZE +
SMB_POSIX_ACL_HEADER_SIZE) ));
if (file_acl) {
- sys_acl_free_acl(file_acl);
+ TALLOC_FREE(file_acl);
}
if (def_acl) {
- sys_acl_free_acl(def_acl);
+ TALLOC_FREE(def_acl);
}
return NT_STATUS_BUFFER_TOO_SMALL;
}
@@ -4927,28 +4927,28 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
SSVAL(pdata,4,num_def_acls);
if (!marshall_posix_acl(conn, pdata + SMB_POSIX_ACL_HEADER_SIZE, psbuf, file_acl)) {
if (file_acl) {
- sys_acl_free_acl(file_acl);
+ TALLOC_FREE(file_acl);
}
if (def_acl) {
- sys_acl_free_acl(def_acl);
+ TALLOC_FREE(def_acl);
}
return NT_STATUS_INTERNAL_ERROR;
}
if (!marshall_posix_acl(conn, pdata + SMB_POSIX_ACL_HEADER_SIZE + (num_file_acls*SMB_POSIX_ACL_ENTRY_SIZE), psbuf, def_acl)) {
if (file_acl) {
- sys_acl_free_acl(file_acl);
+ TALLOC_FREE(file_acl);
}
if (def_acl) {
- sys_acl_free_acl(def_acl);
+ TALLOC_FREE(def_acl);
}
return NT_STATUS_INTERNAL_ERROR;
}
if (file_acl) {
- sys_acl_free_acl(file_acl);
+ TALLOC_FREE(file_acl);
}
if (def_acl) {
- sys_acl_free_acl(def_acl);
+ TALLOC_FREE(def_acl);
}
data_size = (num_file_acls + num_def_acls)*SMB_POSIX_ACL_ENTRY_SIZE + SMB_POSIX_ACL_HEADER_SIZE;
break;