The branch, master has been updated
       via  8a48ca4 s3: Remove talloc_autofree_context() from change_to_guest()
       via  4ebbbdd s3: Remove talloc_autofree_context() from swat
       via  bf6ca13 s3: Remove talloc_autofree_context() from smbpasswd
       via  77e96d3 s3: Remove talloc_autofree_context() from 
net_sam_provision()
       via  2b601d7 s3: Remove talloc_autofree_context() from 
lookup_unix_user_name()
       via  9b2d314 s3: Remove talloc_autofree_context() from pdb_init_ads()
       via  2d8b650 s3: Remove two talloc_autofree_context() calls
       via  997a64f s3: Remove talloc_autofree_context() from serverid_db()
       via  34c0b16 s3: Remove talloc_autofree_context() from 
serverid_parent_init()
       via  8c55a9b s3: Remove talloc_autofree_context() from 
messaging_tdb_parent_init()
       via  c4efae7 s3: Remove talloc_autofree_context() from ctdb_read_req()
       via  8691960 s3: Remove talloc_autofree_context() from 
get_root_nt_token()
      from  69ef2b3 upgradeprovision: use the same case for hostname in 
reference provision as in the current provision

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 8a48ca4e3f2509571f0910165c9e8763864e9c7a
Author: Volker Lendecke <[email protected]>
Date:   Sat Sep 25 16:31:18 2010 -0700

    s3: Remove talloc_autofree_context() from change_to_guest()
    
    pass is freed at the exit of this routine

commit 4ebbbdd011aae397c79cc5a83a729e547480c112
Author: Volker Lendecke <[email protected]>
Date:   Sat Sep 25 16:30:06 2010 -0700

    s3: Remove talloc_autofree_context() from swat
    
    In both cases, pass is freed immediately

commit bf6ca13346e67107d821cec9edf4f767defa490e
Author: Volker Lendecke <[email protected]>
Date:   Sat Sep 25 16:28:21 2010 -0700

    s3: Remove talloc_autofree_context() from smbpasswd
    
    In both cases, pwd is freed immediately

commit 77e96d3229ea95d220a663aa99c7d376f3619d41
Author: Volker Lendecke <[email protected]>
Date:   Sat Sep 25 16:27:04 2010 -0700

    s3: Remove talloc_autofree_context() from net_sam_provision()

commit 2b601d72d55bb6cbdd1e47b002782159e0e589bf
Author: Volker Lendecke <[email protected]>
Date:   Sat Sep 25 16:24:16 2010 -0700

    s3: Remove talloc_autofree_context() from lookup_unix_user_name()
    
    pwd is freed in this routine immediately

commit 9b2d3142c1751a55d942ee8cb6bdcdee713989c2
Author: Volker Lendecke <[email protected]>
Date:   Sat Sep 25 16:23:11 2010 -0700

    s3: Remove talloc_autofree_context() from pdb_init_ads()

commit 2d8b65066e632c1a96b150e0cb5f7c361471ac31
Author: Volker Lendecke <[email protected]>
Date:   Sat Sep 25 16:20:11 2010 -0700

    s3: Remove two talloc_autofree_context() calls
    
    Both allocated blobs are freed in their routines

commit 997a64f6fb11e19d78c0468d86c0c545a4e586d1
Author: Volker Lendecke <[email protected]>
Date:   Sat Sep 25 16:02:04 2010 -0700

    s3: Remove talloc_autofree_context() from serverid_db()
    
    If we needed an explicit tdb_close() in the destructor, we'd be hosed
    long ago.

commit 34c0b166b6abd1d52e4c07a798f41a245d39a426
Author: Volker Lendecke <[email protected]>
Date:   Sat Sep 25 15:59:06 2010 -0700

    s3: Remove talloc_autofree_context() from serverid_parent_init()

commit 8c55a9b459a7f54ab505954f2d1d66538dd98d1b
Author: Volker Lendecke <[email protected]>
Date:   Sat Sep 25 15:56:33 2010 -0700

    s3: Remove talloc_autofree_context() from messaging_tdb_parent_init()

commit c4efae77fae88163b119ac71e8ed3220fb1f73b4
Author: Volker Lendecke <[email protected]>
Date:   Sat Sep 25 15:50:33 2010 -0700

    s3: Remove talloc_autofree_context() from ctdb_read_req()

commit 86919606c7bb9f80200799a23fb491a9bb7f2f14
Author: Volker Lendecke <[email protected]>
Date:   Sat Sep 25 15:46:36 2010 -0700

    s3: Remove talloc_autofree_context() from get_root_nt_token()
    
    The memcache_add_talloc() later on steals it anyway

-----------------------------------------------------------------------

Summary of changes:
 source3/auth/token_util.c      |    2 +-
 source3/include/messages.h     |    2 +-
 source3/include/serverid.h     |    2 +-
 source3/lib/ctdbd_conn.c       |    3 ++-
 source3/lib/messages_local.c   |    5 ++---
 source3/lib/serverid.c         |    9 ++++-----
 source3/libsmb/clikrb5.c       |    4 ++--
 source3/passdb/pdb_ads.c       |    2 +-
 source3/passdb/util_unixsids.c |    2 +-
 source3/smbd/server.c          |    4 ++--
 source3/smbd/uid.c             |    2 +-
 source3/utils/net_sam.c        |    2 +-
 source3/utils/smbpasswd.c      |    4 ++--
 source3/web/cgi.c              |    4 ++--
 14 files changed, 23 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c
index f88a88a..8666f88 100644
--- a/source3/auth/token_util.c
+++ b/source3/auth/token_util.c
@@ -109,7 +109,7 @@ struct security_token *get_root_nt_token( void )
        uid_to_sid(&u_sid, pw->pw_uid);
        gid_to_sid(&g_sid, pw->pw_gid);
 
-       token = create_local_nt_token(talloc_autofree_context(), &u_sid, False,
+       token = create_local_nt_token(talloc_tos(), &u_sid, False,
                                      1, &global_sid_Builtin_Administrators);
 
        security_token_set_privilege(token, SEC_PRIV_DISK_OPERATOR);
diff --git a/source3/include/messages.h b/source3/include/messages.h
index bf5e5de..d4f7d20 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -111,7 +111,7 @@ NTSTATUS messaging_tdb_init(struct messaging_context 
*msg_ctx,
                            TALLOC_CTX *mem_ctx,
                            struct messaging_backend **presult);
 
-bool messaging_tdb_parent_init(void);
+bool messaging_tdb_parent_init(TALLOC_CTX *mem_ctx);
 
 NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
                              TALLOC_CTX *mem_ctx,
diff --git a/source3/include/serverid.h b/source3/include/serverid.h
index 3fcb554..62bf638 100644
--- a/source3/include/serverid.h
+++ b/source3/include/serverid.h
@@ -62,6 +62,6 @@ bool serverid_traverse_read(int (*fn)(const struct server_id 
*id,
 /*
  * Ensure CLEAR_IF_FIRST works fine, to be called from the parent smbd
  */
-bool serverid_parent_init(void);
+bool serverid_parent_init(TALLOC_CTX *mem_ctx);
 
 #endif
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index e0682f3..101ab30 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -380,7 +380,8 @@ static NTSTATUS ctdb_read_req(struct ctdbd_connection 
*conn, uint32 reqid,
                        goto next_pkt;
                }
 
-               if (!(msg_state = TALLOC_P(talloc_autofree_context(), struct 
deferred_msg_state))) {
+               msg_state = TALLOC_P(NULL, struct deferred_msg_state);
+               if (msg_state == NULL) {
                        DEBUG(0, ("talloc failed\n"));
                        TALLOC_FREE(hdr);
                        goto next_pkt;
diff --git a/source3/lib/messages_local.c b/source3/lib/messages_local.c
index c475773..542d49e 100644
--- a/source3/lib/messages_local.c
+++ b/source3/lib/messages_local.c
@@ -133,7 +133,7 @@ NTSTATUS messaging_tdb_init(struct messaging_context 
*msg_ctx,
        return NT_STATUS_OK;
 }
 
-bool messaging_tdb_parent_init(void)
+bool messaging_tdb_parent_init(TALLOC_CTX *mem_ctx)
 {
        struct tdb_wrap *db;
 
@@ -143,8 +143,7 @@ bool messaging_tdb_parent_init(void)
         * work.
         */
 
-       db = tdb_wrap_open(talloc_autofree_context(),
-                          lock_path("messages.tdb"), 0,
+       db = tdb_wrap_open(mem_ctx, lock_path("messages.tdb"), 0,
                           TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_VOLATILE,
                           O_RDWR|O_CREAT,0600);
        if (db == NULL) {
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
index fefcc5d..f0c61ae 100644
--- a/source3/lib/serverid.c
+++ b/source3/lib/serverid.c
@@ -33,7 +33,7 @@ struct serverid_data {
        uint32_t msg_flags;
 };
 
-bool serverid_parent_init(void)
+bool serverid_parent_init(TALLOC_CTX *mem_ctx)
 {
        struct tdb_wrap *db;
 
@@ -43,8 +43,7 @@ bool serverid_parent_init(void)
         * work.
         */
 
-       db = tdb_wrap_open(talloc_autofree_context(),
-                          lock_path("serverid.tdb"),
+       db = tdb_wrap_open(mem_ctx, lock_path("serverid.tdb"),
                           0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT,
                           0644);
        if (db == NULL) {
@@ -62,8 +61,8 @@ static struct db_context *serverid_db(void)
        if (db != NULL) {
                return db;
        }
-       db = db_open(talloc_autofree_context(), lock_path("serverid.tdb"),
-                    0, TDB_DEFAULT|TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT, 0644);
+       db = db_open(NULL, lock_path("serverid.tdb"), 0,
+                    TDB_DEFAULT|TDB_CLEAR_IF_FIRST, O_RDWR|O_CREAT, 0644);
        return db;
 }
 
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index 704bcb9..5d51a5b 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -355,7 +355,7 @@ bool unwrap_edata_ntstatus(TALLOC_CTX *mem_ctx,
        }
        
        asn1_start_tag(data, ASN1_CONTEXT(2));
-       asn1_read_OctetString(data, talloc_autofree_context(), &edata_contents);
+       asn1_read_OctetString(data, talloc_tos(), &edata_contents);
        asn1_end_tag(data);
        asn1_end_tag(data);
        asn1_end_tag(data);
@@ -398,7 +398,7 @@ bool unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, 
DATA_BLOB *unwrapped_
        
        asn1_end_tag(data);
        asn1_start_tag(data, ASN1_CONTEXT(1));
-       asn1_read_OctetString(data, talloc_autofree_context(), &pac_contents);
+       asn1_read_OctetString(data, talloc_tos(), &pac_contents);
        asn1_end_tag(data);
        asn1_end_tag(data);
        asn1_end_tag(data);
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index fb2a5e3..e172f14 100644
--- a/source3/passdb/pdb_ads.c
+++ b/source3/passdb/pdb_ads.c
@@ -2323,7 +2323,7 @@ static NTSTATUS pdb_init_ads(struct pdb_methods 
**pdb_method,
        char *tmp = NULL;
        NTSTATUS status;
 
-       m = talloc(talloc_autofree_context(), struct pdb_methods);
+       m = talloc(NULL, struct pdb_methods);
        if (m == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
diff --git a/source3/passdb/util_unixsids.c b/source3/passdb/util_unixsids.c
index 1bd07c7..24d2c45 100644
--- a/source3/passdb/util_unixsids.c
+++ b/source3/passdb/util_unixsids.c
@@ -64,7 +64,7 @@ bool lookup_unix_user_name(const char *name, struct dom_sid 
*sid)
        struct passwd *pwd;
        bool ret;
 
-       pwd = getpwnam_alloc(talloc_autofree_context(), name);
+       pwd = getpwnam_alloc(talloc_tos(), name);
        if (pwd == NULL) {
                return False;
        }
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 8a55f93..2322d1f 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1126,7 +1126,7 @@ extern void build_options(bool screen);
        if (!locking_init())
                exit(1);
 
-       if (!messaging_tdb_parent_init()) {
+       if (!messaging_tdb_parent_init(smbd_event_context())) {
                exit(1);
        }
 
@@ -1134,7 +1134,7 @@ extern void build_options(bool screen);
                exit(1);
        }
 
-       if (!serverid_parent_init()) {
+       if (!serverid_parent_init(smbd_event_context())) {
                exit(1);
        }
 
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c
index 3b40cef..c52a819 100644
--- a/source3/smbd/uid.c
+++ b/source3/smbd/uid.c
@@ -32,7 +32,7 @@ bool change_to_guest(void)
 {
        struct passwd *pass;
 
-       pass = getpwnam_alloc(talloc_autofree_context(), lp_guestaccount());
+       pass = getpwnam_alloc(talloc_tos(), lp_guestaccount());
        if (!pass) {
                return false;
        }
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c
index ff2a8db..da3b9c3 100644
--- a/source3/utils/net_sam.c
+++ b/source3/utils/net_sam.c
@@ -1926,7 +1926,7 @@ doma_done:
 
        d_printf(_("Checking Guest's group.\n"));
 
-       pwd = getpwnam_alloc(talloc_autofree_context(), lp_guestaccount());
+       pwd = getpwnam_alloc(tc, lp_guestaccount());
        if (!pwd) {
                d_fprintf(stderr,
                          _("Failed to find just created Guest account!\n"
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index 1b68136..2ae7e4d 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -342,7 +342,7 @@ static int process_root(int local_flags)
                load_interfaces();
        }
 
-       if (!user_name[0] && (pwd = getpwuid_alloc(talloc_autofree_context(), 
geteuid()))) {
+       if (!user_name[0] && (pwd = getpwuid_alloc(talloc_tos(), geteuid()))) {
                fstrcpy(user_name, pwd->pw_name);
                TALLOC_FREE(pwd);
        } 
@@ -507,7 +507,7 @@ static int process_nonroot(int local_flags)
        }
 
        if (!user_name[0]) {
-               pwd = getpwuid_alloc(talloc_autofree_context(), getuid());
+               pwd = getpwuid_alloc(talloc_tos(), getuid());
                if (pwd) {
                        fstrcpy(user_name,pwd->pw_name);
                        TALLOC_FREE(pwd);
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index 794152c..1a472a7 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -314,7 +314,7 @@ static void cgi_web_auth(void)
                exit(0);
        }
 
-       pwd = getpwnam_alloc(talloc_autofree_context(), user);
+       pwd = getpwnam_alloc(talloc_tos(), user);
        if (!pwd) {
                printf("%sCannot find user %s<br>%s\n", head, user, tail);
                exit(0);
@@ -369,7 +369,7 @@ static bool cgi_handle_authorization(char *line)
         * Try and get the user from the UNIX password file.
         */
 
-       pass = getpwnam_alloc(talloc_autofree_context(), user);
+       pass = getpwnam_alloc(talloc_tos(), user);
 
        rhost = client_name(1);
        if (strequal(rhost,"UNKNOWN"))


-- 
Samba Shared Repository

Reply via email to