nivanova/samba-autobuild/.git
8 years agos4-dsdb: fixed calls to ldb_val_string_cmp()
Andrew Tridgell [Mon, 22 Aug 2011 07:26:44 +0000 (17:26 +1000)]
s4-dsdb: fixed calls to ldb_val_string_cmp()

wrong order of arguments

8 years agos4-dsdb: added samdb_dn_to_dns_domain()
Andrew Tridgell [Mon, 22 Aug 2011 07:00:54 +0000 (17:00 +1000)]
s4-dsdb: added samdb_dn_to_dns_domain()

this converts a DC into the equivalent DNS domain. It is used when
forming t_msdcs NTDS DNS names

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

8 years agos4-dsdb: assert that base DNs are used correctly
Andrew Tridgell [Fri, 19 Aug 2011 07:36:22 +0000 (17:36 +1000)]
s4-dsdb: assert that base DNs are used correctly

this will catch future programmer errors with incorrect base DNs

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

8 years agos4-dsdb: enforce NULL DN validity in partition module
Andrew Tridgell [Fri, 19 Aug 2011 07:35:45 +0000 (17:35 +1000)]
s4-dsdb: enforce NULL DN validity in partition module

windows does not allow a search on the empty DN except for rootDSE
searches or for phantom_root searches (ie. with --cross-ncs). By
enforcing this in Samba we make it more likely that our tests and
utilities will work against windows

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

8 years agos4-dsdb: fixed basedn in extended_dn_in module
Andrew Tridgell [Fri, 19 Aug 2011 07:34:12 +0000 (17:34 +1000)]
s4-dsdb: fixed basedn in extended_dn_in module

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

8 years agosamba-tool: fixed use of base DNs in ldapcmp
Andrew Tridgell [Fri, 19 Aug 2011 07:33:06 +0000 (17:33 +1000)]
samba-tool: fixed use of base DNs in ldapcmp

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

8 years agos4-spnupdate: fixed searches on domain NC
Andrew Tridgell [Fri, 19 Aug 2011 07:32:44 +0000 (17:32 +1000)]
s4-spnupdate: fixed searches on domain NC

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

8 years agos4-dns: fixed base search on domain NC
Andrew Tridgell [Fri, 19 Aug 2011 07:32:26 +0000 (17:32 +1000)]
s4-dns: fixed base search on domain NC

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

8 years agos4-samr: fixed subtree search
Andrew Tridgell [Fri, 19 Aug 2011 07:31:43 +0000 (17:31 +1000)]
s4-samr: fixed subtree search

this needs to be on the domain NC

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

8 years agos4-kdc: fixed subtree search in KDC
Andrew Tridgell [Fri, 19 Aug 2011 07:31:13 +0000 (17:31 +1000)]
s4-kdc: fixed subtree search in KDC

use ldb_get_default_basedn() with a subtree search

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

8 years agos4-dsdb: cleanup use of NULL vs base DN in samldb
Andrew Tridgell [Fri, 19 Aug 2011 07:30:28 +0000 (17:30 +1000)]
s4-dsdb: cleanup use of NULL vs base DN in samldb

NULL should be used when doing all partition searches. The default
basedn should be used when wanting just the domain NC

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

8 years agos4-dsdb: removed unused function in ACL module
Andrew Tridgell [Fri, 19 Aug 2011 07:29:13 +0000 (17:29 +1000)]
s4-dsdb: removed unused function in ACL module

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

8 years agos4-dsdb: fixed all partitions search in cracknames
Andrew Tridgell [Fri, 19 Aug 2011 07:28:49 +0000 (17:28 +1000)]
s4-dsdb: fixed all partitions search in cracknames

when searching all partitions we must use the NULL basedn, or we will
miss partitions in multi-domain setups

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

8 years agos4-dns: when searching all partitions the NULL basedn is OK
Andrew Tridgell [Fri, 19 Aug 2011 07:27:55 +0000 (17:27 +1000)]
s4-dns: when searching all partitions the NULL basedn is OK

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

8 years agopdb-samba4: use ldb_get_default_basedn() instead of NULL
Andrew Tridgell [Fri, 19 Aug 2011 07:27:14 +0000 (17:27 +1000)]
pdb-samba4: use ldb_get_default_basedn() instead of NULL

this makes pdb-samba4 safe for multi-domain setups

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

8 years agopyldb: fixed a warning
Andrew Tridgell [Fri, 19 Aug 2011 07:26:33 +0000 (17:26 +1000)]
pyldb: fixed a warning

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

8 years agos3:winbindd fix a return code check
Christian Ambach [Wed, 24 Aug 2011 14:21:37 +0000 (16:21 +0200)]
s3:winbindd fix a return code check

talloc_traverse_dict will return with -1 in case of an error and
might return positive values that indicate the count of found
entries

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Wed Aug 24 18:09:11 CEST 2011 on sn-devel-104

8 years agos3: Fix an uninitialized variable
Volker Lendecke [Tue, 23 Aug 2011 23:02:38 +0000 (01:02 +0200)]
s3: Fix an uninitialized variable

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Aug 24 00:34:04 CEST 2011 on sn-devel-104

8 years agos3: Fix the build on FreeBSD
Volker Lendecke [Tue, 23 Aug 2011 22:36:35 +0000 (00:36 +0200)]
s3: Fix the build on FreeBSD

lsasd.c uses basename(3), which according to susv3
requires libgen.h and without which the FreeBSD build breaks.

8 years agos/event_context/tevent_context/ in smbsock_any_connect
Volker Lendecke [Tue, 23 Aug 2011 14:50:32 +0000 (16:50 +0200)]
s/event_context/tevent_context/ in smbsock_any_connect

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Aug 23 18:21:58 CEST 2011 on sn-devel-104

8 years agos/event_context/tevent_context/ in smbsock_connect
Volker Lendecke [Tue, 23 Aug 2011 14:50:19 +0000 (16:50 +0200)]
s/event_context/tevent_context/ in smbsock_connect

8 years agoscannedonly module: improve sleep behavior when reading a directory with multiple...
Olivier Sessink [Tue, 9 Aug 2011 07:56:38 +0000 (09:56 +0200)]
scannedonly module: improve sleep behavior when reading a directory with multiple non-scanned files

8 years agos3: Slightly simplify serverid_exists
Volker Lendecke [Mon, 22 Aug 2011 08:21:09 +0000 (10:21 +0200)]
s3: Slightly simplify serverid_exists

procid_is_me() works fine in the clustering case as well

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Aug 22 21:28:13 CEST 2011 on sn-devel-104

8 years agos3-net: Added documentation for net_rpc_conf functions
Vicentiu Ciorbaru [Sun, 21 Aug 2011 16:58:01 +0000 (19:58 +0300)]
s3-net: Added documentation for net_rpc_conf functions

Added comments to most functions of net rpc conf for easier
understanding of the code.

Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon Aug 22 17:08:15 CEST 2011 on sn-devel-104

8 years agodocs: Added documentation for net rpc conf.
Vicentiu Ciorbaru [Sun, 21 Aug 2011 14:42:33 +0000 (17:42 +0300)]
docs: Added documentation for net rpc conf.

Changed the manual page for net to also show the posibility
of remote configuration of a Samba server via net rpc conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-test: Added net conf tests to tests.py
Vicentiu Ciorbaru [Wed, 17 Aug 2011 14:58:59 +0000 (17:58 +0300)]
s3-test: Added net conf tests to tests.py

The tests are added as blackbox tests and they can be called with
the wildcard source3.blackbox.net.*.conf with either 'local' or 'rpc'
instead of '*' .

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-test: Added new testsuites for test net [rpc] conf
Vicentiu Ciorbaru [Thu, 11 Aug 2011 09:50:47 +0000 (12:50 +0300)]
s3-test: Added new testsuites for test net [rpc] conf

The script tests all commands present in the net conf tool.
It is also possible to provide a fourth command line parameter
'rpc' in order to run the tests with the use of rpc.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-test: added samba3.blackbox.net.rpc.registry.roundtrip testsuite
Vicentiu Ciorbaru [Wed, 10 Aug 2011 09:05:50 +0000 (12:05 +0300)]
s3-test: added samba3.blackbox.net.rpc.registry.roundtrip testsuite

The testsuite makes use of the rpc mode from the registry roundtrip
script to test net rpc conf / net rpc registry

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-test: Enhanced the net registry roundtrip test script
Vicentiu Ciorbaru [Wed, 10 Aug 2011 08:58:25 +0000 (11:58 +0300)]
s3-test: Enhanced the net registry roundtrip test script

The script now supports an rpc mode, which is triggered by the
presence of a fourth command line parameter "rpc"

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Implemented net rpc conf import command
Vicentiu Ciorbaru [Wed, 3 Aug 2011 20:19:21 +0000 (23:19 +0300)]
s3-net: Implemented net rpc conf import command

The function takes a local file in smb.conf format,
uses calls to smbconf to create smbconf_service structs,
which are then placed in the remote registry.

The function also provides a test module to only print
the changes that it would make.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added net rpc conf import command to net rpc conf
Vicentiu Ciorbaru [Wed, 3 Aug 2011 13:07:46 +0000 (16:07 +0300)]
s3-net: Added net rpc conf import command to net rpc conf

The function only appears in the commands list usage of net rpc
conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Implemented net rpc conf addshare command
Vicentiu Ciorbaru [Wed, 3 Aug 2011 13:01:38 +0000 (16:01 +0300)]
s3-net: Implemented net rpc conf addshare command

The function is mostly a wrapper around a series of setparm
commands. It can be used to quickly set up a share with simple
parameters.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added net rpc conf addshare command to net rpc conf
Vicentiu Ciorbaru [Wed, 3 Aug 2011 12:58:54 +0000 (15:58 +0300)]
s3-net: Added net rpc conf addshare command to net rpc conf

The function only appears in the commands list usage of net rpc
conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Implemented net rpc conf setincludes command
Vicentiu Ciorbaru [Sat, 30 Jul 2011 14:10:19 +0000 (17:10 +0300)]
s3-net: Implemented net rpc conf setincludes command

The function creates the share key if it does not exist.
If the share key was present it deletes the previous includes.
After this the function sets the new includes accordingly.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added net rpc conf setincludes command to net rpc conf
Vicentiu Ciorbaru [Sat, 30 Jul 2011 13:55:43 +0000 (16:55 +0300)]
s3-net: Added net rpc conf setincludes command to net rpc conf

The function only appears in the commands list usage of net rpc
conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Implemented net rpc conf setparm command
Vicentiu Ciorbaru [Sat, 30 Jul 2011 13:53:59 +0000 (16:53 +0300)]
s3-net: Implemented net rpc conf setparm command

The function creates the share key if it does not exist.
If the share key was present it deletes the previous value.
After this the function sets the new value accordingly.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added net rpc conf setparm command to net rpc conf
Vicentiu Ciorbaru [Sat, 30 Jul 2011 13:51:44 +0000 (16:51 +0300)]
s3-net: Added net rpc conf setparm command to net rpc conf

The function only appears in the commands list usage of net rpc
conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Implemented net rpc conf delparm command
Vicentiu Ciorbaru [Tue, 26 Jul 2011 10:48:34 +0000 (13:48 +0300)]
s3-net: Implemented net rpc conf delparm command

The function makes use of existing code from delincludes.
It has the same logic, except it uses the second argument
passed to determine which value to delete from the registry.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added net rpc conf delparm command to net rpc conf
Vicentiu Ciorbaru [Tue, 26 Jul 2011 10:36:23 +0000 (13:36 +0300)]
s3-net: Added net rpc conf delparm command to net rpc conf

The function only appears in the commands list usage of net rpc
conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Refactored part of rpc_conf_delincludes_internal
Vicentiu Ciorbaru [Tue, 26 Jul 2011 10:25:33 +0000 (13:25 +0300)]
s3-net: Refactored part of rpc_conf_delincludes_internal

The function now makes use of rpc_conf_del_value to delete
the includes of a given share.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Created function net_rpc_conf_del_value
Vicentiu Ciorbaru [Tue, 26 Jul 2011 10:24:58 +0000 (13:24 +0300)]
s3-net: Created function net_rpc_conf_del_value

Function is used to refactor some of the code used in
delincludes and also to be used in the other key manipulating
functions.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Implemented net rpc conf delincludes command
Vicentiu Ciorbaru [Tue, 26 Jul 2011 09:44:42 +0000 (12:44 +0300)]
s3-net: Implemented net rpc conf delincludes command

The function openes the key attached to the service passed as a
parameter to the command and it uses dcerpc_winreg_DeleteValue to
delete the includes value if it exists

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added net rpc conf delincludes command to net rpc conf
Vicentiu Ciorbaru [Tue, 26 Jul 2011 07:36:17 +0000 (10:36 +0300)]
s3-net: Added net rpc conf delincludes command to net rpc conf

The function only appears in the commands list usage of net rpc
conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Implemented net rpc conf getincludes command
Vicentiu Ciorbaru [Mon, 25 Jul 2011 22:32:23 +0000 (01:32 +0300)]
s3-net: Implemented net rpc conf getincludes command

The function creates a smconf_service struct that holds the share
passed as the first argument to the command and searches in it for
"include" parameters. If any are found, they are displayed.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added net rpc conf getincludes command to net rpc conf
Vicentiu Ciorbaru [Mon, 25 Jul 2011 22:16:45 +0000 (01:16 +0300)]
s3-net: Added net rpc conf getincludes command to net rpc conf

The function only appears in the commands list usage of net rpc
conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Implemented net rpc conf getparm command
Vicentiu Ciorbaru [Wed, 17 Aug 2011 14:01:30 +0000 (17:01 +0300)]
s3-net: Implemented net rpc conf getparm command

The function creates a smconf_service struct that holds the share
passed as the first argument to the command and searches in it for
the parameter passed as the second argument to the command

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added net rpc conf getparm command to net rpc conf
Vicentiu Ciorbaru [Mon, 25 Jul 2011 15:20:01 +0000 (18:20 +0300)]
s3-net: Added net rpc conf getparm command to net rpc conf

The function only appears in the commands list usage of net rpc conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Implemented net rpc conf delshare command
Vicentiu Ciorbaru [Thu, 21 Jul 2011 21:19:58 +0000 (00:19 +0300)]
s3-net: Implemented net rpc conf delshare command

The function makes use of dcerpc_winreg_delete_subkeys_recursive
to clear the share.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added net rpc conf delshare command to net rpc conf
Vicentiu Ciorbaru [Fri, 15 Jul 2011 16:22:34 +0000 (19:22 +0300)]
s3-net: Added net rpc conf delshare command to net rpc conf

The function only appears in the commands list usage of net rpc conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Implemented net rpc conf drop command
Vicentiu Ciorbaru [Wed, 13 Jul 2011 21:30:06 +0000 (00:30 +0300)]
s3-net: Implemented net rpc conf drop command

The function makes use of dcerpc_winreg_delete_subkeys_recursive
to clear the configuration.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added net rpc conf drop command to net rpc conf
Vicentiu Ciorbaru [Wed, 13 Jul 2011 21:01:15 +0000 (00:01 +0300)]
s3-net: Added net rpc conf drop command to net rpc conf

The function only appears in the commands list usage of net rpc conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Implemented net rpc conf showshare command
Vicentiu Ciorbaru [Wed, 17 Aug 2011 13:42:48 +0000 (16:42 +0300)]
s3-net: Implemented net rpc conf showshare command

The function has the same logic as net rpc conf list, however it
only loads the specific share.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added net rpc conf showshare command to net rpc conf
Vicentiu Ciorbaru [Wed, 13 Jul 2011 20:18:00 +0000 (23:18 +0300)]
s3-net: Added net rpc conf showshare command to net rpc conf

The function only appears in the commands list usage of net rpc conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Implemented net rpc conf listshares command.
Vicentiu Ciorbaru [Wed, 13 Jul 2011 20:04:18 +0000 (23:04 +0300)]
s3-net: Implemented net rpc conf listshares command.

The function prints the names of the remote shares found, one per line.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added net rpc conf listshares command to net rpc conf
Vicentiu Ciorbaru [Wed, 13 Jul 2011 20:01:35 +0000 (23:01 +0300)]
s3-net: Added net rpc conf listshares command to net rpc conf

The function only appears in the commands list usage of net rpc conf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: rpc_conf_list now uses the wrapper rpc_conf_open_conf
Vicentiu Ciorbaru [Wed, 13 Jul 2011 19:57:08 +0000 (22:57 +0300)]
s3-net: rpc_conf_list now uses the wrapper rpc_conf_open_conf

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added rpc_conf_open_conf function
Vicentiu Ciorbaru [Wed, 13 Jul 2011 19:49:59 +0000 (22:49 +0300)]
s3-net: Added rpc_conf_open_conf function

The function is used as a wrapper to open the HKLM hive key and
the smbconf key.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added the net rpc conf list command.
Vicentiu Ciorbaru [Mon, 25 Jul 2011 21:11:15 +0000 (00:11 +0300)]
s3-net: Added the net rpc conf list command.

The command make use of the smbconf_service struct,
via the function rpc_conf_get_share(). This allows for
further expansion with the use of smbconf.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Added the command rpc conf to the net binary.
Vicentiu Ciorbaru [Wed, 13 Jul 2011 18:17:08 +0000 (21:17 +0300)]
s3-net: Added the command rpc conf to the net binary.

The net binary now has an extra item linked to it, the
net_rpc_conf.c module.

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agos3-net: Fixed whitespace errors
Vicentiu Ciorbaru [Sun, 21 Aug 2011 16:37:10 +0000 (19:37 +0300)]
s3-net: Fixed whitespace errors

Fixed previously existing whitespace errors in net_rpc.c

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agoset passdb backend in Samba4 make test environments too
Andrew Bartlett [Mon, 22 Aug 2011 00:05:02 +0000 (10:05 +1000)]
set passdb backend in Samba4 make test environments too

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Aug 22 03:46:21 CEST 2011 on sn-devel-104

8 years agoselftest: skip all plugin_s4_dc tests if we do not have LDAP libs
Andrew Bartlett [Mon, 22 Aug 2011 00:00:25 +0000 (10:00 +1000)]
selftest: skip all plugin_s4_dc tests if we do not have LDAP libs

This is needed as otherwise make test fails on any system without
OpenLDAP libs and headers, which causes our users concern.

Andrew Bartlett

8 years agos4-provision set passdb backend to 'samba4' in template smb.conf files
Andrew Bartlett [Fri, 19 Aug 2011 07:36:57 +0000 (17:36 +1000)]
s4-provision set passdb backend to 'samba4' in template smb.conf files

This will allow smbpasswd, net sam and pdbedit to 'just work' against
the newly created databases.

Andrew Bartlett

8 years agos3-passdb: Only delete 1 entry from memcache.
Andreas Schneider [Sat, 20 Aug 2011 14:19:43 +0000 (16:19 +0200)]
s3-passdb: Only delete 1 entry from memcache.

If we delete or update one user we shouldn't flush the complete
memcache.

Signed-off-by: Simo Sorce <idra@samba.org>
Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Sun Aug 21 16:39:10 CEST 2011 on sn-devel-104

8 years agos3-passdb: Remove always the user from getpwsid cache.
Andreas Schneider [Sat, 20 Aug 2011 12:48:38 +0000 (14:48 +0200)]
s3-passdb: Remove always the user from getpwsid cache.

We should do it always, not only in the pdb_default_delete_user()
function.

Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-passdb: Keep caches coherent
Andreas Schneider [Fri, 19 Aug 2011 15:36:53 +0000 (17:36 +0200)]
s3-passdb: Keep caches coherent

When deleting a user send a message to all interested parties so they can
purge their caches. Otherwise some processes may positively respond with a
cached getpwnam, when the user have actully been removed.

Without this some tests that remove and then immediately create users are
flakey.

Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-id_cache: Use better names for id cache management ops
Andreas Schneider [Fri, 19 Aug 2011 16:10:29 +0000 (18:10 +0200)]
s3-id_cache: Use better names for id cache management ops

The IDMAP term is normally associated with Winbind's idmap stuff.
These functions deal with id caching not id mapping.

Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-id_cache: Move id caches mgmt out of smbd
Andreas Schneider [Fri, 19 Aug 2011 15:28:37 +0000 (17:28 +0200)]
s3-id_cache: Move id caches mgmt out of smbd

We must leave the MSG_IDMAP_KILL operation in SMBD as it uses smbd
specific internal globals and makes sense only in the context of a smbd
daemon.
The rest is moved under lib/ as we need to deal with id cache cleanups
in other daemons too (like lsasd).

Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-lsasd: Listen on \PIPE\lsass.
Andreas Schneider [Sun, 21 Aug 2011 09:58:36 +0000 (11:58 +0200)]
s3-lsasd: Listen on \PIPE\lsass.

Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-lsasd: Add missing ncalrpc listeners.
Andreas Schneider [Thu, 18 Aug 2011 17:05:27 +0000 (19:05 +0200)]
s3-lsasd: Add missing ncalrpc listeners.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-rpc_server: Add create_dcerpc_ncalrpc_socket().
Andreas Schneider [Thu, 18 Aug 2011 17:05:10 +0000 (19:05 +0200)]
s3-rpc_server: Add create_dcerpc_ncalrpc_socket().

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-rpc_server: Increase epm monitor wait time.
Andreas Schneider [Thu, 18 Aug 2011 16:46:16 +0000 (18:46 +0200)]
s3-rpc_server: Increase epm monitor wait time.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-prefork: Listening fds must be in non-blocking mode
Simo Sorce [Thu, 18 Aug 2011 16:35:02 +0000 (12:35 -0400)]
s3-prefork: Listening fds must be in non-blocking mode

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-spoolss: Remove useless check
Simo Sorce [Thu, 18 Aug 2011 14:39:13 +0000 (10:39 -0400)]
s3-spoolss: Remove useless check

If we *really* are a bout to exit (PF_WORKER_EXITING) then the event will not
be called as the loop will exit. Otherwise PF_SRV_MSG_EXIT may not  be honoured
for a long time if we have cients connected, therefore keep handling SIGHUP
properly in those cases.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-lsasd: Remove useless check
Simo Sorce [Thu, 18 Aug 2011 14:35:19 +0000 (10:35 -0400)]
s3-lsasd: Remove useless check

If we *really* are a bout to exit (PF_WORKER_EXITING) then the event will not
be called as the loop will exit. Otherwise PF_SRV_MSG_EXIT may not  be honoured
for a long time if we have cients connected, therefore keep handling SIGHUP
properly in those cases.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-prefork: Fix code to retire children
Simo Sorce [Thu, 18 Aug 2011 14:31:36 +0000 (10:31 -0400)]
s3-prefork: Fix code to retire children

We have to be more careful when retiring children. We cannot stop
accepting connections as soon as the server tells us to quit because if
max_children is reached and we still have clients connected, the server will
not be able to spawn new children until one exits. And children will not exit
until all the clients closed the connections. So we keep operating past our
recall until we have 0 connections.
Also do not try to recall children that still have >= 1 clients connected, they
couldn't anyway.
Also use messaging to warn children and not SIGHUP.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-spoolssd: Listen on parent messages
Simo Sorce [Wed, 17 Aug 2011 20:17:10 +0000 (16:17 -0400)]
s3-spoolssd: Listen on parent messages

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-lsasd: Listen on parent messages
Simo Sorce [Wed, 17 Aug 2011 19:21:52 +0000 (15:21 -0400)]
s3-lsasd: Listen on parent messages

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-prefork: Add parent->client messaging
Simo Sorce [Wed, 17 Aug 2011 19:21:12 +0000 (15:21 -0400)]
s3-prefork: Add parent->client messaging

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-lsasd: Send a message to the parent when we accept a connection
Simo Sorce [Tue, 16 Aug 2011 21:34:30 +0000 (17:34 -0400)]
s3-lsasd: Send a message to the parent when we accept a connection

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-spoolssd: Send a message to the parent when we accept a connection
Simo Sorce [Tue, 16 Aug 2011 20:36:43 +0000 (16:36 -0400)]
s3-spoolssd: Send a message to the parent when we accept a connection

Every time we accept a connection wanr the parent, so it can run management
routines and reallocate more resources if necessary.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-messaging: Add preforked child-parent message types
Simo Sorce [Tue, 16 Aug 2011 20:36:12 +0000 (16:36 -0400)]
s3-messaging: Add preforked child-parent message types

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-prefork: Improve error detection when handling new connections
Simo Sorce [Wed, 17 Aug 2011 14:53:38 +0000 (10:53 -0400)]
s3-prefork: Improve error detection when handling new connections

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-prefork: Improve heuristics
Simo Sorce [Tue, 16 Aug 2011 22:20:51 +0000 (18:20 -0400)]
s3-prefork: Improve heuristics

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-lsasd: User new prefork helpers to simplify code.
Simo Sorce [Tue, 16 Aug 2011 16:01:02 +0000 (12:01 -0400)]
s3-lsasd: User new prefork helpers to simplify code.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-spoolssd: User new prefork helpers to simplify code.
Simo Sorce [Tue, 16 Aug 2011 15:38:03 +0000 (11:38 -0400)]
s3-spoolssd: User new prefork helpers to simplify code.

Also stop using the listening as now the prefork code properly sets
the PF_WORKER_ACCEPTING flag and it can be relied upon without having to keep
additional status around.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-prefork: add a few more utility functions
Simo Sorce [Tue, 16 Aug 2011 15:09:20 +0000 (11:09 -0400)]
s3-prefork: add a few more utility functions

Add a few util functions children side so that daemons do not have
to care about properly setting num_clients and state. Let a common
helper do it so that they are all consistent.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-prefrok: Handle only valid children
Simo Sorce [Tue, 16 Aug 2011 15:07:27 +0000 (11:07 -0400)]
s3-prefrok: Handle only valid children

Children that are about to exit shouldn't be counted as a source of
connections, and also makes no sense to chenge their allowances if they are
about to exit.
Also children with negative num_clients are faulty, exclude them as well.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-prefork: Fix worker flags handling.
Simo Sorce [Tue, 16 Aug 2011 15:37:41 +0000 (11:37 -0400)]
s3-prefork: Fix worker flags handling.

We can't have a clear idea of wether the worker is IDLE or BUSY.
The only things we can tell is if it is Alive, whether it is currently
Accepting connections or wether it is Exiting soon.

Remove PF_WORKER_IDLE, PF_WORKER_BUSY and replace their use with
PF_WORKER_ALIVE. Also properly assign PF_WORKER_ACCEPTING so that
users of the API can rely on the flag.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-prefork: do not use a lock_fd, just race on accept()
Simo Sorce [Tue, 16 Aug 2011 13:30:28 +0000 (09:30 -0400)]
s3-prefork: do not use a lock_fd, just race on accept()

We used a lock mimicking what apache does for preforked children.
But it doesn't work properly in our case because we do not stop once a request
has been served. Clients are allowed to perform multiple requests and keep the
connection open.
This means that if we allow multiple clients per children, then a child could
take the lock and then be asked to do a long or even locking operation by a
client it already is serving. This woulkd cause the whole server to deadlock,
as the child is now busy and also holding on the lock.
Using a race on accept() by having a tevent_fd on the listening socket wait
for read events we never deadlock. At most we cause a bit of contention among
children. But in the generic case connections are much less frequent for us as
clients tend to be long lived. So the little contention we may have is not a
big deal.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agorpc_server: Add forward declaration for dcerpc_transport_t.
Andreas Schneider [Tue, 16 Aug 2011 07:52:42 +0000 (09:52 +0200)]
rpc_server: Add forward declaration for dcerpc_transport_t.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-waf: Fix build with lsasd.
Andreas Schneider [Mon, 15 Aug 2011 11:25:37 +0000 (13:25 +0200)]
s3-waf: Fix build with lsasd.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-lsasd: Use prefrok utils to manage children
Simo Sorce [Fri, 12 Aug 2011 21:21:50 +0000 (17:21 -0400)]
s3-lsasd: Use prefrok utils to manage children

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-spoolssd: Use prefrok utils to manage children
Simo Sorce [Fri, 12 Aug 2011 19:25:48 +0000 (15:25 -0400)]
s3-spoolssd: Use prefrok utils to manage children

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-prefork: Add common utilities for daemons
Simo Sorce [Fri, 12 Aug 2011 19:24:17 +0000 (15:24 -0400)]
s3-prefork: Add common utilities for daemons

Daemons using the prefork infrastructure may want to use these utils to
configure and manage a pool of children.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-spoolss: Introduce helper function to manage pool.
Simo Sorce [Fri, 12 Aug 2011 16:24:48 +0000 (12:24 -0400)]
s3-spoolss: Introduce helper function to manage pool.

We were not properly managing allowed clients and pool management was
duplicated across a few callers.
Concentrate all management heuristics in one single function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-prefork: Allow better management of allowed_clients
Simo Sorce [Fri, 12 Aug 2011 16:24:13 +0000 (12:24 -0400)]
s3-prefork: Allow better management of allowed_clients

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-winbind: We need to use internal rpc connections in winbind.
Andreas Schneider [Fri, 12 Aug 2011 09:19:09 +0000 (11:19 +0200)]
s3-winbind: We need to use internal rpc connections in winbind.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-spoolssd: Fix spoolss logging.
Simo Sorce [Thu, 11 Aug 2011 18:23:19 +0000 (14:23 -0400)]
s3-spoolssd: Fix spoolss logging.

Use the same code as in lsasd.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
8 years agos3-lsasd: Import fixes from spoolssd
Simo Sorce [Thu, 11 Aug 2011 18:24:05 +0000 (14:24 -0400)]
s3-lsasd: Import fixes from spoolssd

Properly rotate log files in children by using a gloabl lsasd_child_id
variable.
Simplify code by using a global lsasd_pool variable, we can never use
more than one prefork pool in the same process anyway.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>