The branch, master has been updated
       via  3da5d96 s3: Fix some blank line endings
       via  75724d9 s3: Use talloc_stackframe in token_contains_name_in_list
      from  9635621 s3: Remove a call to procid_self()

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


- Log -----------------------------------------------------------------
commit 3da5d964b9821a589be39ad076ed56000952382b
Author: Volker Lendecke <[email protected]>
Date:   Fri Oct 19 21:48:20 2012 +0200

    s3: Fix some blank line endings
    
    Autobuild-User(master): Volker Lendecke <[email protected]>
    Autobuild-Date(master): Sat Oct 20 09:06:12 CEST 2012 on sn-devel-104

commit 75724d9eb14cd288297f3f5228fb3d10a11861dc
Author: Volker Lendecke <[email protected]>
Date:   Sat Oct 20 07:20:39 2012 +0200

    s3: Use talloc_stackframe in token_contains_name_in_list

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

Summary of changes:
 source3/smbd/share_access.c |   31 +++++++++++++------------------
 1 files changed, 13 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/share_access.c b/source3/smbd/share_access.c
index 7087a98..d3c18fc 100644
--- a/source3/smbd/share_access.c
+++ b/source3/smbd/share_access.c
@@ -1,18 +1,18 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    Check access based on valid users, read list and friends
    Copyright (C) Volker Lendecke 2005
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -90,7 +90,7 @@ static bool token_contains_name(TALLOC_CTX *mem_ctx,
                 * result that might be interpreted in a wrong way. */
                smb_panic("substitutions failed");
        }
-       
+
        /* check to see is we already have a SID */
 
        if ( string_to_sid( &sid, name ) ) {
@@ -162,26 +162,21 @@ bool token_contains_name_in_list(const char *username,
                                 const struct security_token *token,
                                 const char **list)
 {
-       TALLOC_CTX *mem_ctx;
-
        if (list == NULL) {
                return False;
        }
-
-       if ( (mem_ctx = talloc_new(NULL)) == NULL ) {
-               smb_panic("talloc_new failed");
-       }
-
        while (*list != NULL) {
-               if (token_contains_name(mem_ctx, username, domain, sharename,
-                                       token, *list)) {
-                       TALLOC_FREE(mem_ctx);
-                       return True;
+               TALLOC_CTX *frame = talloc_stackframe();
+               bool ret;
+
+               ret = token_contains_name(frame, username, domain, sharename,
+                                         token, *list);
+               TALLOC_FREE(frame);
+               if (ret) {
+                       return true;
                }
                list += 1;
        }
-
-       TALLOC_FREE(mem_ctx);
        return False;
 }
 


-- 
Samba Shared Repository

Reply via email to