The branch, master has been updated via 81d0b8a docs-xml:smbd.8: document new smbXsrv_*_global.tdb files via a144911 s3:lib: remove unused connections_fetch_entry*() and connections_init() via d4f369c s3:smbd: remove unused claim_connection/yield_connection via 3eff700 s3:smbd: don't call claim/yield_connection() in make_connection_snum/close_cnum() via 0ccbf89 s3:lib/conn_tdb: implement connections_forall_read() based on smbXsrv_*_global_traverse() via f76436c s3:smbd: fill tcon->global->session_global_id via 7be7ec8 s3:smbXsrv.idl: add session_global_id to smbXsrv_tcon_global via b74ed25 s3:lib: remove function connections_forall() via 3b61c60 doc-xml: remove "net connections" documentation via 4a7a8ec s3:utils/net: remove unused "net connections" via 5a4ffb2 s3:net_serverid: remove connections_forall from "net serverid wipedbs" via ac5c890 s3:lib: remove unused sessionid_*() functions via 2f2cb2f s3:net_serverid: remove sessionid_traverse from "net serverid wipedbs" via dbff582 s3:smbd: don't use (fill) sessionid.tdb in session_claim/yield any more. via f271431 s3:lib: implement sessionid_traverse_read with smb2srv_session_traverse_read via d9ea786 s3:smbd/connection: use smbXsrv_tcon_traverse to count connections via f588704 s3:smbd:setup_new_vc_session: traverse sessions instead of connections to shutdown other smbds via bcfa721 s3:build: move sessionid_tdb.o and conn_tdb.o to SMBD_OBJ_BASE via 89cc865 s3:smbXsrv_tcon: add smbXsrv_tcon_global_traverse() via c3a658f s3:smbXsrv_session: add smbXsrv_session_global_traverse() via b288ddd s3:smbd: use session_global_id as session number for pam and utmp via 92d53dd s3:configure: check that struct utmp.ut_line is large enough for our use case via e24b104 s3:smbd: initialize session->global before calling session_claim via 02b9b79 s3:smbd: remove smbd_server_connection argument from session_claim() via 4878769 s3:smbd: pass smbXsrv_session instead of user_struct to session_claim() and session_yield() via 77f99ec s3:net_status_shares: use connections_forall_read for a read only traversal via 77906e7 s3:count_current_connections: do not clear orphaned entries from connections.tdb via b237bbc s3:smbcontrol: don't do stack_trace by connection but by server_id. via d5c2739 s3:lib: remove unused function connections_traverse() via 611e30e s3:rpc_server/srvsvc: remove function net_enum_pipes() via c9a2111 s3:auth: use const in smb_pam_xxx_session() via 7aa0d7c s3:auth: remove duplicate propotypes for smb_pam_claim_session and smb_pam_close_session via 9b2a3eb s3:smbd/utmp: remove ip address from utmp record via 42b0398 s3:smbd: remove duplicate prototypes for sys_utmp_claim() an sys_utmp_yield() via 8a1c7a0 s3:smbd: add exit_server to the smbd_shim hooks via 8eab264 s3:smbd: move initialization of the smbd_shim from smbd_init_globals() to main() via 781db9d s3: fix comment header description for smbd_shim via 980191d s3:smbd: update sconn->remote_hostname after the netbios session request via 1de9e71 buildtools/wafsamba: only display 'ok' if the result is True from e3a48bb samba-tool user test: Fix expected output.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 81d0b8aebf8e7dee73907fabf408f0b2c3145207 Author: Stefan Metzmacher <me...@samba.org> Date: Thu Oct 18 15:35:39 2012 +0200 docs-xml:smbd.8: document new smbXsrv_*_global.tdb files metze Signed-off-by: Michael Adam <ob...@samba.org> Autobuild-User(master): Michael Adam <ob...@samba.org> Autobuild-Date(master): Fri Oct 19 14:00:39 CEST 2012 on sn-devel-104 commit a144911958d7bcd291a8f42a40832ffc0187279a Author: Stefan Metzmacher <me...@samba.org> Date: Fri Oct 5 19:05:32 2012 +0200 s3:lib: remove unused connections_fetch_entry*() and connections_init() metze Signed-off-by: Michael Adam <ob...@samba.org> commit d4f369c470ec1c8c7986a73e4ee6e18a97edd834 Author: Stefan Metzmacher <me...@samba.org> Date: Fri Oct 5 19:13:39 2012 +0200 s3:smbd: remove unused claim_connection/yield_connection metze Signed-off-by: Michael Adam <ob...@samba.org> commit 3eff70087005ffdee2ca579e65846ba1c33ec17f Author: Stefan Metzmacher <me...@samba.org> Date: Fri Oct 5 19:11:31 2012 +0200 s3:smbd: don't call claim/yield_connection() in make_connection_snum/close_cnum() This was used to maintain the connections.tdb database which is being removed. We use info from the smbXsrv_tcon instead. Signed-off-by: Michael Adam <ob...@samba.org> commit 0ccbf89bda71cdbe8d216bab0aa6aacd98cf95df Author: Gregor Beck <gb...@sernet.de> Date: Mon Sep 3 11:13:16 2012 +0200 s3:lib/conn_tdb: implement connections_forall_read() based on smbXsrv_*_global_traverse() Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit f76436c6ea7867fb60d6ac6b65cffc502a018467 Author: Stefan Metzmacher <me...@samba.org> Date: Thu Oct 18 13:40:08 2012 +0200 s3:smbd: fill tcon->global->session_global_id metze Signed-off-by: Michael Adam <ob...@samba.org> commit 7be7ec803f88de68ef9a5e2b14994a13589ff441 Author: Stefan Metzmacher <me...@samba.org> Date: Thu Oct 18 13:38:34 2012 +0200 s3:smbXsrv.idl: add session_global_id to smbXsrv_tcon_global This is required for some debugging tools like smbstatus. metze Signed-off-by: Michael Adam <ob...@samba.org> commit b74ed25a9999c0029ddf2771f729c497c20b9c30 Author: Gregor Beck <gb...@sernet.de> Date: Mon Aug 27 15:21:42 2012 +0200 s3:lib: remove function connections_forall() Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit 3b61c605d6815a8033d70f367a69e876f63bc5de Author: Stefan Metzmacher <me...@samba.org> Date: Thu Oct 18 10:13:59 2012 +0200 doc-xml: remove "net connections" documentation metze Signed-off-by: Michael Adam <ob...@samba.org> commit 4a7a8ecb0b69b3b79823aab7504e75451d20e5a0 Author: Stefan Metzmacher <me...@samba.org> Date: Fri Oct 5 19:20:45 2012 +0200 s3:utils/net: remove unused "net connections" The connections.tdb will go away. metze Signed-off-by: Michael Adam <ob...@samba.org> commit 5a4ffb20ffe387fa5bb373778ba84d24a7e5b74f Author: Gregor Beck <gb...@sernet.de> Date: Thu Aug 23 14:02:22 2012 +0200 s3:net_serverid: remove connections_forall from "net serverid wipedbs" This tdb will go away. Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit ac5c8909a94228cec47067188036f1c2a42378aa Author: Gregor Beck <gb...@sernet.de> Date: Thu Aug 23 10:36:59 2012 +0200 s3:lib: remove unused sessionid_*() functions Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit 2f2cb2f6894c94f375310661e7c40c167a784eda Author: Gregor Beck <gb...@sernet.de> Date: Thu Aug 23 14:02:22 2012 +0200 s3:net_serverid: remove sessionid_traverse from "net serverid wipedbs" This tdb will go away. Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit dbff58228e5d05d9799322973aee950951d23fb8 Author: Gregor Beck <gb...@sernet.de> Date: Thu Aug 23 16:15:25 2012 +0200 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 <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit f2714318ae7358abd328e264dc80821c2749bcc6 Author: Gregor Beck <gb...@sernet.de> Date: Thu Aug 23 10:36:59 2012 +0200 s3:lib: implement sessionid_traverse_read with smb2srv_session_traverse_read Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit d9ea786c86d6bc42df60881ff703213ef3bd9319 Author: Gregor Beck <gb...@sernet.de> Date: Tue Aug 28 15:53:28 2012 +0200 s3:smbd/connection: use smbXsrv_tcon_traverse to count connections Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit f588704640868a003d901b57045511623e6a1f69 Author: Gregor Beck <gb...@sernet.de> Date: Tue Aug 28 14:29:51 2012 +0200 s3:smbd:setup_new_vc_session: traverse sessions instead of connections to shutdown other smbds Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit bcfa721a36269d4390ae5ce747cfd3dff6a255ac Author: Gregor Beck <gb...@sernet.de> Date: Fri Sep 7 15:18:39 2012 +0200 s3:build: move sessionid_tdb.o and conn_tdb.o to SMBD_OBJ_BASE and use SMBD_OBJ_BASE for a couple of targets where sessionid_tdb and conn_tdb were used. Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit 89cc865cabdf7f7fd7c26d3da784c1d7f9e1d6b0 Author: Gregor Beck <gb...@sernet.de> Date: Tue Aug 28 15:35:58 2012 +0200 s3:smbXsrv_tcon: add smbXsrv_tcon_global_traverse() Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit c3a658f59578899215920a42f5cb568f9368ce13 Author: Gregor Beck <gb...@sernet.de> Date: Wed Aug 22 14:28:31 2012 +0200 s3:smbXsrv_session: add smbXsrv_session_global_traverse() Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit b288ddd5c0ee7524e30a4fce3ec4f03c19a1764a Author: Gregor Beck <gb...@sernet.de> Date: Thu Aug 23 15:21:06 2012 +0200 s3:smbd: use session_global_id as session number for pam and utmp Signed-off-by: Michael Adam <ob...@samba.org> Signed-off-by: Stefan Metzmacher <me...@samba.org> commit 92d53dd7dc8ca71ae28d2a8762524396cd3c6f58 Author: Stefan Metzmacher <me...@samba.org> Date: Mon Oct 8 11:15:50 2012 +0200 s3:configure: check that struct utmp.ut_line is large enough for our use case We use "smb/%u" with a 32-bit number, "smb/4294967295\0" requires 15 chars (including the '\0'). metze Signed-off-by: Michael Adam <ob...@samba.org> commit e24b1041b1f6e5b1c5a258a2cbe058f134a45ed9 Author: Gregor Beck <gb...@sernet.de> Date: Mon Aug 27 11:03:25 2012 +0200 s3:smbd: initialize session->global before calling session_claim Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit 02b9b79447be46835adf963cca14c618d0c435e6 Author: Gregor Beck <gb...@sernet.de> Date: Mon Aug 27 09:21:58 2012 +0200 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 <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit 4878769f8e6763fbb8347f2ea674c7a861d95564 Author: Gregor Beck <gb...@sernet.de> Date: Thu Aug 23 14:47:33 2012 +0200 s3:smbd: pass smbXsrv_session instead of user_struct to session_claim() and session_yield() Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit 77f99ece482a11aad50219e64d231b27dbbccbba Author: Gregor Beck <gb...@sernet.de> Date: Mon Aug 27 15:18:07 2012 +0200 s3:net_status_shares: use connections_forall_read for a read only traversal Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit 77906e7cdf4c40ab860af8bb42e2c5f3b5501e7d Author: Gregor Beck <gb...@sernet.de> Date: Mon Aug 27 15:12:36 2012 +0200 s3:count_current_connections: do not clear orphaned entries from connections.tdb This removes one of the last callers of connetions_forall. Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit b237bbc0d1afdfea3b6b6335854f92d6fe80a151 Author: Gregor Beck <gb...@sernet.de> Date: Tue Aug 28 09:31:59 2012 +0200 s3:smbcontrol: don't do stack_trace by connection but by server_id. Inparticular use serverid_traverse_read instead of connections_foralli to enumerate processes. Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit d5c273919d129f884d5fb13e06ad73e01c7176e1 Author: Gregor Beck <gb...@sernet.de> Date: Mon Aug 27 15:07:08 2012 +0200 s3:lib: remove unused function connections_traverse() Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit 611e30ea233f0e5dab1439e930ea8544b85ca3b2 Author: Gregor Beck <gb...@sernet.de> Date: Mon Aug 27 14:46:22 2012 +0200 s3:rpc_server/srvsvc: remove function net_enum_pipes() The relevant records are not written to connections.tdb since commit a781b78417b6d7b875230dd2edcb932445aa4197 Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit c9a2111b0025156ba70c6eb9fa857e5d639f62b7 Author: Gregor Beck <gb...@sernet.de> Date: Mon Sep 3 13:55:50 2012 +0200 s3:auth: use const in smb_pam_xxx_session() Signed-off-by: Stefan Metzmacher <me...@samba.org> Signed-off-by: Michael Adam <ob...@samba.org> commit 7aa0d7c55f9cbb3ed96beaf7c4891cadc9bc00ae Author: Michael Adam <ob...@samba.org> Date: Thu Oct 18 16:14:19 2012 +0200 s3:auth: remove duplicate propotypes for smb_pam_claim_session and smb_pam_close_session Signed-off-by: Michael Adam <ob...@samba.org> commit 9b2a3ebf5cfb4613b117ebb83abe92b93e759381 Author: Stefan Metzmacher <me...@samba.org> Date: Tue Oct 9 09:38:36 2012 +0200 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 <ob...@samba.org> commit 42b0398bdeae8fd7e8ae92ab3a464c3eba9fb0da Author: Michael Adam <ob...@samba.org> Date: Thu Oct 18 16:06:42 2012 +0200 s3:smbd: remove duplicate prototypes for sys_utmp_claim() an sys_utmp_yield() Signed-off-by: Michael Adam <ob...@samba.org> commit 8a1c7a0a660d78786adac483ecafa157c3a3dc2e Author: Stefan Metzmacher <me...@samba.org> Date: Tue Oct 9 08:35:04 2012 -0400 s3:smbd: add exit_server to the smbd_shim hooks This is in preparation of moving sessionid_tdb and conn_tdb to smbd exclusively. metze Signed-off-by: Michael Adam <ob...@samba.org> commit 8eab264470ee7adea1e448fc29bc8111902a83b0 Author: Michael Adam <ob...@samba.org> Date: Thu Oct 18 15:59:55 2012 +0200 s3:smbd: move initialization of the smbd_shim from smbd_init_globals() to main() This is in preparation of adding server exit hooks to the shim. Signed-off-by: Michael Adam <ob...@samba.org> commit 781db9d1e564797546009aa5a49378b6e70502d7 Author: Michael Adam <ob...@samba.org> Date: Thu Oct 18 15:58:01 2012 +0200 s3: fix comment header description for smbd_shim This was copy'n'pasted from "RPC pipe client"... Signed-off-by: Michael Adam <ob...@samba.org> commit 980191d189ee1f5a25e74a6bdf141d4c7e4455d5 Author: Stefan Metzmacher <me...@samba.org> Date: Wed Oct 17 14:59:30 2012 +0200 s3:smbd: update sconn->remote_hostname after the netbios session request Also update the info in the new smbXsrv structure. This way we can log the remote name in status outputs. metze Signed-off-by: Michael Adam <ob...@samba.org> commit 1de9e714756b65b1e15fae044bde065bb2572b16 Author: Stefan Metzmacher <me...@samba.org> Date: Mon Oct 8 11:18:03 2012 +0200 buildtools/wafsamba: only display 'ok' if the result is True Otherwise we print the raw value. metze Signed-off-by: Michael Adam <ob...@samba.org> ----------------------------------------------------------------------- Summary of changes: buildtools/wafsamba/samba_autoconf.py | 4 +- docs-xml/manpages/net.8.xml | 39 ---- docs-xml/manpages/smbd.8.xml | 14 +- source3/Makefile.in | 84 ++++------ source3/auth/pampass.c | 8 +- source3/auth/proto.h | 6 +- source3/configure.in | 37 ++-- source3/include/local.h | 20 -- source3/include/proto.h | 6 - source3/lib/conn_tdb.c | 232 +++++++++---------------- source3/lib/conn_tdb.h | 25 +--- source3/lib/sessionid_tdb.c | 141 ++++------------ source3/lib/smbd_shim.c | 18 ++- source3/lib/smbd_shim.h | 6 +- source3/librpc/idl/smbXsrv.idl | 4 + source3/rpc_server/srvsvc/srv_srvsvc_nt.c | 97 ---------- source3/smbd/connection.c | 132 ++------------- source3/smbd/globals.c | 16 -- source3/smbd/globals.h | 8 + source3/smbd/password.c | 2 +- source3/smbd/proto.h | 28 ++-- source3/smbd/reply.c | 13 ++ source3/smbd/server.c | 24 ++- source3/smbd/server_exit.c | 4 +- source3/smbd/service.c | 18 +-- source3/smbd/session.c | 193 ++++----------------- source3/smbd/sesssetup.c | 67 ++++--- source3/smbd/smb2_sesssetup.c | 14 +- source3/smbd/smb2_tcon.c | 2 + source3/smbd/smbXsrv_session.c | 71 ++++++++ source3/smbd/smbXsrv_tcon.c | 70 ++++++++ source3/smbd/utmp.c | 54 ++----- source3/torture/vfstest.c | 14 ++- source3/utils/net.c | 7 - source3/utils/net_connections.c | 273 ----------------------------- source3/utils/net_proto.h | 4 - source3/utils/net_serverid.c | 54 +------ source3/utils/net_status.c | 5 +- source3/utils/smbcontrol.c | 13 +- source3/wscript | 12 +- source3/wscript_build | 14 +- source4/rpc_server/wscript_build | 2 +- 42 files changed, 549 insertions(+), 1306 deletions(-) delete mode 100644 source3/utils/net_connections.c Changeset truncated at 500 lines: diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py index 5d3cc5a..76316d2 100644 --- a/buildtools/wafsamba/samba_autoconf.py +++ b/buildtools/wafsamba/samba_autoconf.py @@ -62,8 +62,8 @@ def COMPOUND_END(conf, result): conf.check_message_1 = conf.saved_check_message_1 conf.check_message_2 = conf.saved_check_message_2 p = conf.check_message_2 - if result: - p('ok ') + if result is True: + p('ok') elif not result: p('not found', 'YELLOW') else: diff --git a/docs-xml/manpages/net.8.xml b/docs-xml/manpages/net.8.xml index 322aa88..3765af9 100644 --- a/docs-xml/manpages/net.8.xml +++ b/docs-xml/manpages/net.8.xml @@ -2112,45 +2112,6 @@ string.</member> </refsect2> <refsect2> -<title>CONNECTIONS</title> -<para> -Manipulate Samba's connections database. -</para> - -<para>The registry commands are: -<simplelist> -<member>net connections cleanup - Remove orphaned entries from the connections database.</member> -</simplelist> -</para> - -<refsect3> - <title>CONNECTIONS CLEANUP [-avT]</title> - <para> Remove orphaned entries from the connections database. This may be necessary if restarting smbd isn't an option. - <variablelist> - <varlistentry><term>-a|--auto</term> - <listitem><para> - Noninteractive mode, don't ask. - </para></listitem> - </varlistentry> - - <varlistentry><term>-v|--verbose</term> - <listitem><para> - Produce more output. - </para></listitem> - </varlistentry> - - <varlistentry><term>-T|--test</term> - <listitem><para> - Dry run, show what changes would be made but don't touch anything. - </para></listitem> - </varlistentry> - </variablelist> - </para> -</refsect3> - -</refsect2> - -<refsect2> <title>EVENTLOG</title> <para>Starting with version 3.4.0 net can read, dump, import and export native diff --git a/docs-xml/manpages/smbd.8.xml b/docs-xml/manpages/smbd.8.xml index ae34ce2..98e76fb 100644 --- a/docs-xml/manpages/smbd.8.xml +++ b/docs-xml/manpages/smbd.8.xml @@ -309,10 +309,6 @@ <listitem><para>browse lists</para></listitem> </varlistentry> -<varlistentry><term>connections.tdb</term> -<listitem><para>share connections (used to enforce max connections, etc...)</para></listitem> -</varlistentry> - <varlistentry><term>gencache.tdb</term> <listitem><para>generic caching db</para></listitem> </varlistentry> @@ -357,10 +353,18 @@ <listitem><para>Windows registry skeleton (connect via regedit.exe)</para></listitem> </varlistentry> -<varlistentry><term>sessionid.tdb</term> +<varlistentry><term>smbXsrv_session_global.tdb</term> <listitem><para>session information (e.g. support for 'utmp = yes')</para></listitem> </varlistentry> +<varlistentry><term>smbXsrv_tcon_global.tdb</term> +<listitem><para>share connections (used to enforce max connections, etc...)</para></listitem> +</varlistentry> + +<varlistentry><term>smbXsrv_open_global.tdb</term> +<listitem><para>open file handles (used durable handles, etc...)</para></listitem> +</varlistentry> + <varlistentry><term>share_info.tdb*</term> <listitem><para>share acls</para></listitem> </varlistentry> diff --git a/source3/Makefile.in b/source3/Makefile.in index bafa82a..990217c 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -480,8 +480,7 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) $(LIBTSOCKET_OBJ) \ ../libcli/smb/smb_signing.o \ ../lib/util/charset/iconv.o ../lib/util/charset/weird.o \ ../lib/util/charset/charset_macosxfs.o intl/lang_tdb.o \ - lib/conn_tdb.o lib/adt_tree.o lib/gencache.o \ - lib/sessionid_tdb.o \ + lib/adt_tree.o lib/gencache.o \ ../lib/util/modules.o lib/events.o @LIBTEVENT_OBJ0@ \ @CCAN_OBJ@ \ lib/server_contexts.o \ @@ -1001,7 +1000,9 @@ SMBD_OBJ_BASE = $(PARAM_WITHOUT_REG_OBJ) $(SMBD_OBJ_SRV) $(LIBSMB_OBJ) \ $(PRIVILEGES_BASIC_OBJ) \ $(REGFIO_OBJ) \ $(REG_API_REGF_OBJ) \ - $(LIBNDR_XATTR_OBJ) + $(LIBNDR_XATTR_OBJ) \ + lib/conn_tdb.o lib/sessionid_tdb.o + PRINTING_OBJ = printing/pcap.o printing/print_svid.o printing/print_aix.o \ printing/print_cups.o printing/print_generic.o \ @@ -1043,19 +1044,9 @@ NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \ SWAT_OBJ1 = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \ web/swat.o web/neg_lang.o -SWAT_OBJ = $(SWAT_OBJ1) $(PARAM_OBJ) $(PRINTING_OBJ) $(PRINTBASE_OBJ) $(LIBSMB_OBJ) \ - $(LOCKING_OBJ) $(PASSDB_OBJ) $(KRBCLIENT_OBJ) \ - $(LIB_NONSMBD_OBJ) $(GROUPDB_OBJ) $(PLAINTEXT_AUTH_OBJ) \ - $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ) \ - $(PASSCHANGE_OBJ) $(FNAME_UTIL_OBJ) \ - $(LIBCLI_SAMR_OBJ) \ - rpc_client/init_lsa.o +SWAT_OBJ = $(SWAT_OBJ1) $(SMBD_OBJ_BASE) $(PASSCHANGE_OBJ) -STATUS_OBJ = utils/status.o utils/status_profile.o \ - $(LOCKING_OBJ) $(PARAM_OBJ) \ - smbd/notify_internal.o autoconf/librpc/gen_ndr/ndr_notify.o \ - $(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \ - $(LIBSMB_ERR_OBJ) $(FNAME_UTIL_OBJ) +STATUS_OBJ = utils/status.o utils/status_profile.o $(SMBD_OBJ_BASE) SMBCONTROL_OBJ = utils/smbcontrol.o $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \ @@ -1223,50 +1214,32 @@ NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_help.o \ $(PASSWD_UTIL_OBJ) utils/net_dns.o utils/net_ads_gpo.o \ utils/net_conf.o utils/net_join.o utils/net_user.o \ utils/net_group.o utils/net_file.o utils/net_registry.o utils/net_registry_check.o\ - auth/token_util.o utils/net_dom.o utils/net_share.o utils/net_connections.o\ + utils/net_dom.o utils/net_share.o \ utils/net_g_lock.o \ utils/net_serverid.o \ utils/net_eventlog.o \ utils/net_printing.o \ utils/net_rpc_trust.o \ utils/net_rpc_conf.o\ - $(LIBNDR_NTPRINTING_OBJ) \ $(LIBNDR_PREG_OBJ) \ - $(LIBCLI_SPOOLSS_OBJ) \ - $(LIBCLI_WINREG_OBJ) \ $(LIBCLI_DRSUAPI_OBJ) \ $(LIBCLI_INITSHUTDOWN_OBJ) \ $(LIBCLI_DSSETUP_OBJ) \ $(LIBCLI_SVCCTL_OBJ) \ $(LIBCLI_WKSSVC_OBJ) \ - $(LIBCLI_SRVSVC_OBJ) \ - $(LIBCLI_LSA_OBJ) \ - $(LIBCLI_SAMR_OBJ) \ - $(RPC_CLIENT_SCHANNEL_OBJ) \ - rpc_client/init_samr.o \ registry/reg_parse.o registry/reg_format.o \ - registry/reg_import.o \ - printing/nt_printing_migrate.o + registry/reg_import.o # these are not processed by make proto NET_OBJ2 = utils/net_registry_util.o utils/net_help_common.o NET_OBJ = $(NET_OBJ1) \ - $(NET_OBJ2) @FAKE_KASERVER_OBJ@\ - $(PARAM_WITHOUT_REG_OBJ) $(LIBSMB_OBJ) \ - $(PASSDB_OBJ) $(GROUPDB_OBJ) \ - $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(LIBADDNS_OBJ0) \ - $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) \ - $(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) $(LIBADS_PRINTER_OBJ) $(POPT_LIB_OBJ) \ - $(SMBLDAP_OBJ) $(DCUTIL_OBJ) \ - $(AFS_OBJ) $(AFS_SETTOKEN_OBJ) $(READLINE_OBJ) \ - $(LIBGPO_OBJ) @BUILD_INIPARSER@ $(DISPLAY_SEC_OBJ) \ - $(REG_SMBCONF_OBJ) \ - $(LIBNET_OBJ) $(LIBNET_DSSYNC_OBJ) $(LIBNET_SAMSYNC_OBJ) \ - $(LIBSMBCONF_OBJ) \ - $(REGFIO_OBJ) \ - $(PRIVILEGES_BASIC_OBJ) \ - $(LIB_EVENTLOG_OBJ) + $(NET_OBJ2) \ + $(LIBADDNS_OBJ0) \ + $(READLINE_OBJ) \ + $(LIBGPO_OBJ) $(INIPARSER_OBJ) $(DISPLAY_SEC_OBJ) \ + $(LIBNET_DSSYNC_OBJ) $(LIBNET_SAMSYNC_OBJ) \ + $(SMBD_OBJ_BASE) CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) \ $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) $(POPT_LIB_OBJ) \ @@ -1896,11 +1869,13 @@ bin/nmbd: $(BINARY_PREREQS) $(NMBD_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LI $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(POPT_LIBS) \ $(KRB5LIBS) $(LDAP_LIBS) $(ZLIB_LIBS) -bin/swat: $(BINARY_PREREQS) $(SWAT_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) +bin/swat: $(BINARY_PREREQS) $(SWAT_OBJ) $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) @BUILD_POPT@ @echo Linking $@ - @$(CC) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINT_LIBS) \ - $(AUTH_LIBS) $(LIBS) $(PASSDB_LIBS) $(POPT_LIBS) $(KRB5LIBS) \ - $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(LIBWBCLIENT_LIBS) $(ZLIB_LIBS) + @$(CC) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(LDAP_LIBS) @SMBD_FAM_LIBS@ \ + $(KRB5LIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \ + $(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) $(DNSSD_LIBS) $(AVAHI_LIBS) \ + $(POPT_LIBS) @SMBD_LIBS@ $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \ + $(LIBWBCLIENT_LIBS) $(ZLIB_LIBS) bin/rpcclient: $(BINARY_PREREQS) $(RPCCLIENT_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) @echo Linking $@ @@ -1918,11 +1893,11 @@ bin/smbclient: $(BINARY_PREREQS) $(CLIENT_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTD bin/net: $(BINARY_PREREQS) $(NET_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) $(LIBNETAPI) @echo Linking $@ - @$(CC) -o $@ $(NET_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \ - $(POPT_LIBS) $(KRB5LIBS) $(LDAP_LIBS) \ - $(PASSDB_LIBS) $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) \ - $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(LIBWBCLIENT_LIBS) $(LIBNETAPI_LIBS) \ - $(ZLIB_LIBS) + @$(CC) -o $@ $(NET_OBJ) $(LDFLAGS) $(LDAP_LIBS) @SMBD_FAM_LIBS@ \ + $(KRB5LIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \ + $(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) $(DNSSD_LIBS) $(AVAHI_LIBS) \ + $(POPT_LIBS) @SMBD_LIBS@ $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \ + $(LIBWBCLIENT_LIBS) $(ZLIB_LIBS) $(LIBNETAPI_LIBS) $(TERMLDFLAGS) $(TERMLIBS) bin/profiles: $(BINARY_PREREQS) $(PROFILES_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) @echo Linking $@ @@ -1945,10 +1920,13 @@ bin/smbta-util: $(BINARY_PREREQS) $(SMBTA_UTIL_OBJ) @BUILD_POPT@ $(LIBTALLOC) $( @$(CC) -o $@ $(SMBTA_UTIL_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \ $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) -bin/smbstatus: $(BINARY_PREREQS) $(STATUS_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) +bin/smbstatus: $(BINARY_PREREQS) $(STATUS_OBJ) $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) @BUILD_POPT@ @echo Linking $@ - @$(CC) -o $@ $(STATUS_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \ - $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) + @$(CC) -o $@ $(STATUS_OBJ) $(LDFLAGS) $(LDAP_LIBS) @SMBD_FAM_LIBS@ \ + $(KRB5LIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \ + $(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) $(DNSSD_LIBS) $(AVAHI_LIBS) \ + $(POPT_LIBS) @SMBD_LIBS@ $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \ + $(LIBWBCLIENT_LIBS) $(ZLIB_LIBS) bin/smbcontrol: $(BINARY_PREREQS) $(SMBCONTROL_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) @echo Linking $@ diff --git a/source3/auth/pampass.c b/source3/auth/pampass.c index 427c22a..bde7c22 100644 --- a/source3/auth/pampass.c +++ b/source3/auth/pampass.c @@ -720,7 +720,7 @@ static bool smb_pam_chauthtok(pam_handle_t *pamh, const char * user) * PAM Externally accessible Session handler */ -bool smb_pam_claim_session(char *user, char *tty, char *rhost) +bool smb_pam_claim_session(const char *user, const char *tty, const char *rhost) { pam_handle_t *pamh = NULL; struct pam_conv *pconv = NULL; @@ -748,7 +748,7 @@ bool smb_pam_claim_session(char *user, char *tty, char *rhost) * PAM Externally accessible Session handler */ -bool smb_pam_close_session(char *user, char *tty, char *rhost) +bool smb_pam_close_session(const char *user, const char *tty, const char *rhost) { pam_handle_t *pamh = NULL; struct pam_conv *pconv = NULL; @@ -880,13 +880,13 @@ NTSTATUS smb_pam_accountcheck(const char *user, const char *rhost) } /* If PAM not used, also no PAM restrictions on sessions. */ -bool smb_pam_claim_session(char *user, char *tty, char *rhost) +bool smb_pam_claim_session(const char *user, const char *tty, const char *rhost) { return True; } /* If PAM not used, also no PAM restrictions on sessions. */ -bool smb_pam_close_session(char *in_user, char *tty, char *rhost) +bool smb_pam_close_session(const char *in_user, const char *tty, const char *rhost) { return True; } diff --git a/source3/auth/proto.h b/source3/auth/proto.h index 5b229f9..98b48df 100644 --- a/source3/auth/proto.h +++ b/source3/auth/proto.h @@ -304,15 +304,13 @@ NTSTATUS auth_wbc_init(void); /* The following definitions come from auth/pampass.c */ -bool smb_pam_claim_session(char *user, char *tty, char *rhost); -bool smb_pam_close_session(char *user, char *tty, char *rhost); +bool smb_pam_claim_session(const char *user, const char *tty, const char *rhost); +bool smb_pam_close_session(const char *user, const char *tty, const char *rhost); NTSTATUS smb_pam_accountcheck(const char *user, const char *rhost); NTSTATUS smb_pam_passcheck(const char * user, const char * rhost, const char * password); bool smb_pam_passchange(const char *user, const char *rhost, const char *oldpassword, const char *newpassword); -bool smb_pam_claim_session(char *user, char *tty, char *rhost); -bool smb_pam_close_session(char *in_user, char *tty, char *rhost); /* The following definitions come from auth/pass_check.c */ diff --git a/source3/configure.in b/source3/configure.in index ab54227..fb00fee 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -2218,25 +2218,6 @@ if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then AC_DEFINE(HAVE_UT_UT_EXIT,1,[Whether the utmp struct has a property ut_exit]) fi -dnl Look for the IPv6 varient by preference. Many systems have both. -AC_CACHE_CHECK([for ut_addr_v6 in utmp],samba_cv_HAVE_UT_UT_ADDR_V6,[ -AC_TRY_COMPILE([#include <sys/types.h> -#include <utmp.h>], -[struct utmp ut; ut.ut_addr_v6[0] = 0;], -samba_cv_HAVE_UT_UT_ADDR_V6=yes,samba_cv_HAVE_UT_UT_ADDR_V6=no,samba_cv_HAVE_UT_UT_ADDR_V6=cross)]) -if test x"$samba_cv_HAVE_UT_UT_ADDR_V6" = x"yes"; then - AC_DEFINE(HAVE_UT_UT_ADDR_V6,1,[Whether the utmp struct has a property ut_addr_v6]) -fi - -AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[ -AC_TRY_COMPILE([#include <sys/types.h> -#include <utmp.h>], -[struct utmp ut; ut.ut_addr = 0;], -samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)]) -if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then - AC_DEFINE(HAVE_UT_UT_ADDR,1,[Whether the utmp struct has a property ut_addr]) -fi - if test x$ac_cv_func_pututline = xyes ; then AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[ AC_TRY_COMPILE([#include <sys/types.h> @@ -2257,6 +2238,19 @@ if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then AC_DEFINE(HAVE_UX_UT_SYSLEN,1,[Whether the utmpx struct has a property ut_syslen]) fi +AC_CACHE_CHECK([whether sizeof ut_line in utmp is ok],samba_cv_HAVE_UX_UT_LINE,[ +AC_TRY_RUN([#include <stdio.h> +#include <sys/types.h> +#include <utmp.h> +int main(void) { + if (sizeof(((struct utmp *)NULL)->ut_line) < 15) { + return 1; + } + return 0; +} +], +samba_cv_HAVE_UX_UT_LINE=yes,samba_cv_HAVE_UX_UT_LINE=no,samba_cv_HAVE_UX_UT_LINE=cross)]) + fi # end utmp details @@ -4722,6 +4716,11 @@ if test x"$WITH_UTMP" = x"yes" -a x"$ac_cv_header_utmp_h" = x"no"; then WITH_UTMP=no fi +if test x"$WITH_UTMP" = x"yes" -a x"$samba_cv_HAVE_UX_UT_LINE" != x"yes"; then + utmp_no_reason=", sizeof ut_line not ok" + WITH_UTMP=no +fi + # Display test results if test x"$WITH_UTMP" = x"yes"; then diff --git a/source3/include/local.h b/source3/include/local.h index 02e6b43..a87ab8f 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -154,26 +154,6 @@ /* Minimum length of allowed password when changing UNIX password. */ #define MINPASSWDLENGTH 5 -/* maximum ID number used for session control. This cannot be larger - than 62*62 for the current code */ -#define MAX_SESSION_ID 3000 - -/* For the benifit of PAM and the 'session exec' scripts, we fake up a terminal - name. This can be in one of two forms: The first for systems not using - utmp (and therefore not constrained as to length or the need for a number - < 3000 or so) and the second for systems with this 'well behaved terminal - like name' constraint. -*/ - -#ifndef SESSION_TEMPLATE -/* Paramaters are 'pid' and 'vuid' */ -#define SESSION_TEMPLATE "smb/%lu/%llu" -#endif - -#ifndef SESSION_UTMP_TEMPLATE -#define SESSION_UTMP_TEMPLATE "smb/%d" -#endif - /* the maximum age in seconds of a password. Should be a lp_ parameter */ #define MAX_PASSWORD_AGE (21*24*60*60) diff --git a/source3/include/proto.h b/source3/include/proto.h index ac3d205..7c5a5a7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1509,12 +1509,6 @@ void server_messaging_context_free(void); /* The following definitions come from lib/sessionid_tdb.c */ struct sessionid; -bool sessionid_init(void); -struct db_record *sessionid_fetch_record(TALLOC_CTX *mem_ctx, const char *key); -NTSTATUS sessionid_traverse(int (*fn)(struct db_record *rec, const char *key, - struct sessionid *session, - void *private_data), - void *private_data); NTSTATUS sessionid_traverse_read(int (*fn)(const char *key, struct sessionid *session, void *private_data), diff --git a/source3/lib/conn_tdb.c b/source3/lib/conn_tdb.c index fb605e1..a7e7cf0 100644 --- a/source3/lib/conn_tdb.c +++ b/source3/lib/conn_tdb.c @@ -22,166 +22,93 @@ #include "smbd/globals.h" #include "dbwrap/dbwrap.h" #include "dbwrap/dbwrap_open.h" +#include "dbwrap/dbwrap_rbt.h" #include "messages.h" #include "lib/conn_tdb.h" +#include "util_tdb.h" -static struct db_context *connections_db_ctx(bool rw) -{ - static struct db_context *db_ctx; - int open_flags; - - if (db_ctx != NULL) { - return db_ctx; - } - - open_flags = rw ? (O_RDWR|O_CREAT) : O_RDONLY; - - db_ctx = db_open(NULL, lock_path("connections.tdb"), 0, - TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH|TDB_DEFAULT, - open_flags, 0644, DBWRAP_LOCK_ORDER_1); - return db_ctx; -} - -static struct db_record *connections_fetch_record(TALLOC_CTX *mem_ctx, - TDB_DATA key) -{ - struct db_context *ctx = connections_db_ctx(True); - - if (ctx == NULL) { - return NULL; - } - - return dbwrap_fetch_locked(ctx, mem_ctx, key); -} - -struct db_record *connections_fetch_entry_ext(TALLOC_CTX *mem_ctx, - struct server_id id, - int cnum, - const char *name) -{ - struct connections_key ckey; - TDB_DATA key; - - ZERO_STRUCT(ckey); - ckey.pid = id; - ckey.cnum = cnum; - strlcpy(ckey.name, name, sizeof(ckey.name)); - - key.dsize = sizeof(ckey); - key.dptr = (uint8 *)&ckey; - - return connections_fetch_record(mem_ctx, key); -} - -struct db_record *connections_fetch_entry(TALLOC_CTX *mem_ctx, - connection_struct *conn, - const char *name) -{ - struct server_id id = messaging_server_id(conn->sconn->msg_ctx); - return connections_fetch_entry_ext(mem_ctx, id, conn->cnum, name); -} - - -struct conn_traverse_state { - int (*fn)(struct db_record *rec, -- Samba Shared Repository