1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

87 Commits

Author SHA1 Message Date
Christof Schmitt
a6fade4e10 rpc_server: Fix NetSessEnum with stale sessions
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13407

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 25 22:49:07 CEST 2018 on sn-devel-144
2018-04-25 22:49:07 +02:00
Shekhar Amlekar
69470a2efd s3:smbd/session: Added a routine find_sessions()
this routine builds a list of sessions from a
particular remote machine or user.

Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-10 11:32:46 -07:00
Shekhar Amlekar
340f7f125d s3:smbd/session: add filters to gather_sessioninfo()
added capability to filter sessions based on remote
machine name and user name.

Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-09-10 11:32:27 -07:00
Gregor Beck
dbff58228e s3:smbd: don't use (fill) sessionid.tdb in session_claim/yield any more.
We use data from new smbXsrv_session instead.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:15:00 +02:00
Gregor Beck
b288ddd5c0 s3:smbd: use session_global_id as session number for pam and utmp
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-10-19 12:15:00 +02:00
Gregor Beck
02b9b79447 s3:smbd: remove smbd_server_connection argument from session_claim()
retrieve the server connection from the smbXsrv_session  argument instead.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:14:59 +02:00
Gregor Beck
4878769f8e s3:smbd: pass smbXsrv_session instead of user_struct to session_claim() and session_yield()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:14:59 +02:00
Stefan Metzmacher
9b2a3ebf5c s3:smbd/utmp: remove ip address from utmp record
1. This was broken since Samba 3.2. when ipv6 support was
   added, it only worked for ipv6 addresses.
2. userspace tools only display the hostname field.
3. This is not really portable

metze

Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:14:58 +02:00
Stefan Metzmacher
02d9ba6ee1 s3:smbd: change user_struct->vuid to uint64_t
Only sconn->smb1.sessions.next_vuid remains as uint16_t,
so that we do not generate larger values yet.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Jun  6 12:07:33 CEST 2012 on sn-devel-104
2012-06-06 12:07:33 +02:00
Stefan Metzmacher
f52e5738a2 s3:smbd: use 'struct user_struct' instead of typedef'ed 'user_struct'
metze
2012-06-06 10:18:39 +02:00
Jelmer Vernooij
c0288e0612 lib/util: Remove obsolete sys_getpid() and sys_fork().
The performance of these is minimal (these days) and they can return
invalid results when used as part of applications that do not use
sys_fork().

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
2012-03-24 21:55:40 +01:00
Stefan Metzmacher
704cf10645 s3:smbd: avoid using sconn_server_id()
metze
2011-12-16 13:19:32 +01:00
Michael Adam
ec057c369f s3:smbd: convert session.c to use dbwrap wrapper functions only
Avoid direct use of the db_record and db_context structs.
2011-10-11 14:17:57 +02:00
Michael Adam
bdee9458f6 s3:sessionid: use dbwrap_travers_read() in sessionid_travers_read()
This also changes the return code of sessionid_traverse_read() to NTSTATUS.
It also uses traverse_read instead of traverse.
2011-10-11 14:17:56 +02:00
Michael Adam
0b5c4a601a s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-07-29 13:34:22 +02:00
Andrew Bartlett
6622821063 s3-auth Remove seperate guest boolean
Instead, we base our guest calculations on the presence or absense of the
authenticated users group in the token, ensuring that we have only
one canonical source of this important piece of authorization data

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:14 +10:00
Andrew Bartlett
e2049e77e4 s3-auth Use guest boolean in auth_user_info_unix
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +10:00
Andrew Bartlett
9289537993 s3-auth Use struct auth_user_info_unix for unix_name and sanitized_username
This is closer to the layout of struct auth_session_info in auth.idl

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +10:00
Andrew Bartlett
6d741e918f s3-auth Use *unix_token rather than utok in struct auth3_session_info
This brings this structure one step closer to the struct auth_session_info.

A few SMB_ASSERT calls are added in some key places to ensure that
this pointer is initialised, to make tracing any bugs here easier in
future.

NOTE: Many of the users of this structure should be reviewed, as unix
and NT access checks are mixed in a way that should just be done using
the NT ACL.  This patch has not changed this behaviour however.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Andreas Schneider
ea2917c7a2 s3-smbd: Replace client_id in smbd session.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:28 +10:00
Rusty Russell
5a7874e119 tdb_traverse/tdb_traverse_read: check returns for negative, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for < 0 instead of == -1.

Also, there's no tdb_traverse_read in TDB2: we don't try to make
traverse reliable any more, so there are no write locks anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Andrew Bartlett
73b377432c s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_REALLOC_ARRAY isn't standard talloc.

Andrew Bartlett
2011-06-09 12:40:08 +02:00
Günther Deschner
af300a9fcb s3-auth: smbd needs auth.h
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
ea29261186 s3-sessionid: avoid global include of sessionid.h
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Mar  2 12:58:12 CET 2011 on sn-devel-104
2011-03-02 12:58:12 +01:00
Andrew Bartlett
2e69e89456 s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
These variables, of type struct auth_serversupplied_info were poorly
named when added into 2001, and in good consistant practice, this has
extended all over the codebase in the years since.

The structure is also not ideal for it's current purpose.  Originally
intended to convey the results of the authentication modules, it
really describes all the essential attributes of a session.  This
rename will reduce the volume of a future patch to replaced these with
a struct auth_session_info, with auth_serversupplied_info confined to
the lower levels of the auth subsystem, and then eliminated.

(The new structure will be the output of create_local_token(), and the
change in struct definition will ensure that this is always run, populating
local groups and privileges).

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-02-22 16:20:10 +11:00
Günther Deschner
7a05ca2c9c s3-build: use dbwrap.h only where needed.
Guenther
2010-08-26 00:25:55 +02:00
Volker Lendecke
f35811bfe0 s3: Use sconn->client_id in session_claim 2010-08-20 21:28:44 +02:00
Volker Lendecke
26ff858934 s3: Remove smbd_server_fd() from session_claim 2010-08-17 22:52:03 +02:00
Volker Lendecke
96ae457023 s3: Remove get_client_fd() 2010-08-16 13:13:10 +02:00
Volker Lendecke
13441a9e18 s3: Remove procid_self() from session_claim() 2010-07-05 11:06:25 +02:00
Volker Lendecke
d6a6872506 s3: Abstract access to sessionid.tdb, similar to conn_tdb.c 2010-03-01 17:53:22 +01:00
Stefan Metzmacher
3dde0cbb76 s3:smbd: move all globals and static variables in globals.[ch]
The goal is to move all this variables into a big context structure.

metze
2009-01-08 12:22:21 +01:00
Volker Lendecke
167feb2c91 Fix bug 5691: SIGBUS on Solaris 2008-10-13 11:57:15 +02:00
Volker Lendecke
40f5eab5eb Wrap the unix token info in a unix_user_token in auth_serversupplied_info
No functional change, this is a preparation for more current_user ref removal
(This used to be commit dcaedf345e)
2008-06-19 18:51:37 +02:00
Volker Lendecke
bec1dfab27 Remove "userdom_struct user" from "struct user_struct"
(This used to be commit 420de03523)
2008-05-05 18:28:59 +02:00
Volker Lendecke
71ff1ba2de Remove "guest" from "struct user_struct"
(This used to be commit 570a6b80fe)
2008-05-05 18:28:59 +02:00
Volker Lendecke
c6d209f834 Remove the unix token info from "struct user_struct"
(This used to be commit aa2299d42a)
2008-05-05 18:28:58 +02:00
Jeremy Allison
5b0b4f23ef Remove most of the remaining globals out of lib/util_sock.c.
I have a plan for dealing with the remaining..... Watch
this space.
Jeremy.
(This used to be commit 963fc76852)
2007-11-03 23:20:10 -07:00
Jeremy Allison
25074433f4 I can't get away without a 'length' arg. :-).
Jeremy.
(This used to be commit 95d01279a5)
2007-11-03 18:41:26 -07:00
Jeremy Allison
6658165d5e Stop get_peer_addr() and client_addr() from using global
statics. Part of my library cleanups.
Jeremy.
(This used to be commit e848506c85)
2007-11-03 18:15:45 -07:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Jeremy Allison
cb5436bcc3 Add const to the get_peer_addr() and get_socket_addr()
calls. Use the IPv6 varient for get_peer_addr().
Jeremy.
(This used to be commit baf1f52e34)
2007-10-11 15:36:13 -07:00
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
Jeremy Allison
0d87820380 r25492: Start adding IPv6 compatible code to lib/util_sock.c and deal with
the ripple effects this causes. utmp has to change etc. Remove some
global varables and store address/port in the unexpected db.
Jeremy.
(This used to be commit 18c6a2211d)
2007-10-10 12:31:09 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
4b70daaa59 r23236: Another bad merge: Correctly free and unlock the session record in
session_claim. Jerry, this fixes the hanging smbstatus.

Sorry for that,

Volker
(This used to be commit 86ff82a5df)
2007-10-10 12:22:57 -05:00
Volker Lendecke
a950301685 r23220: Add traverse_read to dbwrap
(This used to be commit b38dc5ffdf)
2007-10-10 12:22:55 -05:00
Volker Lendecke
ba0bce2c6f r23173: Convert sessionid.tdb to ctdb. The 3.0.26 patch is a bit larger because
it brings across the tdb-based list_sessions
(This used to be commit 0153386c1a)
2007-10-10 12:22:52 -05:00