The branch, master has been updated
       via  c4b52fb s3: Use talloc_tos() in idmap_nss_sids_to_unixids
       via  a3ef79b s3: "dom_name" is not needed in idmap_nss_sids_to_unixids
       via  8cda1d9 s3: "ctx" is not needed in idmap_nss_unixids_to_sids
      from  a200bac s3-selftest: only run smbtorture4 tests when smbtorture4 is 
available.

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


- Log -----------------------------------------------------------------
commit c4b52fbc46cf8b67d1f3ed547d370368679625c1
Author: Volker Lendecke <[email protected]>
Date:   Tue Mar 8 20:59:59 2011 +0100

    s3: Use talloc_tos() in idmap_nss_sids_to_unixids
    
    Autobuild-User: Volker Lendecke <[email protected]>
    Autobuild-Date: Tue Mar  8 21:51:58 CET 2011 on sn-devel-104

commit a3ef79b6cf1abe4e99e1c1f6903892da23ca11e4
Author: Volker Lendecke <[email protected]>
Date:   Tue Mar 8 20:39:40 2011 +0100

    s3: "dom_name" is not needed in idmap_nss_sids_to_unixids

commit 8cda1d9797cba02c3db8f996581bb11ffa0d02fa
Author: Volker Lendecke <[email protected]>
Date:   Tue Mar 8 20:37:30 2011 +0100

    s3: "ctx" is not needed in idmap_nss_unixids_to_sids

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

Summary of changes:
 source3/winbindd/idmap_nss.c |   26 ++++----------------------
 1 files changed, 4 insertions(+), 22 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/idmap_nss.c b/source3/winbindd/idmap_nss.c
index 5d5bd8c..bfef7bb 100644
--- a/source3/winbindd/idmap_nss.c
+++ b/source3/winbindd/idmap_nss.c
@@ -43,7 +43,6 @@ static NTSTATUS idmap_nss_int_init(struct idmap_domain *dom,
 
 static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct 
id_map **ids)
 {
-       TALLOC_CTX *ctx;
        int i;
 
        /* initialize the status to avoid suprise */
@@ -51,12 +50,6 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct 
idmap_domain *dom, struct id_ma
                ids[i]->status = ID_UNKNOWN;
        }
 
-       ctx = talloc_new(dom);
-       if ( ! ctx) {
-               DEBUG(0, ("Out of memory!\n"));
-               return NT_STATUS_NO_MEMORY;
-       }
-
        for (i = 0; ids[i]; i++) {
                struct passwd *pw;
                struct group *gr;
@@ -122,9 +115,6 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct 
idmap_domain *dom, struct id_ma
                        break;
                }
        }
-
-
-       talloc_free(ctx);
        return NT_STATUS_OK;
 }
 
@@ -134,7 +124,6 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct 
idmap_domain *dom, struct id_ma
 
 static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct 
id_map **ids)
 {
-       TALLOC_CTX *ctx;
        int i;
 
        /* initialize the status to avoid suprise */
@@ -142,23 +131,17 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct 
idmap_domain *dom, struct id_ma
                ids[i]->status = ID_UNKNOWN;
        }
 
-       ctx = talloc_new(dom);
-       if ( ! ctx) {
-               DEBUG(0, ("Out of memory!\n"));
-               return NT_STATUS_NO_MEMORY;
-       }
-
        for (i = 0; ids[i]; i++) {
                struct group *gr;
                enum lsa_SidType type;
-               const char *dom_name = NULL;
-               const char *name = NULL;
+               char *name = NULL;
                bool ret;
 
                /* by default calls to winbindd are disabled
                   the following call will not recurse so this is safe */
                (void)winbind_on();
-               ret = winbind_lookup_sid(ctx, ids[i]->sid, &dom_name, &name, 
&type);
+               ret = winbind_lookup_sid(talloc_tos(), ids[i]->sid, NULL,
+                                        (const char **)&name, &type);
                (void)winbind_off();
 
                if (!ret) {
@@ -200,9 +183,8 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct 
idmap_domain *dom, struct id_ma
                        ids[i]->status = ID_UNKNOWN;
                        break;
                }
+               TALLOC_FREE(name);
        }
-
-       talloc_free(ctx);
        return NT_STATUS_OK;
 }
 


-- 
Samba Shared Repository

Reply via email to