r26382: Remove more uses of global_loadparm.
[ira/wip.git] / source / smb_server / session.c
index 50338ba16e639e0a00fb095523af58b9816bc561..e7970eb7d511768f30e69c7bb20688f91e004b5c 100644 (file)
@@ -7,7 +7,7 @@
 
    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 2 of the License, or
+   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,
    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, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
 #include "smb_server/smb_server.h"
-#include "dlinklist.h"
+#include "lib/util/dlinklist.h"
 
 
 /*
@@ -122,9 +121,8 @@ NTSTATUS smbsrv_session_sesssetup_finished(struct smbsrv_session *sess,
 /****************************************************************************
 destroy a session structure
 ****************************************************************************/
-static int smbsrv_session_destructor(void *p)
+static int smbsrv_session_destructor(struct smbsrv_session *sess)
 {
-       struct smbsrv_session *sess = talloc_get_type(p, struct smbsrv_session);
        struct smbsrv_connection *smb_conn = sess->smb_conn;
 
        idr_remove(smb_conn->sessions.idtree_vuid, sess->vuid);
@@ -137,6 +135,7 @@ static int smbsrv_session_destructor(void *p)
  * gensec_ctx is optional, but talloc_steal'ed when present
  */
 struct smbsrv_session *smbsrv_session_new(struct smbsrv_connection *smb_conn,
+                                         TALLOC_CTX *mem_ctx,
                                          struct gensec_security *gensec_ctx)
 {
        struct smbsrv_session *sess = NULL;
@@ -145,7 +144,7 @@ struct smbsrv_session *smbsrv_session_new(struct smbsrv_connection *smb_conn,
        /* Ensure no vuid gets registered in share level security. */
        if (smb_conn->config.security == SEC_SHARE) return NULL;
 
-       sess = talloc_zero(smb_conn, struct smbsrv_session);
+       sess = talloc_zero(mem_ctx, struct smbsrv_session);
        if (!sess) return NULL;
        sess->smb_conn = smb_conn;