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

621 Commits

Author SHA1 Message Date
Jeremy Allison
2922fdaaf0 Move source4/smbd/pidfile into lib/util in preparation for making it in common. 2012-07-19 15:41:52 -07:00
Rusty Russell
f80e399ab2 source4/smbd/pidfile: don't panic if pid file is corrupt.
In particular, on a virtual machine after a forced reboot, it
contained "Ille" instead of a valid PID.  Given it was the right
length, I'm assuming it was filesystem corruption.

process_exists_by_pid() then panics, when given a pid < 1.

Reported-by: lostogre on #samba-technical
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Thu Jun 28 05:19:24 CEST 2012 on sn-devel-104
2012-06-28 05:19:24 +02:00
Andrew Bartlett
b8815dc23d lib/param: Create a seperate server role for "active directory domain controller"
This will allow us to detect from the smb.conf if this is a Samba4 AD
DC which will allow smarter handling of (for example) accidentially
starting smbd rather than samba.

To cope with upgrades from existing Samba4 installs, 'domain
controller' is a synonym of 'active directory domain controller' and
new parameters 'classic primary domain controller' and 'classic backup
domain controller' are added.

Andrew Bartlett
2012-06-15 09:18:33 +02:00
Michael Adam
25216d7537 s4:smbd: fix typos
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Jun 12 09:21:15 CEST 2012 on sn-devel-104
2012-06-12 09:21:14 +02:00
Alexander Bokovoy
eaf9b86d60 Revert "waf-mitkrb5: enable dcerpc_server library to support OpenChange client code"
This reverts commit f8c447b1a4.

After discussing with Julien (Openchange) and Metze, I decided to revert this code.
Instead I made a patch to Openchange which allows to build client side only.

Openchange server code requires working s4 member DC and --without-ad-dc build
does not provide working provisioning even if we enable dcerpc_server and end point mapper.

Autobuild-User: Alexander Bokovoy <ab@samba.org>
Autobuild-Date: Fri Jun  1 16:46:08 CEST 2012 on sn-devel-104
2012-06-01 16:46:07 +02:00
Alexander Bokovoy
f8c447b1a4 waf-mitkrb5: enable dcerpc_server library to support OpenChange client code
Signed-off-by: Andreas Schneider <asn@samba.org>
2012-06-01 09:29:47 +02:00
Alexander Bokovoy
2ddf89a2bc Introduce system MIT krb5 build with --with-system-mitkrb5 option.
System MIT krb5 build also enabled by specifying --without-ad-dc

When --with-system-mitkrb5 (or --withou-ad-dc) option is passed to top level
configure in WAF build we are trying to detect and use system-wide MIT krb5
libraries. As result, Samba 4 DC functionality will be disabled due to the fact
that it is currently impossible to implement embedded KDC server with MIT krb5.

Thus, --with-system-mitkrb5/--without-ad-dc build will only produce
  * Samba 4 client libraries and their Python bindings
  * Samba 3 server (smbd, nmbd, winbindd from source3/)
  * Samba 3 client libraries

In addition, Samba 4 DC server-specific tests will not be compiled into smbtorture.
This in particular affects spoolss_win, spoolss_notify, and remote_pac rpc tests.
2012-05-23 17:51:50 +03:00
Jelmer Vernooij
58b205d486 samba.8: Fix typo: deamon -> daemon. 2012-03-13 13:07:04 +01:00
Andrew Bartlett
cdfc49cc6a s4-smbd: Show time event was expected to run, as well as the current wall clock time 2012-02-20 10:50:48 +11:00
Stefan Metzmacher
d5e4f9a085 s4: Happy New Year 2012
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Jan  1 22:23:48 CET 2012 on sn-devel-104
2012-01-01 22:23:48 +01:00
Volker Lendecke
79fe4bbf73 s3: Fix the clustering build
ctdb_private.h already defines set_close_on_exec.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Dec 17 18:41:39 CET 2011 on sn-devel-104
2011-12-17 18:41:39 +01:00
Andrew Tridgell
fae42c1f41 pidfile: use set_close_on_exec()
this prevents a fd leak to child processes
2011-12-15 23:36:22 +01:00
Jelmer Vernooij
05bc4de083 Revert making public of the samba-module library.
This library was tiny - containing just two public functions than were
themselves trivial. The amount of overhead this causes isn't really worth the
benefits of sharing the code with other projects like OpenChange. In addition, this code
isn't really generically useful anyway, as it can only load from the module path
set for Samba at configure time.

Adding a new library was breaking the API/ABI anyway, so OpenChange had to be
updated to cope with the new situation one way or another. I've added a simpler
(compatible) routine for loading modules to OpenChange, which is less than 100 lines of code.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Dec  3 08:36:33 CET 2011 on sn-devel-104
2011-12-03 08:36:30 +01:00
Andrew Bartlett
7f8f7159af lib/util Rename samba_modules_load -> samba_module_init_fns_for_subsystem
This is to provide a cleaner namespace in the public samba plugin
functions.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
0ce09fcf7a lib/util Rename samba_init_module_fns_run -> samba_module_init_fns_run
This is to provide a cleaner namespace in the public samba plugin
functions.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
1b7cc4ac7c lib/util Rename samba_init_module_fn -> samba_module_init_fn
This is to provide a cleaner namespace in the public samba plugin
functions.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
87354c9a6d lib/util Split samba-modules library into public and private parts
This will allow OpenChange to get at the symbols it needs, without
exposing any more of this as a public API than we must.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
b7b798e15b lib/util Rename load_samba_modules -> samba_modules_load
This is to provide a cleaner namespace in the public samba plugin
functions.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
ce0ccc2a2e lib/util Rename run_init_functions -> samba_init_module_fns_run
This is to provide a cleaner namespace in the public samba plugin
functions.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
1935b7b6c2 lib/util Rename init_module_fn to samba_init_module_fn
This prepares for making the samba_module.h header public again, for OpenChange.

I am keen to avoid too much API namespace pollution if we can.
2011-10-28 13:10:28 +02:00
Andrew Bartlett
3cdb1fe440 s4-messaging: Pass the loadparm context, not just the messaging path
This will allow the TDB layer to get at the lp_ctx for tdb options.

Andrew Bartlett
2011-10-13 14:06:07 +02:00
Andrew Bartlett
5603dab647 libcli/auth: Provide a struct loadparm_context to schannel calls
This will allow us to pass this down to the tdb_wrap layer.

Andrew Bartlett
2011-10-13 14:06:07 +02:00
Andrew Bartlett
7d33ec3dfe lib/util: consolidate module loading into common code
This creates a samba-modules private libary that handles the details.

Andrew Bartlett
2011-10-06 07:18:07 +02:00
Jelmer Vernooij
292fe74971 credentials: Rename library to samba-credentials to avoid name clashes.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu Aug 18 22:16:38 CEST 2011 on sn-devel-104
2011-08-18 22:16:38 +02:00
Simo Sorce
edc32665d0 s4:smbd: use tevent_ fn names instead of leagcy event_ ones 2011-08-13 09:54:16 -04:00
Andrew Tridgell
2d21fe079f s4-messaging: fixed the removal of messaging sockets in child tasks
when a child task exits we were firing a destructor on any inherited
messaging contexts, which could trigger a removal of the parents
message socket and messaging database entry.

This adds a new auto_remove flag to imessaging_init(), and exposes the
cleanup code for use by the stream service.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Jul 22 08:09:06 CEST 2011 on sn-devel-104
2011-07-22 08:09:06 +02:00
Stefan Metzmacher
c0eb56d159 s4:param: add "state dir" and "cache dir" options
metze
2011-07-12 14:58:34 +02:00
Andrew Bartlett
a1f04e8abc libcli/util Rename common map_nt_error_from_unix to avoid duplicate symbol
The two error tables need to be combined, but for now seperate the names.

(As the common parts of the tree now use the _common function,
errmap_unix.c must be included in the s3 autoconf build).

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Jun 20 08:12:03 CEST 2011 on sn-devel-104
2011-06-20 08:12:03 +02:00
Andrew Bartlett
16b1c77644 lib/util Bring procid_str() into lib/util as server_id_string()
This is needed for OpenChange, which prints Samba struct server_id
values in debug messages.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
d057116cc2 server_id.idl: Bring server_id.idl in common
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-09 12:40:08 +02:00
Matthias Dieter Wallnöfer
d6fe38b99d s4:smbd/server.c - quiet "time_t" format string warnings by casts
Reviewed-by: Tridge
2011-06-09 09:35:22 +02:00
Björn Jacke
81e48dfa35 s4/server: simplify and replace bad portable gettimeofday by time
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Björn Jacke <bj@sernet.de>
Autobuild-Date: Mon Jun  6 12:58:26 CEST 2011 on sn-devel-104
2011-06-06 12:58:26 +02:00
Andrew Bartlett
907cdb5de7 s4-modules Remove lp_ctx from init functions that no longer need it
Now that we don't allow the smb.conf to change the modules dir, many
functions that simply load modules or initialise a subsytem that may
load modules no longer need an lp_ctx.

Andrew Bartlett
2011-06-06 17:37:51 +10:00
Andrew Tridgell
0b11061b05 s4-ipv6: fixed binding to ipv4 addresses 2011-06-06 12:26:10 +10:00
Andrew Tridgell
d510687408 s4-ipv6: fixed stream_setup_socket() to handle IPv6
for IP we now detect the address family from the address, rather than
requiring the caller to specify it.
2011-06-06 12:26:09 +10:00
Andrew Bartlett
aae9353ecf ncalrpc: Force ncalrpc dir to be mode 755 in all users
This allows this directory to be shared between Samba3 and Samba4 in a
Franky-style setup easily.

Andrew Bartlett
2011-05-08 19:00:29 +02:00
Andrew Bartlett
f946668b7a Improve debug messages when creating socket directories
This makes clear what the permissions error and directory name actually is

Andrew Bartlett
2011-05-08 10:56:28 +02:00
Günther Deschner
fa8490aa4c s4-smbd: fix randseed_init() usage.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri May  6 17:37:11 CEST 2011 on sn-devel-104
2011-05-06 17:37:11 +02:00
Andrew Bartlett
56a5b7d09e s4-param Rename secrets_init() -> randseed_init()
This only sets up the random number generator callback these days, so
use a different database for that.

(All secrets data in Samba4 is in secrets.ldb)

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
cdd802af83 s4-messaging Rename messaging -> imessaging
This avoid symbol and structure conflicts between Samba3 and Samba4,
and chooses a less generic name.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Tridgell
5adf85e6af tstream: make npa_tstream a private library
this prevents symbol duplication of the npa_tstream symbols

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-04-06 08:12:19 +02:00
Jelmer Vernooij
c104e4ca54 source4/smbd: Fix prototypes for all functions. 2011-03-19 03:20:04 +01:00
Andrew Tridgell
8dbe665a0c build: moved schannel_sign.c into a shared COMMON_SCHANNEL subsystem
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-24 11:57:48 +11:00
Andrew Tridgell
bed374215f s4-idl: rename s4 server_id.idl to server_id4.idl
this avoids a conflict with the new s3 server_id.idl

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-18 18:41:00 +11:00
Andrew Bartlett
d66150c14d libcli/named_pipe_auth Change from 'info3' to auth_session_info_transport
This changes the structure being used to convey the current user state
from the netlogon-derived 'netr_SamInfo3' structure to a purpose-built
structure that matches the internals of the Samba auth subsystem and
contains the final group list, as well as the final privilege set and
session key.

These previously had to be re-created on the server side of the pipe
each time.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-02-10 06:51:06 +01:00
Andrew Bartlett
a2ce53c1f5 s4-auth Rework auth subsystem to remove struct auth_serversupplied_info
This changes auth_serversupplied_info into the IDL-defined struct
auth_user_info_dc.  This then in turn contains a struct
auth_user_info, which is the only part of the structure that is
mainted into the struct session_info.

The idea here is to avoid keeping the incomplete results of the
authentication (such as session keys, lists of SID memberships etc) in
a namespace where it may be confused for the finalised results.

Andrew Barltett
2011-02-09 01:11:06 +01:00
Andrew Tridgell
1867a6033c s4-charset: use dyn_CODEPAGEDIR for location of upcase.dat/lowcase.dat
this matches samba3 behaviour

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-07 13:22:02 +11:00
Andrew Bartlett
fbe6d155bf s4-auth Remove special case for account_sid from auth_serversupplied_info
This makes everything reference a server_info->sids list, which is now
a struct dom_sid *, not a struct dom_sid **.  This is in keeping with
the other sid lists in the security_token etc.

In the process, I also tidy up the talloc tree (move more structures
under their logical parents) and check for some possible overflows in
situations with a pathological number of sids.

Andrew Bartlett
2011-01-20 23:44:05 +01:00
Stefan Metzmacher
4d5c0c3ec5 s4: Happy New Year 2011
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Jan  2 18:42:12 CET 2011 on sn-devel-104
2011-01-02 18:42:12 +01:00
Andrew Bartlett
94a59b781c s4-auth Remove event context from privilage database handling
These local TDB operations can quite safely be handled in a new/nested
event context, rather than using the main event context.

Andrew Bartlett
2010-12-21 15:10:38 +11:00
Matthias Dieter Wallnöfer
faa7ae47d6 s4:smbd/process*.c - fix PID warnings on Solaris
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sun Dec 12 13:21:13 CET 2010 on sn-devel-104
2010-12-12 13:21:13 +01:00
Matthias Dieter Wallnöfer
c8aa7d5837 s4:param/secrets.h - fix "enum netr_SchannelType" include correctly 2010-11-27 21:50:41 +01:00
Matthieu Patou
6a781b5286 Add timestamp when running with --maximum-runtime
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Sat Nov 27 11:51:12 CET 2010 on sn-devel-104
2010-11-27 11:51:12 +01:00
Jelmer Vernooij
f91b7b5dab nbtd: Build service as shared module. 2010-11-15 11:43:05 +00:00
Andrew Tridgell
ef7f4a1420 s4-server: make server sockets a child of the task context
We previously allocated sockets as direct children of the event
context. That led to crashes if a service called
task_server_terminate(), as it left the socket open and handling
events for a dead protocol.

Making them a child of the task allows the task to terminate and take
all its sockets with it.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-11-15 10:19:34 +11:00
Jelmer Vernooij
4217734a51 credentials: Lowercase library name,
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Nov  7 01:48:44 UTC 2010 on sn-devel-104
2010-11-07 01:48:44 +00:00
Jelmer Vernooij
e28cec7817 ldbsamba: Lowercase library name. 2010-11-07 01:57:34 +01:00
Andrew Tridgell
a12c3305b3 s4-server: cleanup allocation of process models
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Nov  3 10:40:52 UTC 2010 on sn-devel-104
2010-11-03 10:40:52 +00:00
Andrew Bartlett
a26d9194ff s4-process_model Fix valgrind-found use of un-initialised variable
The relloc didn't zero the structure for the new process modal, and so
m->initialised wasn't initialised.

Andrew Bartlett
2010-11-02 22:00:54 +11:00
Andrew Tridgell
28c1e4d3eb s4-modules: get rid of the remaining static prototypes for modules
the waf build now generates the prototype declarations for us
2010-11-01 18:55:19 +11:00
Andrew Tridgell
b887b69151 s4-process_model: use the static module prototyping
remove the manual prototyping of static init functions
2010-11-01 18:55:19 +11:00
Jelmer Vernooij
3deece5591 s4: Remove the old perl/m4/make/mk-based build system.
The new waf-based build system now has all the same functionality, and
the old build system has been broken for quite some time.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Oct 31 02:01:44 UTC 2010 on sn-devel-104
2010-10-31 02:01:44 +00:00
Andrew Tridgell
b4ba669e48 s4-smbd: initialise process models in smbtorture before use
the spoolss notify test needs to setup the process models before use

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Sat Oct 30 13:32:09 UTC 2010 on sn-devel-104
2010-10-30 13:32:09 +00:00
Andrew Tridgell
35d466e66b s4-smbd: leave the single process model as internal
This helps with the static smbtorture for samba3, and the spoolss
tests which start a server
2010-10-30 23:49:02 +11:00
Andrew Tridgell
87b3d384c6 s4-cluster: make cluster a private shared lib 2010-10-30 23:49:01 +11:00
Andrew Tridgell
a57e0ae703 s4-smbd: make our process models into real modules
this simplifies some of the dependencies between bin/samba and the
various services, making it easier to get a clean depenency tree

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-30 23:49:00 +11:00
Andrew Tridgell
046d38faa5 s4-smbd: don't initialise process models more than once
this also removes the event_context parameter from process model
initialisation. It isn't needed, and is confusing when a process model
init can be called from more than one place, possibly with different
event contexts.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-30 23:49:00 +11:00
Jelmer Vernooij
8cf61377aa waf: Remove lib prefix from libraries manually. 2010-10-26 10:17:17 -07:00
Jelmer Vernooij
d9cbcdd410 s4: Drop duplicate 'lib' prefix for private libraries. 2010-10-26 10:17:16 -07:00
Jelmer Vernooij
833480d3ad s4: Rename LIBSAMBA-* to libsamba-* 2010-10-24 00:20:04 +00:00
Jelmer Vernooij
cf26d8a958 s4: Rename LIBEVENTS to libevents. 2010-10-23 22:24:06 +00:00
Kai Blin
96195b2c0c s4 dns: Add a boilerplate DNS server implementation 2010-10-23 10:17:05 +00:00
Andrew Tridgell
2dcb596e83 s4-waf: removed dependencies on missing subsystems
these were left over from the old config.mk system
2010-10-21 19:03:24 +11:00
Andrew Tridgell
c41bb6e846 s4: show samba version in bin/samba -b
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Oct 14 02:24:47 UTC 2010 on sn-devel-104
2010-10-14 02:24:47 +00:00
Andrew Bartlett
5742f5115c libcli/security Use common security.h
This includes dom_sid.h and security_token.h and will be moved
to the top level shortly.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 03:35:36 UTC 2010 on sn-devel-104
2010-10-12 03:35:36 +00:00
Andrew Bartlett
bae09a0921 s4-smbd Remove event_context_set_default()
The last callers to event_context_find() have been removed
so this is no longer required.

Andrew Bartlett
2010-10-11 13:02:16 +00:00
Andrew Bartlett
42127cdbb0 s4-credentials Add explicit event context handling to Kerberos calls (only)
By setting the event context to use for this operation (only) onto
the krb5_context just before we call that operation, we can try
and emulate the specification of an event context to the actual send_to_kdc()

This eliminates the specification of an event context to many other
cli_credentials calls, and the last use of event_context_find()

Special care is taken to restore the event context in the event of
nesting in the send_to_kdc function.

Andrew Bartlett
2010-10-11 13:02:16 +00:00
Jelmer Vernooij
d74e0adb30 credentials: Split up into several subsystems. 2010-10-11 02:06:03 +00:00
Jelmer Vernooij
53db1f3467 server: Add missing dependency on schannel database. 2010-10-10 23:54:04 +00:00
Jelmer Vernooij
ffb6766423 service: Add missing dependency on process_model. 2010-10-10 23:54:04 +00:00
Jelmer Vernooij
ffd7cee150 torture: Link against rpc server itself, not service module. (against which we can't link). 2010-10-11 01:06:36 +02:00
Jelmer Vernooij
c1884f31ea ldb-samba: Add ldb_wrap_add, remove last schema reference from ldb_wrap. 2010-10-10 23:25:38 +02:00
Jelmer Vernooij
c15e919a09 wafsamba: Clarify needs_python argument name, use pyembed/pyext where
applicable.

Allow using both pyembed and pyext, to prevent unresolved symbols.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Oct 10 03:54:01 UTC 2010 on sn-devel-104
2010-10-10 03:54:01 +00:00
Jelmer Vernooij
9b18d48d51 heimdal: Fix library name of gssapi. 2010-10-05 00:38:34 +02:00
Andrew Tridgell
87f0145d07 s4-server: exit with status 127 on SIGTERM
this ensures that make test detects a failure if samba is killed by
SIGTERM
2010-10-02 21:11:52 -07:00
Andrew Tridgell
ea223baabc s4-server: check the return of irpc_binding_handle_by_name
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-09-15 15:39:36 +10:00
Andrew Tridgell
cad0219e69 s4-process: fixed the thread process model so it compiles
it doesn't actually work, but at least it now compiles
2010-09-07 12:55:27 +10:00
Stefan Metzmacher
e117177307 s4:smbd/service_task: use irpc_binding_handle_by_name()
metze
2010-09-03 17:00:20 +02:00
Björn Jacke
4b09919f70 s4:process_thread: use monotonic time for time deltas 2010-08-31 10:25:54 +02:00
Jelmer Vernooij
bc69a9d0d8 Avoid use of Samba DTD, which requires net access. 2010-08-22 14:05:58 +02:00
Andrew Tridgell
6b266b85cf s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling
convention to use the lpcfg_ prefix.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-16 18:24:27 +10:00
Andrew Bartlett
58d0b638c8 s4:schannel Open the schannel_store.tdb at startup
This will allow TDB_CLEAR_IF_FIRST behaviour in future

Signed-off-by: Jeremy Allison <jra@samba.org>
2010-06-25 11:57:52 -07:00
Stefan Metzmacher
6dbcffb51d s4:lib: merge LDB_WRAP and LDBSAMBA and make LDBSAMBA a library.
This is needed to remove samba specifc symbols from the bundled
ldb, in order to get the ABI right.

metze

Signed-off-by: Andreas Schneider <asn@samba.org>
2010-06-16 14:07:28 +02:00
Jelmer Vernooij
0d7f8fb73d wafsamba: Fix building of modules as shared libraries. 2010-06-15 13:15:50 +02:00
Matthias Dieter Wallnöfer
a64262697a s4:smbd/pidfile.c - fix "asprintf" calls 2010-05-28 10:04:47 +02:00
Simo Sorce
3c8dc5cd21 s4:smbd: Use tstream_npa_accept_existing to accept named pipe connections
Pair-programmed-with: Stefan Metzmacher <metze@samba.org>
2010-05-26 09:24:05 +02:00
Simo Sorce
2e171239f9 s4:smbd: Add tstream to the stream_connection structure 2010-05-26 09:24:04 +02:00
Andrew Bartlett
9c6b637ce8 s4:auth Change auth_generate_session_info to take flags
This allows us to control what groups should be added in what use
cases, and in particular to more carefully control the introduction of
the 'authenticated' group.

In particular, in the 'service_named_pipe' protocol, we do not have
control over the addition of the authenticated users group, so we key
of 'is this user the anonymous SID'.

This also takes more care to allocate the right length ptoken->sids

Andrew Bartlett
2010-05-20 17:39:10 +10:00
Jelmer Vernooij
f9ca9e46ad Finish removal of iconv_convenience in public API's. 2010-05-18 11:45:30 +02:00
Andrew Bartlett
ad197f6f15 s4:process_model Fix process_standard and process_onefork not to use
multiple event contexts

It is NEVER valid to free an event context that anybody else may have
a reference to, and never normally valid to have two 'live' at once.
We must instead call tevent_re_initialise() to wipe clean an existing
pointer.

Andrew Bartlett
2010-05-14 23:25:45 +10:00
Andrew Bartlett
6f859f58af s4:process_modals Add another process modal - 'onefork'
This will fork off exactly one child to handle some task, ensuring
that if it dies or changes global state, that this does not change
everything.

Andrew Bartlett
2010-05-14 23:25:45 +10:00
Andrew Bartlett
ba4842a880 Revert "s4: remove unused references to swat"
This reverts most of commit 1765732f82.

The s3compat build needs the SWAT location to be compatible with
Samba3.
2010-05-14 23:25:44 +10:00
Stefan Metzmacher
1765732f82 s4: remove unused references to swat
metze
2010-04-29 12:36:47 +02:00
Stefan Metzmacher
ba703cb8e9 s4:service_named_pipe: use the passed client and server addresses
This gives the rpc server code the correct client and server
ip addresses for ncacn_np.

metze
2010-04-27 13:00:25 +02:00
Tim Potter
f25ebe3728 s4-smbd: Fix compiler warning in prefork smbd.
My first patch in a while...

Tim.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-04-24 14:07:40 +02:00
Andrew Tridgell
612a34ad69 s4-server: show build host in samba -b output 2010-04-21 15:35:55 +10:00
Andrew Tridgell
211bf1ea17 s4-waf: removed the unused installdir= option to SAMBA_BINARY()
This was left over from the automatic conversion of the config.mk
files
2010-04-18 21:47:00 +10:00
Andrew Bartlett
589a42e2da s4:auth Change auth_generate_session_info to take an auth context
The auth context was in the past only for NTLM authentication, but we
need a SAM, an event context and and loadparm context for calculating
the local groups too, so re-use that infrustructure we already have in
place.

However, to avoid problems where we may not have an auth_context (in
torture tests, for example), allow a simpler 'session_info' to be
generated, by passing this via an indirection in gensec and an
generate_session_info() function pointer in the struct auth_context.

In the smb_server (for old-style session setups) we need to change the
async context to a new 'struct sesssetup_context'.  This allows us to
use the auth_context in processing the authentication reply .

Andrew Bartlett
2010-04-14 10:30:51 +10:00
Andrew Tridgell
b690fedef5 s4-waf: removed the AUTOGENERATED markers
we won't be using the mk -> wscript generator again
2010-04-06 20:27:16 +10:00
Andrew Tridgell
b0fb567f04 s4-waf: more dependencies on talloc
these are needed so we can support a system talloc without using the
bundled talloc.h
2010-04-06 20:27:13 +10:00
Andrew Tridgell
b9aa63887c s4-waf: cleanup use of LIBPOPT vs popt dependency 2010-04-06 20:27:13 +10:00
Andrew Tridgell
f9eae32f4b s4-waf: mark the wscript files as python so vim/emacs knows how to highlight them 2010-04-06 20:27:11 +10:00
Andrew Tridgell
6f15ea31c2 build: install samba in sbin 2010-04-06 20:26:55 +10:00
Andrew Tridgell
844acb2260 build: waf quicktest nearly works
Rewrote wafsamba using a new dependency handling system, and started
adding the waf test code
2010-04-06 20:26:48 +10:00
Andrew Tridgell
845e0cbe6f build: commit all the waf build files in the tree 2010-04-06 20:26:48 +10:00
Andrew Tridgell
b60da39da6 s4: added a simple implementation of bin/samba -b
this shows the config paths. Useful for debugging --enable-fhs
2010-03-29 21:34:29 +11:00
Andreas Schneider
a6f25fc635 s3-smbd: Don't close stdout if we want to log to stdout. 2010-03-26 14:48:54 +01:00
Andrew Tridgell
789d67c499 s4-smbd: use tevent_re_initialise()
This fixes a crash bug on startup
2010-03-26 21:13:55 +11:00
Stefan Metzmacher
ae049c49df s4:libcli/wrepl: rewrite the low level request handling to use tevent_queue and tstream_context
metze
2010-03-07 17:12:39 +01:00
Andreas Schneider
81bb8f67fa s4-smb: Migrate named_pipe_server to tsocket.
This is an improved version of commit 69d5cea2e5,
which was reverted by commit 71c20f703b.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-26 08:57:31 +01:00
Andrew Tridgell
781ad038c9 s4-krb5: propogate errors from a lot more kerberos functions
We need to be able to give sensible error messages when a kerberos
calls fails. This propogates the kerberos error up the stack to the
caller.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-26 13:59:16 +11:00
Simo Sorce
71c20f703b Revert "s4-smb: Migrate named_pipe_server to tsocket."
This reverts commit 69d5cea2e5.

This commit causes issues with the RPC server, revert it until we find the
exact issue and possibly have a torture test to avoid it happening again.
Found playing with w2k8r2 and forest trusts.
2010-02-24 18:35:47 -05:00
Simo Sorce
1203de99b1 s4:schannel merge code with s3
After looking at the s4 side of the (s)channel :) I found out that it makes
more sense to simply make it use the tdb based code than redo the same changes
done to s3 to simplify the interface.

Ldb is slow, to the point it needs haks to pre-open the db to speed it up, yet
that does not solve the lookup speed, with ldb it is always going to be slower.

Looking through the history it is evident that the schannel database doesn't
really need greate expanadability. And lookups are always done with a single
Key. This seem a perfet fit for tdb while ldb looks unnecessarily complicated.

The schannel database is not really a persistent one. It can be discared during
an upgrade without causing any real issue. all it contains is temproary session
data.
2010-02-23 12:46:50 -05:00
Andreas Schneider
69d5cea2e5 s4-smb: Migrate named_pipe_server to tsocket. 2010-02-23 13:48:21 +01:00
Andreas Schneider
95a0ab5f11 s4-smbd: Remove obsolete singal type cast from the thread process model. 2010-02-23 12:23:44 +01:00
Brad Hards
1e986c1cb3 More spelling fixes across source4/
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:38 +01:00
Matthias Dieter Wallnöfer
eed65ed337 s4:server.c - use always "return" instead of "exit" in the "binary_smbd_main" function
Just to be consistent - no functional change
2010-02-13 18:24:07 +01:00
Andrew Tridgell
f69135e0e9 s4-smbd: fix crash in notify code on client termination
We need to free the lp_ctx after we free the event context, otherwise
the teardown code in the notify backend dies when it tries to use the
iconv_convenience ptr

Fixes bug 7053
2010-02-13 23:12:29 +11:00
Andrew Tridgell
89b6a80e72 s4-dns: added a dns update task
This task watches for changes in the list of DCs, and creates a bind9
formatted file that grants update permission to all DCs, plus to the
administration, and machines update for their own names.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-11 21:04:14 +11:00
Andrew Tridgell
a894eeab77 s4-debug: lower the verbosity of a couple of common log messages 2010-01-09 21:59:34 +11:00
Andrew Tridgell
278d2f75ba s4-smbd: setup the default event contexts for other process models 2010-01-08 13:03:05 +11:00
Andrew Tridgell
dcbba583d9 s4-event: added s4_event_context_set_default()
we're still not weaned off event_context_find()
2010-01-08 13:03:02 +11:00
Stefan Metzmacher
a06e5cdb99 s4: Happy New Year 2010
metze
2010-01-04 08:42:49 +01:00
Stefan Metzmacher
500f55ca92 s4:smbd: hold tsocket_addresses on the stream_connection
metze
2009-12-24 17:38:33 +01:00
Andrew Tridgell
890e7719cf s4-ldb: move the tdb_reopen_all() calls to ldb_wrap.c 2009-10-23 14:52:18 +11:00
Andrew Tridgell
a7cc448dc2 s4-server: call the ldb_wrap_fork_hook() after a fork()
This will be used to allow us to cancel any pending transactions
after a fork.
2009-10-23 14:52:18 +11:00
Andrew Tridgell
33756d6374 s4-server: pre-open the main ldb databases in the server
By pre-opening these databases and leaving them open, we allow the new
ldb_wrap_connect() code to share the ldb context between users.
2009-10-23 14:52:18 +11:00
Matthias Dieter Wallnöfer
dedd32d323 s4:server.c - add linespace (only cosmetic) 2009-09-20 22:17:35 +02:00
Andrew Tridgell
72c60db126 s4-smbd: removed unnecessary includes 2009-09-19 14:11:58 -07:00
Andrew Tridgell
7c807de6b8 s4-smbd: minimise includes in smbd/ and smb_server 2009-09-19 14:11:54 -07:00
Andrew Tridgell
e9a589feac s4-server: kill main daemon if a task fails to initialise
When one of our core tasks fails to initialise it can now ask for the
server as a whole to die, rather than limping along in a degraded
state.
2009-09-18 18:05:55 -07:00
Stefan Metzmacher
bb0644175a s4:service_named_pipe: accept delegated credentials
metze
2009-09-18 20:34:41 +02:00
Andrew Tridgell
61facf4266 s4-kcc: add a very simple KCC
A KCC is a 'Knowledge Consistency Checker', a fancy name for a daemon
that works out who will replicate with who in a AD domain. This
implements an extremely simple KCC task that just wants to replicate
with everyone :-)
2009-09-11 22:13:45 +10:00
Andrew Tridgell
c271dc998b ensure that child tasks die when the parent dies
Previously we relied on process groups and SIGTERM to ensure that
child tasks died in the standard process model when the parent task
died. This doesn't work when the server is run in interactive mode, as
in that case we don't call become_daemon() and don't get a separate
process group.

The fix is to have a pipe held open by the parent server process, and
inherited by child tasks. If the parent exits then the write side of
the pipe is implicitly closed, which causes an event in the child
tasks that causes them to exit
2009-08-07 17:24:48 +10:00
Andrew Tridgell
cfc0cabb27 prime the sam ldb schema in the parent samba process
While testing the use of the standard process model with 'make test' I
found that testing was much slower (by several times) with the
standard model than with the single model. The primary problem was
that each SMB connection would open a new sam ldb context, and all of
those would reload the full AD schema.

The fix is to pre-open the SAM during server startup, before any child
processes are forked. This sets up the global schema context which is
inherited by all connections.

The standard model is still slower at make test than the single model,
but not by nearly as much. I am working on further reducing the gap.
2009-08-07 17:24:48 +10:00
Volker Lendecke
4b3e89c2e7 Fix Coverity 911: FORWARD_NULL. Metze, please check! 2009-05-02 13:14:14 +02:00
Stefan Metzmacher
fe9b552023 s4:smbd: depend on NAMED_PIPE_AUTH_TSTREAM...
metze
2009-05-01 17:42:09 +02:00
Stefan Metzmacher
2ae92c7599 s4:smbd: add support for named_pipe_auth level 2 in service_named_pipe...
metze
2009-05-01 17:42:06 +02:00
Stefan Metzmacher
6ef1442360 s4:smbd: the name of the binary is "samba" now
metze
2009-03-21 10:44:40 +01:00
Steven Danneman
116ce19b10 Moved become_daemon() and close_low_fds() to shared util lib 2009-02-20 16:30:12 -08:00