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"
/*
/****************************************************************************
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);
* 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;
/* 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;