s3-talloc Change TALLOC_P() to talloc()
authorAndrew Bartlett <abartlet@samba.org>
Tue, 7 Jun 2011 01:38:41 +0000 (11:38 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 9 Jun 2011 10:40:08 +0000 (12:40 +0200)
Using the standard macro makes it easier to move code into common, as
TALLOC_P isn't standard talloc.

47 files changed:
source3/include/smb_macros.h
source3/lib/bitmap.c
source3/lib/ctdbd_conn.c
source3/lib/dbwrap_ctdb.c
source3/lib/dbwrap_file.c
source3/lib/dbwrap_tdb.c
source3/lib/messages_ctdbd.c
source3/lib/messages_local.c
source3/lib/netapi/share.c
source3/lib/smbldap.c
source3/libads/ldap_schema.c
source3/libsmb/libsmb_xattr.c
source3/libsmb/namequery.c
source3/libsmb/samlogon_cache.c
source3/locking/brlock.c
source3/locking/locking.c
source3/locking/posix.c
source3/modules/vfs_afsacl.c
source3/modules/vfs_notify_fam.c
source3/modules/vfs_scannedonly.c
source3/param/service.c
source3/passdb/pdb_get_set.c
source3/passdb/pdb_ipa.c
source3/passdb/pdb_ldap.c
source3/passdb/secrets.c
source3/printing/notify.c
source3/printing/print_cups.c
source3/registry/reg_objects.c
source3/rpc_server/lsa/srv_lsa_nt.c
source3/rpc_server/srvsvc/srv_srvsvc_nt.c
source3/smbd/conn.c
source3/smbd/dfree.c
source3/smbd/ipc.c
source3/smbd/msdfs.c
source3/smbd/notify.c
source3/smbd/nttrans.c
source3/smbd/posix_acls.c
source3/smbd/process.c
source3/smbd/smb2_read.c
source3/smbd/trans2.c
source3/torture/nbench.c
source3/torture/vfstest.c
source3/utils/net_rpc_shell.c
source3/utils/net_usershare.c
source3/utils/netlookup.c
source3/winbindd/winbindd_cache.c
source3/winbindd/winbindd_cred_cache.c

index e21977f748bfe2c0111e42d447c652252815ebca..a51e9ec40789decefa0f6b58e728714ca7bed44a 100644 (file)
@@ -219,7 +219,6 @@ copy an IP address from one buffer to another
 #define SMB_XMALLOC_ARRAY(type,count) (type *)smb_xmalloc_array(sizeof(type),(count))
 
 #define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__)
-#define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type)
 #define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__)
 #define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__)
 #define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type)
index bd56b4aad1a5807cef6ee21be1e59646b7212e29..0acfcd8813a55e36201cef11122f697d08a58920 100644 (file)
@@ -29,7 +29,7 @@ struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n)
 {
        struct bitmap *bm;
 
-       bm = TALLOC_P(mem_ctx, struct bitmap);
+       bm = talloc(mem_ctx, struct bitmap);
 
        if (!bm) return NULL;
 
index f42290695a79ab3b2ca0552fa18435c094c42dfc..ecc331aa6a0f95ffd915337e6b541472a4f8bbbb 100644 (file)
@@ -304,7 +304,7 @@ static struct messaging_rec *ctdb_pull_messaging_rec(TALLOC_CTX *mem_ctx,
                cluster_fatal("got invalid msg length");
        }
 
-       if (!(result = TALLOC_P(mem_ctx, struct messaging_rec))) {
+       if (!(result = talloc(mem_ctx, struct messaging_rec))) {
                DEBUG(0, ("talloc failed\n"));
                return NULL;
        }
@@ -433,7 +433,7 @@ static NTSTATUS ctdb_read_req(struct ctdbd_connection *conn, uint32 reqid,
                        goto next_pkt;
                }
 
-               msg_state = TALLOC_P(NULL, struct deferred_msg_state);
+               msg_state = talloc(NULL, struct deferred_msg_state);
                if (msg_state == NULL) {
                        DEBUG(0, ("talloc failed\n"));
                        TALLOC_FREE(hdr);
index 298f4c16a54ea5cd8d92b27772f836a31fc5df6a..d5daba13e59ce0c1fdbf2bb9eb32d400a6bd6cef 100644 (file)
@@ -1371,7 +1371,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
                return NULL;
        }
 
-       if (!(db_ctdb = TALLOC_P(result, struct db_ctdb_ctx))) {
+       if (!(db_ctdb = talloc(result, struct db_ctdb_ctx))) {
                DEBUG(0, ("talloc failed\n"));
                TALLOC_FREE(result);
                return NULL;
index e195d6f6f3c0abf1469e9d9cf22752aa18affdd2..c27df0cdb93ba1822c6243e98f2fc475e3984c2b 100644 (file)
@@ -80,12 +80,12 @@ static struct db_record *db_file_fetch_locked(struct db_context *db,
        SMB_ASSERT(ctx->locked_record == NULL);
 
  again:
-       if (!(result = TALLOC_P(mem_ctx, struct db_record))) {
+       if (!(result = talloc(mem_ctx, struct db_record))) {
                DEBUG(0, ("talloc failed\n"));
                return NULL;
        }
 
-       if (!(file = TALLOC_P(result, struct db_locked_file))) {
+       if (!(file = talloc(result, struct db_locked_file))) {
                DEBUG(0, ("talloc failed\n"));
                TALLOC_FREE(result);
                return NULL;
@@ -353,7 +353,7 @@ struct db_context *db_open_file(TALLOC_CTX *mem_ctx,
                return NULL;
        }
 
-       if (!(ctx = TALLOC_P(result, struct db_file_ctx))) {
+       if (!(ctx = talloc(result, struct db_file_ctx))) {
                DEBUG(0, ("talloc failed\n"));
                TALLOC_FREE(result);
                return NULL;
index 98fd255ece41da28e7b102817d9bf768a5042e6e..0342725772acf0a3adc89101d296899073f391f6 100644 (file)
@@ -347,7 +347,7 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
                goto fail;
        }
 
-       result->private_data = db_tdb = TALLOC_P(result, struct db_tdb_ctx);
+       result->private_data = db_tdb = talloc(result, struct db_tdb_ctx);
        if (db_tdb == NULL) {
                DEBUG(0, ("talloc failed\n"));
                goto fail;
index 70f29b795ecf410bac2ee3de09fc9e419e0ff2fd..b9ee049d01d1c8a588d4c615d99988c7a3b0a884 100644 (file)
@@ -105,12 +105,12 @@ NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
        struct messaging_ctdbd_context *ctx;
        NTSTATUS status;
 
-       if (!(result = TALLOC_P(mem_ctx, struct messaging_backend))) {
+       if (!(result = talloc(mem_ctx, struct messaging_backend))) {
                DEBUG(0, ("talloc failed\n"));
                return NT_STATUS_NO_MEMORY;
        }
 
-       if (!(ctx = TALLOC_P(result, struct messaging_ctdbd_context))) {
+       if (!(ctx = talloc(result, struct messaging_ctdbd_context))) {
                DEBUG(0, ("talloc failed\n"));
                TALLOC_FREE(result);
                return NT_STATUS_NO_MEMORY;
index 9bfe6e68e00326b729de0390fa9f7f8c9b98cf42..bfed35ffe43d05366276209206801811a8e8afc5 100644 (file)
@@ -87,7 +87,7 @@ NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx,
        struct messaging_backend *result;
        struct messaging_tdb_context *ctx;
 
-       if (!(result = TALLOC_P(mem_ctx, struct messaging_backend))) {
+       if (!(result = talloc(mem_ctx, struct messaging_backend))) {
                DEBUG(0, ("talloc failed\n"));
                return NT_STATUS_NO_MEMORY;
        }
index c4ed1549ce7ddb6c3cd2f579c1d2e928de2a09b8..d12fa1cf0c06d8a1858690a70833f377b28996ae 100644 (file)
@@ -141,7 +141,7 @@ static NTSTATUS map_SHARE_INFO_buffer_to_srvsvc_share_info(TALLOC_CTX *mem_ctx,
                case 2:
                        i2 = (struct SHARE_INFO_2 *)buffer;
 
-                       s2 = TALLOC_P(mem_ctx, struct srvsvc_NetShareInfo2);
+                       s2 = talloc(mem_ctx, struct srvsvc_NetShareInfo2);
                        NT_STATUS_HAVE_NO_MEMORY(s2);
 
                        s2->name                = i2->shi2_netname;
@@ -159,7 +159,7 @@ static NTSTATUS map_SHARE_INFO_buffer_to_srvsvc_share_info(TALLOC_CTX *mem_ctx,
                case 1004:
                        i1004 = (struct SHARE_INFO_1004 *)buffer;
 
-                       s1004 = TALLOC_P(mem_ctx, struct srvsvc_NetShareInfo1004);
+                       s1004 = talloc(mem_ctx, struct srvsvc_NetShareInfo1004);
                        NT_STATUS_HAVE_NO_MEMORY(s1004);
 
                        s1004->comment          = i1004->shi1004_remark;
index 1632cd2feb845cd06e8fc1e0e6340fe70a8b0eaf..c49788459b4e4a1b8b5a2c060733f98d12a83989 100644 (file)
@@ -474,7 +474,7 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
                return;
        }
 
-       handle = TALLOC_P(mem_ctx, LDAPMessage *);
+       handle = talloc(mem_ctx, LDAPMessage *);
        SMB_ASSERT(handle != NULL);
 
        *handle = result;
@@ -494,7 +494,7 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
                return;
        }
 
-       handle = TALLOC_P(mem_ctx, LDAPMod **);
+       handle = talloc(mem_ctx, LDAPMod **);
        SMB_ASSERT(handle != NULL);
 
        *handle = mod;
index df13b08f4a2ca44db4ef6b23da5c9dc2eb3f2d38..7368be830fb24e55bfd5dd72a9075812706f79d9 100644 (file)
@@ -252,7 +252,7 @@ ADS_STATUS ads_check_posix_schema_mapping(TALLOC_CTX *mem_ctx,
                return ADS_ERROR(LDAP_NO_MEMORY);
        }
 
-       if ( (schema = TALLOC_P(mem_ctx, struct posix_schema)) == NULL ) {
+       if ( (schema = talloc(mem_ctx, struct posix_schema)) == NULL ) {
                TALLOC_FREE( ctx );
                return ADS_ERROR(LDAP_NO_MEMORY);
        }
index 56fe06435ccd0491657a87792c10ff5aed46f7f9..eeff9a9030653c7370ef21b8e0fd7321fe705680 100644 (file)
@@ -561,7 +561,7 @@ dos_attr_query(SMBCCTX *context,
        SMB_INO_T inode = 0;
         DOS_ATTR_DESC *ret;
 
-        ret = TALLOC_P(ctx, DOS_ATTR_DESC);
+        ret = talloc(ctx, DOS_ATTR_DESC);
         if (!ret) {
                 errno = ENOMEM;
                 return NULL;
index f5f4a7c1dcb3eaed93d81000ebd38dfdb26afeb1..511eba4cbf3908ba31117d5fa2a7974b06461f98 100644 (file)
@@ -2479,7 +2479,7 @@ NTSTATUS resolve_name_list(TALLOC_CTX *ctx,
        *return_ss_arr = NULL;
 
        if (is_ipaddress(name)) {
-               *return_ss_arr = TALLOC_P(ctx, struct sockaddr_storage);
+               *return_ss_arr = talloc(ctx, struct sockaddr_storage);
                if (!*return_ss_arr) {
                        return NT_STATUS_NO_MEMORY;
                }
index 01a528275186a4b32e94c495a216df57224769e7..a07ea5280aed0a54c3858ed7d131a602a52aa269 100644 (file)
@@ -149,7 +149,7 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3)
 
        /* Prepare data */
 
-       if (!(mem_ctx = TALLOC_P( NULL, int))) {
+       if (!(mem_ctx = talloc( NULL, int))) {
                DEBUG(0,("netsamlogon_cache_store: talloc() failed!\n"));
                return false;
        }
index 220688c7e746a0349511391b11b94eeefeda5ea6..9a9fd157892f95716e05b30d6320acccebccc0aa 100644 (file)
@@ -1823,7 +1823,7 @@ static struct byte_range_lock *brl_get_locks_internal(TALLOC_CTX *mem_ctx,
                                        files_struct *fsp, bool read_only)
 {
        TDB_DATA key, data;
-       struct byte_range_lock *br_lck = TALLOC_P(mem_ctx, struct byte_range_lock);
+       struct byte_range_lock *br_lck = talloc(mem_ctx, struct byte_range_lock);
        bool do_read_only = read_only;
 
        if (br_lck == NULL) {
index 55412ec8b2aa8c702db98b739d6e6fe2f64b276c..153f3da585b42e7377ac9c42b0ffe907df38acf5 100644 (file)
@@ -973,7 +973,7 @@ struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
        struct file_id tmp;
        TDB_DATA key = locking_key(&id, &tmp);
 
-       if (!(lck = TALLOC_P(mem_ctx, struct share_mode_lock))) {
+       if (!(lck = talloc(mem_ctx, struct share_mode_lock))) {
                DEBUG(0, ("talloc failed\n"));
                return NULL;
        }
@@ -1004,7 +1004,7 @@ struct share_mode_lock *fetch_share_mode_unlocked(TALLOC_CTX *mem_ctx,
        TDB_DATA key = locking_key(&id, &tmp);
        TDB_DATA data;
 
-       if (!(lck = TALLOC_P(mem_ctx, struct share_mode_lock))) {
+       if (!(lck = talloc(mem_ctx, struct share_mode_lock))) {
                DEBUG(0, ("talloc failed\n"));
                return NULL;
        }
@@ -1483,7 +1483,7 @@ static struct security_unix_token *copy_unix_token(TALLOC_CTX *ctx, const struct
 {
        struct security_unix_token *cpy;
 
-       cpy = TALLOC_P(ctx, struct security_unix_token);
+       cpy = talloc(ctx, struct security_unix_token);
        if (!cpy) {
                return NULL;
        }
index 2e590413f86c7e6fabae1e2b9f7a28220f0358dd..51151df9a431701329f0ec774c89af5845b71862 100644 (file)
@@ -892,7 +892,7 @@ BECOMES.....
         | l_curr|         | l_new   |
         +-------+         +---------+
 **********************************************/
-                               struct lock_list *l_new = TALLOC_P(ctx, struct lock_list);
+                               struct lock_list *l_new = talloc(ctx, struct lock_list);
 
                                if(l_new == NULL) {
                                        DEBUG(0,("posix_lock_list: talloc fail.\n"));
@@ -1000,7 +1000,7 @@ bool set_posix_lock_windows_flavour(files_struct *fsp,
                return False;
        }
 
-       if ((ll = TALLOC_P(l_ctx, struct lock_list)) == NULL) {
+       if ((ll = talloc(l_ctx, struct lock_list)) == NULL) {
                DEBUG(0,("set_posix_lock_windows_flavour: unable to talloc unlock list.\n"));
                talloc_destroy(l_ctx);
                return False;
@@ -1119,7 +1119,7 @@ bool release_posix_lock_windows_flavour(files_struct *fsp,
                return False;
        }
 
-       if ((ul = TALLOC_P(ul_ctx, struct lock_list)) == NULL) {
+       if ((ul = talloc(ul_ctx, struct lock_list)) == NULL) {
                DEBUG(0,("release_posix_lock_windows_flavour: unable to talloc unlock list.\n"));
                talloc_destroy(ul_ctx);
                return False;
@@ -1281,7 +1281,7 @@ bool release_posix_lock_posix_flavour(files_struct *fsp,
                return False;
        }
 
-       if ((ul = TALLOC_P(ul_ctx, struct lock_list)) == NULL) {
+       if ((ul = talloc(ul_ctx, struct lock_list)) == NULL) {
                DEBUG(0,("release_posix_lock_windows_flavour: unable to talloc unlock list.\n"));
                talloc_destroy(ul_ctx);
                return False;
index 658f3be179914b8ba2e7f25e8355348b5b62c395..2ef6adf953d056956b0a23fd589cce1d81844d17 100644 (file)
@@ -89,7 +89,7 @@ static void free_afs_acl(struct afs_acl *acl)
 
 static struct afs_ace *clone_afs_ace(TALLOC_CTX *mem_ctx, struct afs_ace *ace)
 {
-       struct afs_ace *result = TALLOC_P(mem_ctx, struct afs_ace);
+       struct afs_ace *result = talloc(mem_ctx, struct afs_ace);
 
        if (result == NULL)
                return NULL;
@@ -167,7 +167,7 @@ static struct afs_ace *new_afs_ace(TALLOC_CTX *mem_ctx,
                }
        }
 
-       result = TALLOC_P(mem_ctx, struct afs_ace);
+       result = talloc(mem_ctx, struct afs_ace);
 
        if (result == NULL) {
                DEBUG(0, ("Could not talloc AFS ace\n"));
index a4e7fd1e2ba5349ed00058124c2a99a75eae5fb0..1f76a05fc08d6b9c9c8d96fea4766108437e549c 100644 (file)
@@ -249,7 +249,7 @@ static NTSTATUS fam_watch(vfs_handle_struct *vfs_handle,
                fam_connection_initialized = True;
        }
 
-       if (!(watch = TALLOC_P(ctx, struct fam_watch_context))) {
+       if (!(watch = talloc(ctx, struct fam_watch_context))) {
                return NT_STATUS_NO_MEMORY;
        }
 
index a47d875b646ae30808355df943f5fc395f808600..6d748c4c2381f63147fa4d2e8d873df270fa57b7 100644 (file)
@@ -516,7 +516,7 @@ static SMB_STRUCT_DIR *scannedonly_opendir(vfs_handle_struct * handle,
                return NULL;
        }
 
-       sDIR = TALLOC_P(NULL, struct scannedonly_DIR);
+       sDIR = talloc(NULL, struct scannedonly_DIR);
        if (fname[0] != '/') {
                sDIR->base = construct_full_path(sDIR,handle, fname, true);
        } else {
@@ -544,7 +544,7 @@ static SMB_STRUCT_DIR *scannedonly_fdopendir(vfs_handle_struct * handle,
 
        fname = (const char *)fsp->fsp_name->base_name;
 
-       sDIR = TALLOC_P(NULL, struct scannedonly_DIR);
+       sDIR = talloc(NULL, struct scannedonly_DIR);
        if (fname[0] != '/') {
                sDIR->base = construct_full_path(sDIR,handle, fname, true);
        } else {
index 1545ef01714b988a80d3cab3c44fa9b4dbabd6a7..358b7af2deefb64d5bb82f63774382f964647491 100644 (file)
@@ -266,7 +266,7 @@ struct share_params *get_share_params(TALLOC_CTX *mem_ctx,
                return NULL;
        }
 
-       if (!(result = TALLOC_P(mem_ctx, struct share_params))) {
+       if (!(result = talloc(mem_ctx, struct share_params))) {
                DEBUG(0, ("talloc failed\n"));
                return NULL;
        }
index 782c08fc1c36caccbffb4e0cfa956744ff86435b..eec82f9c9840c864cd7a77caa66a2a283ec08dd4 100644 (file)
@@ -511,7 +511,7 @@ bool pdb_set_group_sid(struct samu *sampass, const struct dom_sid *g_sid, enum p
        if (!g_sid)
                return False;
 
-       if ( !(sampass->group_sid = TALLOC_P( sampass, struct dom_sid )) ) {
+       if ( !(sampass->group_sid = talloc( sampass, struct dom_sid )) ) {
                return False;
        }
 
index 556283dc6b373cd1c4d93b05635935643627e493..02f7bb6888839b2b5b9527e201fcda1c1cbb63fe 100644 (file)
@@ -693,7 +693,7 @@ static NTSTATUS ipasam_enum_trusteddoms(struct pdb_methods *methods,
        for (i = 0; i < *num_domains; i++) {
                struct trustdom_info *dom_info;
 
-               dom_info = TALLOC_P(*domains, struct trustdom_info);
+               dom_info = talloc(*domains, struct trustdom_info);
                if (dom_info == NULL) {
                        DEBUG(1, ("talloc failed\n"));
                        return NT_STATUS_NO_MEMORY;
index 8167e3799eefee1a0cfc83d33c11f36f8a56f0ac..2d33d2d954435bc4c0798111041cb3f364c07f6c 100644 (file)
@@ -6368,7 +6368,7 @@ static NTSTATUS ldapsam_enum_trusteddoms(struct pdb_methods *methods,
                char *dom_name, *dom_sid_str;
                struct trustdom_info *dom_info;
 
-               dom_info = TALLOC_P(*domains, struct trustdom_info);
+               dom_info = talloc(*domains, struct trustdom_info);
                if (dom_info == NULL) {
                        DEBUG(1, ("talloc failed\n"));
                        return NT_STATUS_NO_MEMORY;
index a1337eac9d377514ca241a62238df1ffdcceb24f..c9101ca0506fe37366d9f7eeb0894faed731323d 100644 (file)
@@ -420,7 +420,7 @@ static int list_trusted_domain(struct db_record *rec, void *private_data)
                return 0;
        }
 
-       if (!(dom_info = TALLOC_P(state->domains, struct trustdom_info))) {
+       if (!(dom_info = talloc(state->domains, struct trustdom_info))) {
                DEBUG(0, ("talloc failed\n"));
                return 0;
        }
index 9fd73e87071c9c0a168831ef751b2da2d2362a60..f9a2ca3b18fec858ab554c9e4c9d040706250c9f 100644 (file)
@@ -305,7 +305,7 @@ static void send_spoolss_notify2_msg(struct tevent_context *ev,
 
        /* Store the message on the pending queue. */
 
-       pnqueue = TALLOC_P(send_ctx, struct notify_queue);
+       pnqueue = talloc(send_ctx, struct notify_queue);
        if (!pnqueue) {
                DEBUG(0,("send_spoolss_notify2_msg: Out of memory.\n"));
                return;
@@ -313,7 +313,7 @@ static void send_spoolss_notify2_msg(struct tevent_context *ev,
 
        /* allocate a new msg structure and copy the fields */
        
-       if ( !(pnqueue->msg = TALLOC_P(send_ctx, SPOOLSS_NOTIFY_MSG)) ) {
+       if ( !(pnqueue->msg = talloc(send_ctx, SPOOLSS_NOTIFY_MSG)) ) {
                DEBUG(0,("send_spoolss_notify2_msg: talloc() of size [%lu] failed!\n", 
                        (unsigned long)sizeof(SPOOLSS_NOTIFY_MSG)));
                return;
@@ -357,7 +357,7 @@ static void send_notify_field_values(struct tevent_context *ev,
        if (!create_send_ctx())
                return;
 
-       msg = TALLOC_P(send_ctx, struct spoolss_notify_msg);
+       msg = talloc(send_ctx, struct spoolss_notify_msg);
        if (!msg)
                return;
 
@@ -388,7 +388,7 @@ static void send_notify_field_buffer(struct tevent_context *ev,
        if (!create_send_ctx())
                return;
 
-       msg = TALLOC_P(send_ctx, struct spoolss_notify_msg);
+       msg = talloc(send_ctx, struct spoolss_notify_msg);
        if (!msg)
                return;
 
index ff19de200dec6775054f2fd4b0ebb8033dd5bca0..b8bbddfebd07cd63491c845c53f08d802a59e4a9 100644 (file)
@@ -524,7 +524,7 @@ bool cups_cache_reload(struct tevent_context *ev,
        struct cups_async_cb_args *cb_args;
        int *p_pipe_fd;
 
-       cb_args = TALLOC_P(NULL, struct cups_async_cb_args);
+       cb_args = talloc(NULL, struct cups_async_cb_args);
        if (cb_args == NULL) {
                return false;
        }
index 389975587d7880b0d97c396b941e310041b88e68..a2ae178783275230045c2fb48adb32d5896f1c4b 100644 (file)
@@ -466,7 +466,7 @@ struct regval_blob *regval_compose(TALLOC_CTX *ctx, const char *name,
                                   uint32_t type,
                                   const uint8_t *data_p, size_t size)
 {
-       struct regval_blob *regval = TALLOC_P(ctx, struct regval_blob);
+       struct regval_blob *regval = talloc(ctx, struct regval_blob);
 
        if (regval == NULL) {
                return NULL;
@@ -505,7 +505,7 @@ int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint32_t type,
        /* allocate a slot in the array of pointers */
 
        if (  ctr->num_values == 0 ) {
-               ctr->values = TALLOC_P( ctr, struct regval_blob *);
+               ctr->values = talloc( ctr, struct regval_blob *);
        } else {
                ctr->values = talloc_realloc(ctr, ctr->values,
                                                   struct regval_blob *,
index a120c6e7fe9c5c2e563c44aee7db27ab43192d93..48cec6309421698c84aad8a8140886df6fef405e 100644 (file)
@@ -2412,14 +2412,14 @@ NTSTATUS _lsa_GetUserName(struct pipes_struct *p,
                domname = p->session_info->info3->base.domain.string;
        }
 
-       account_name = TALLOC_P(p->mem_ctx, struct lsa_String);
+       account_name = talloc(p->mem_ctx, struct lsa_String);
        if (!account_name) {
                return NT_STATUS_NO_MEMORY;
        }
        init_lsa_String(account_name, username);
 
        if (r->out.authority_name) {
-               authority_name = TALLOC_P(p->mem_ctx, struct lsa_String);
+               authority_name = talloc(p->mem_ctx, struct lsa_String);
                if (!authority_name) {
                        return NT_STATUS_NO_MEMORY;
                }
index c63a81dd77bfd6b182b405f7c11534e92f9612b4..228cb96cc04dc1a2c3654984aedd380bae1a6273 100644 (file)
@@ -1139,7 +1139,7 @@ WERROR _srvsvc_NetSrvGetInfo(struct pipes_struct *p,
        case 102: {
                struct srvsvc_NetSrvInfo102 *info102;
 
-               info102 = TALLOC_P(p->mem_ctx, struct srvsvc_NetSrvInfo102);
+               info102 = talloc(p->mem_ctx, struct srvsvc_NetSrvInfo102);
                if (!info102) {
                        return WERR_NOMEM;
                }
@@ -1165,7 +1165,7 @@ WERROR _srvsvc_NetSrvGetInfo(struct pipes_struct *p,
        case 101: {
                struct srvsvc_NetSrvInfo101 *info101;
 
-               info101 = TALLOC_P(p->mem_ctx, struct srvsvc_NetSrvInfo101);
+               info101 = talloc(p->mem_ctx, struct srvsvc_NetSrvInfo101);
                if (!info101) {
                        return WERR_NOMEM;
                }
@@ -1184,7 +1184,7 @@ WERROR _srvsvc_NetSrvGetInfo(struct pipes_struct *p,
        case 100: {
                struct srvsvc_NetSrvInfo100 *info100;
 
-               info100 = TALLOC_P(p->mem_ctx, struct srvsvc_NetSrvInfo100);
+               info100 = talloc(p->mem_ctx, struct srvsvc_NetSrvInfo100);
                if (!info100) {
                        return WERR_NOMEM;
                }
@@ -1454,47 +1454,47 @@ WERROR _srvsvc_NetShareGetInfo(struct pipes_struct *p,
 
        switch (r->in.level) {
                case 0:
-                       info->info0 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo0);
+                       info->info0 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo0);
                        W_ERROR_HAVE_NO_MEMORY(info->info0);
                        init_srv_share_info_0(p, info->info0, snum);
                        break;
                case 1:
-                       info->info1 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo1);
+                       info->info1 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo1);
                        W_ERROR_HAVE_NO_MEMORY(info->info1);
                        init_srv_share_info_1(p, info->info1, snum);
                        break;
                case 2:
-                       info->info2 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo2);
+                       info->info2 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo2);
                        W_ERROR_HAVE_NO_MEMORY(info->info2);
                        init_srv_share_info_2(p, info->info2, snum);
                        break;
                case 501:
-                       info->info501 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo501);
+                       info->info501 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo501);
                        W_ERROR_HAVE_NO_MEMORY(info->info501);
                        init_srv_share_info_501(p, info->info501, snum);
                        break;
                case 502:
-                       info->info502 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo502);
+                       info->info502 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo502);
                        W_ERROR_HAVE_NO_MEMORY(info->info502);
                        init_srv_share_info_502(p, info->info502, snum);
                        break;
                case 1004:
-                       info->info1004 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo1004);
+                       info->info1004 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo1004);
                        W_ERROR_HAVE_NO_MEMORY(info->info1004);
                        init_srv_share_info_1004(p, info->info1004, snum);
                        break;
                case 1005:
-                       info->info1005 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo1005);
+                       info->info1005 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo1005);
                        W_ERROR_HAVE_NO_MEMORY(info->info1005);
                        init_srv_share_info_1005(p, info->info1005, snum);
                        break;
                case 1006:
-                       info->info1006 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo1006);
+                       info->info1006 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo1006);
                        W_ERROR_HAVE_NO_MEMORY(info->info1006);
                        init_srv_share_info_1006(p, info->info1006, snum);
                        break;
                case 1007:
-                       info->info1007 = TALLOC_P(p->mem_ctx, struct srvsvc_NetShareInfo1007);
+                       info->info1007 = talloc(p->mem_ctx, struct srvsvc_NetShareInfo1007);
                        W_ERROR_HAVE_NO_MEMORY(info->info1007);
                        init_srv_share_info_1007(p, info->info1007, snum);
                        break;
index da4ed9966ca3b00c27f7b4f134594756dc42caa9..4e9ab91eaebca263f7a961b44d0d86a819d2e0dc 100644 (file)
@@ -134,7 +134,7 @@ connection_struct *conn_new(struct smbd_server_connection *sconn)
        if (sconn->using_smb2) {
                /* SMB2 */
                if (!(conn=TALLOC_ZERO_P(NULL, connection_struct)) ||
-                   !(conn->params = TALLOC_P(conn, struct share_params))) {
+                   !(conn->params = talloc(conn, struct share_params))) {
                        DEBUG(0,("TALLOC_ZERO() failed!\n"));
                        TALLOC_FREE(conn);
                        return NULL;
@@ -189,7 +189,7 @@ find_again:
        }
 
        if (!(conn=TALLOC_ZERO_P(NULL, connection_struct)) ||
-           !(conn->params = TALLOC_P(conn, struct share_params))) {
+           !(conn->params = talloc(conn, struct share_params))) {
                DEBUG(0,("TALLOC_ZERO() failed!\n"));
                TALLOC_FREE(conn);
                return NULL;
index 63c287cd41758b4c4daad4d5a63859cd0d124fd3..03541880e1546335491df9e25d9e3965716ea8dd 100644 (file)
@@ -207,7 +207,7 @@ uint64_t get_dfree_info(connection_struct *conn,
 
        /* No cached info or time to refresh. */
        if (!dfc) {
-               dfc = TALLOC_P(conn, struct dfree_cached_info);
+               dfc = talloc(conn, struct dfree_cached_info);
                if (!dfc) {
                        return dfree_ret;
                }
index b452000e13921ddbac3689d39d32cfaacf28d5b9..669e28e715ca30443cc75da32f7a4e72af2aa7e6 100644 (file)
@@ -645,7 +645,7 @@ void reply_trans(struct smb_request *req)
                return;
        }
 
-       if ((state = TALLOC_P(conn, struct trans_state)) == NULL) {
+       if ((state = talloc(conn, struct trans_state)) == NULL) {
                DEBUG(0, ("talloc failed\n"));
                reply_nterror(req, NT_STATUS_NO_MEMORY);
                END_PROFILE(SMBtrans);
index 1d296e342df6127cdddec5cccb00ed879a1891d7..2ae01a95ab97bff7440292c8b82b14201b87e940 100644 (file)
@@ -692,7 +692,7 @@ static NTSTATUS dfs_redirect(TALLOC_CTX *ctx,
                        bool *ppath_contains_wcard)
 {
        NTSTATUS status;
-       struct dfs_path *pdp = TALLOC_P(ctx, struct dfs_path);
+       struct dfs_path *pdp = talloc(ctx, struct dfs_path);
 
        if (!pdp) {
                return NT_STATUS_NO_MEMORY;
@@ -825,7 +825,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
        int snum;
        NTSTATUS status = NT_STATUS_NOT_FOUND;
        bool dummy;
-       struct dfs_path *pdp = TALLOC_P(ctx, struct dfs_path);
+       struct dfs_path *pdp = talloc(ctx, struct dfs_path);
        char *oldpath;
 
        if (!pdp) {
@@ -1318,7 +1318,7 @@ bool create_junction(TALLOC_CTX *ctx,
 {
        int snum;
        bool dummy;
-       struct dfs_path *pdp = TALLOC_P(ctx,struct dfs_path);
+       struct dfs_path *pdp = talloc(ctx,struct dfs_path);
        NTSTATUS status;
 
        if (!pdp) {
index d711cd69be0e730ebeff5138573b42eb510a1d89..a70f86df007b486f1e2e9e5fd95ef70bbab96c49 100644 (file)
@@ -520,7 +520,7 @@ struct sys_notify_context *sys_notify_context_create(connection_struct *conn,
 {
        struct sys_notify_context *ctx;
 
-       if (!(ctx = TALLOC_P(mem_ctx, struct sys_notify_context))) {
+       if (!(ctx = talloc(mem_ctx, struct sys_notify_context))) {
                DEBUG(0, ("talloc failed\n"));
                return NULL;
        }
index 18d5979e3c2755fdf0b7e5e8f312e512dc23fc56..f0873a6b9c9754924dfc5da26fa4e911c99ebc3e 100644 (file)
@@ -3020,7 +3020,7 @@ void reply_nttrans(struct smb_request *req)
                return;
        }
 
-       if ((state = TALLOC_P(conn, struct trans_state)) == NULL) {
+       if ((state = talloc(conn, struct trans_state)) == NULL) {
                reply_nterror(req, NT_STATUS_NO_MEMORY);
                END_PROFILE(SMBnttrans);
                return;
index 9252ee639fd3be4ae40a520eba5651a16ddde673..aebe64e2d81c3a5fe885309908137d894b6cf464 100644 (file)
@@ -4750,7 +4750,7 @@ struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fna
                return NULL;
        }
 
-       if (!(conn->params = TALLOC_P(conn, struct share_params))) {
+       if (!(conn->params = talloc(conn, struct share_params))) {
                DEBUG(0,("get_nt_acl_no_snum: talloc() failed!\n"));
                TALLOC_FREE(conn);
                return NULL;
index 2b8521d54aa13e1fdf6b04baff09e56fd339dd14..78beb730b961a9571863543853c1e46056e97616 100644 (file)
@@ -891,7 +891,7 @@ struct idle_event *event_add_idle(struct event_context *event_ctx,
        struct idle_event *result;
        struct timeval now = timeval_current();
 
-       result = TALLOC_P(mem_ctx, struct idle_event);
+       result = talloc(mem_ctx, struct idle_event);
        if (result == NULL) {
                DEBUG(0, ("talloc failed\n"));
                return NULL;
index f90f569e8ac0482a05ec65b11217424b983f9db9..6e686ef2738c174beaf19eb0681e14c47e3687f7 100644 (file)
@@ -308,7 +308,7 @@ static NTSTATUS schedule_smb2_sendfile_read(struct smbd_smb2_request *smb2req,
        /* Make a copy of state attached to the smb2req. Attach
           the destructor here as this will trigger the sendfile
           call when the request is destroyed. */
-       state_copy = TALLOC_P(smb2req, struct smbd_smb2_read_state);
+       state_copy = talloc(smb2req, struct smbd_smb2_read_state);
        if (!state_copy) {
                return NT_STATUS_NO_MEMORY;
        }
index b9a4d4624b858e137b356f5c10a314294f736662..6d85edf9eb68eff30cd4d3e1d2fee58074ef643e 100644 (file)
@@ -316,7 +316,7 @@ static struct ea_list *get_ea_list_from_file(TALLOC_CTX *mem_ctx, connection_str
                    || samba_private_attr_name(names[i]))
                        continue;
 
-               listp = TALLOC_P(mem_ctx, struct ea_list);
+               listp = talloc(mem_ctx, struct ea_list);
                if (listp == NULL) {
                        return NULL;
                }
@@ -8672,7 +8672,7 @@ void reply_trans2(struct smb_request *req)
                }
        }
 
-       if ((state = TALLOC_P(conn, struct trans_state)) == NULL) {
+       if ((state = talloc(conn, struct trans_state)) == NULL) {
                DEBUG(0, ("talloc failed\n"));
                reply_nterror(req, NT_STATUS_NO_MEMORY);
                END_PROFILE(SMBtrans2);
index efae14c76c5a9b02bdf28a864fefb178e8680bad..d2fddf0094532078a28e4081f86e2ea419653d98 100644 (file)
@@ -96,7 +96,7 @@ static struct nbench_cmd_struct *nbench_parse(TALLOC_CTX *mem_ctx,
        char *cmd;
        char *status;
 
-       result = TALLOC_P(mem_ctx, struct nbench_cmd_struct);
+       result = talloc(mem_ctx, struct nbench_cmd_struct);
        if (result == NULL) {
                return NULL;
        }
index 74ef572577527495b58ac4cde5a3c9efa94ee14c..572fec1f42ce8e55071624688ea91f9496dcc00d 100644 (file)
@@ -470,7 +470,7 @@ int main(int argc, char *argv[])
        /* some basic initialization stuff */
        sec_init();
        vfs.conn = TALLOC_ZERO_P(NULL, connection_struct);
-       vfs.conn->params = TALLOC_P(vfs.conn, struct share_params);
+       vfs.conn->params = talloc(vfs.conn, struct share_params);
        for (i=0; i < 1024; i++)
                vfs.files[i] = NULL;
 
index 4339dc836c50a3e79f7e916e87ca39b698d44250..42dfc48d4a4254acb951b410c277c076d1b1a1cc 100644 (file)
@@ -154,7 +154,7 @@ static bool net_sh_process(struct net_context *c,
                return true;
        }
 
-       new_ctx = TALLOC_P(ctx, struct rpc_sh_ctx);
+       new_ctx = talloc(ctx, struct rpc_sh_ctx);
        if (new_ctx == NULL) {
                d_fprintf(stderr, _("talloc failed\n"));
                return false;
@@ -234,7 +234,7 @@ int net_rpc_shell(struct net_context *c, int argc, const char **argv)
                libnetapi_set_use_kerberos(c->netapi_ctx);
        }
 
-       ctx = TALLOC_P(NULL, struct rpc_sh_ctx);
+       ctx = talloc(NULL, struct rpc_sh_ctx);
        if (ctx == NULL) {
                d_fprintf(stderr, _("talloc failed\n"));
                return -1;
index 06ed4533d5518d58b1b0027f634fc5705a898ee0..295f9ce4d9b4c17a31cc4d53716f21fd26a36a3b 100644 (file)
@@ -278,7 +278,7 @@ static int get_share_list(TALLOC_CTX *ctx, const char *wcard, bool only_ours)
                }
 
                /* (Finally) - add to list. */
-               fl = TALLOC_P(ctx, struct file_list);
+               fl = talloc(ctx, struct file_list);
                if (!fl) {
                        sys_closedir(dp);
                        return -1;
index d2a79640e9aa6f22cfbc24100a4cc902e5b9fc78..c115e2d29d231a26825bd498eeeb6ac9abbb4c29 100644 (file)
@@ -78,7 +78,7 @@ static struct con_struct *create_cs(struct net_context *c,
                return cs;
        }
 
-       cs = TALLOC_P(ctx, struct con_struct);
+       cs = talloc(ctx, struct con_struct);
        if (!cs) {
                *perr = NT_STATUS_NO_MEMORY;
                return NULL;
index a1f5ac69b5c48b1a55273092e1244be580f36af3..05261b70b0fc787140ce4a889b2cbfff69261eab 100644 (file)
@@ -4527,7 +4527,7 @@ struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const cha
                        DEBUG(10,("wcache_tdc_fetch_domain: Found domain %s\n",
                                  name));
 
-                       d = TALLOC_P( ctx, struct winbindd_tdc_domain );
+                       d = talloc( ctx, struct winbindd_tdc_domain );
                        if ( !d )
                                break;                  
 
@@ -4577,7 +4577,7 @@ struct winbindd_tdc_domain*
                                   dom_list[i].domain_name,
                                   sid_string_dbg(sid)));
 
-                       d = TALLOC_P(ctx, struct winbindd_tdc_domain);
+                       d = talloc(ctx, struct winbindd_tdc_domain);
                        if (!d)
                                break;
 
index ab8934bfd4a8b631c7bee70e87de68b0990249f6..7480db6a125a6ee64ce015f3a368224699e8e722 100644 (file)
@@ -596,7 +596,7 @@ NTSTATUS add_ccache_to_list(const char *princ_name,
                return NT_STATUS_OK;
        }
 
-       entry = TALLOC_P(NULL, struct WINBINDD_CCACHE_ENTRY);
+       entry = talloc(NULL, struct WINBINDD_CCACHE_ENTRY);
        if (!entry) {
                return NT_STATUS_NO_MEMORY;
        }