10 years agos3: Increase a debug level in ads_find_dc
Volker Lendecke [Wed, 17 Aug 2011 09:58:57 +0000 (11:58 +0200)]
s3: Increase a debug level in ads_find_dc

This message can happen with AD trusts that winbind can not cope with. The
message is not really clear and not worth spamming syslog always.

10 years agoRemove unused "sid_equal"
Volker Lendecke [Wed, 17 Aug 2011 10:20:30 +0000 (12:20 +0200)]
Remove unused "sid_equal"

10 years agoReplace calls to sid_equal with calls to dom_sid_equal
Volker Lendecke [Wed, 17 Aug 2011 10:18:14 +0000 (12:18 +0200)]
Replace calls to sid_equal with calls to dom_sid_equal

10 years agos3-messaging: IDMAP_ messages belongs to the Winbind range
Simo Sorce [Tue, 16 Aug 2011 14:46:17 +0000 (10:46 -0400)]
s3-messaging: IDMAP_ messages belongs to the Winbind range

Autobuild-User: Simo Sorce <>
Autobuild-Date: Tue Aug 16 22:27:05 CEST 2011 on sn-devel-104

10 years agos3: Use ZERO_STRUCT where appropriate
Volker Lendecke [Tue, 16 Aug 2011 10:30:58 +0000 (12:30 +0200)]
s3: Use ZERO_STRUCT where appropriate

Autobuild-User: Volker Lendecke <>
Autobuild-Date: Tue Aug 16 13:59:55 CEST 2011 on sn-devel-104

10 years agotdb: increment sequence number in tdb_wipe_all().
Rusty Russell [Tue, 16 Aug 2011 07:17:03 +0000 (16:47 +0930)]
tdb: increment sequence number in tdb_wipe_all().

TDB2 testing revealed that tdb1 doesn't do this.  It's minor, but fix it.

Signed-off-by: Rusty Russell <>
Autobuild-User: Rusty Russell <>
Autobuild-Date: Tue Aug 16 10:47:41 CEST 2011 on sn-devel-104

10 years agos3:registry: enhance debugging of deletekey_recursive
Michael Adam [Sun, 14 Aug 2011 21:48:41 +0000 (23:48 +0200)]
s3:registry: enhance debugging of deletekey_recursive

Autobuild-User: Michael Adam <>
Autobuild-Date: Mon Aug 15 19:34:44 CEST 2011 on sn-devel-104

10 years agos3:dbwrap_ctdb: improve transaction start/commit/cancel debugging
Michael Adam [Sun, 14 Aug 2011 21:47:47 +0000 (23:47 +0200)]
s3:dbwrap_ctdb: improve transaction start/commit/cancel debugging

* also log nesting transaction start/commit/cancel
* unify transaction log messages slightly

10 years agos3:lib: fix a comment in tdb_unpack()
Michael Adam [Mon, 15 Aug 2011 11:34:42 +0000 (13:34 +0200)]
s3:lib: fix a comment in tdb_unpack()

10 years agos3:registry: fix regdb_key_exists: the record has to contain at least the 4-byte...
Michael Adam [Sun, 14 Aug 2011 23:30:32 +0000 (01:30 +0200)]
s3:registry: fix regdb_key_exists: the record has to contain at least the 4-byte subkey counter

More precisley, we return false if the record does not match the required
structure of a leading 4-byte subkey counter followed by the corresponding
number zero-terminated strings.

10 years agos3: avoid reading past the end of buffer in tdb_unpack 'f' if zero termination is...
Gregor Beck [Tue, 5 Jul 2011 09:55:34 +0000 (11:55 +0200)]
s3: avoid reading past the end of buffer in tdb_unpack 'f' if zero termination is missing

Signed-off-by: Michael Adam <>
10 years agos3: avoid reading past the end of buffer in tdb_unpack 'P' if zero termination is...
Gregor Beck [Tue, 5 Jul 2011 09:54:58 +0000 (11:54 +0200)]
s3: avoid reading past the end of buffer in tdb_unpack 'P' if zero termination is missing

Signed-off-by: Michael Adam <>
10 years agobuild: link pys3param against pytalloc-util not pytalloc
Andrew Bartlett [Mon, 15 Aug 2011 06:20:35 +0000 (16:20 +1000)]
build: link pys3param against pytalloc-util not pytalloc

pytalloc is the python module, pytalloc-util is the library that we can depend on

Andrew Bartlett

Autobuild-User: Andrew Bartlett <>
Autobuild-Date: Mon Aug 15 09:54:02 CEST 2011 on sn-devel-104

10 years agos3-passdb Use supplied pdb_methods in default passdb search handlers
Andrew Bartlett [Mon, 15 Aug 2011 01:47:36 +0000 (11:47 +1000)]
s3-passdb Use supplied pdb_methods in default passdb search handlers

10 years agos3-prefork: Do not use mmap/mremap/munmap directly
Simo Sorce [Sun, 14 Aug 2011 22:11:18 +0000 (18:11 -0400)]
s3-prefork: Do not use mmap/mremap/munmap directly

Use the wrappers in util.h as they deal with trying to do the best they can on
platfroms that do not support mmap extensions.

Autobuild-User: Simo Sorce <>
Autobuild-Date: Mon Aug 15 04:13:51 CEST 2011 on sn-devel-104

10 years agoutil: add function to extend anonymous shared memory
Simo Sorce [Sun, 14 Aug 2011 22:10:53 +0000 (18:10 -0400)]
util: add function to extend anonymous shared memory

10 years agoreplace: Check if we have mremap() available
Simo Sorce [Sun, 14 Aug 2011 22:05:27 +0000 (18:05 -0400)]
replace: Check if we have mremap() available

10 years agoUse public pytalloc header file.
Jelmer Vernooij [Sun, 14 Aug 2011 13:34:08 +0000 (15:34 +0200)]
Use public pytalloc header file.

Autobuild-User: Jelmer Vernooij <>
Autobuild-Date: Sun Aug 14 17:18:46 CEST 2011 on sn-devel-104

10 years agos3: Fix bug 8360
Volker Lendecke [Thu, 11 Aug 2011 14:52:22 +0000 (16:52 +0200)]
s3: Fix bug 8360

OS/2 sends an unexpected write&x/read&x chain

Autobuild-User: Volker Lendecke <>
Autobuild-Date: Sun Aug 14 08:48:58 CEST 2011 on sn-devel-104

10 years agos3-passdb: Fix python < 2.6 build errors in passdb python wrapper
Andrew Bartlett [Sun, 14 Aug 2011 00:05:42 +0000 (10:05 +1000)]
s3-passdb: Fix python < 2.6 build errors in passdb python wrapper

Autobuild-User: Andrew Bartlett <>
Autobuild-Date: Sun Aug 14 03:59:48 CEST 2011 on sn-devel-104

10 years agos4:misc: remove last usage of legacy event_ fn names
Simo Sorce [Tue, 25 May 2010 19:29:14 +0000 (15:29 -0400)]
s4:misc: remove last usage of legacy event_ fn names

Autobuild-User: Simo Sorce <>
Autobuild-Date: Sun Aug 14 00:38:13 CEST 2011 on sn-devel-104

10 years agos4:lib: use tevent_ fns names instead of legcay event_ ones
Simo Sorce [Tue, 25 May 2010 19:28:35 +0000 (15:28 -0400)]
s4:lib: use tevent_ fns names instead of legcay event_ ones

10 years agos4:smbd: use tevent_ fn names instead of leagcy event_ ones
Simo Sorce [Tue, 25 May 2010 19:28:10 +0000 (15:28 -0400)]
s4:smbd: use tevent_ fn names instead of leagcy event_ ones

10 years agos4:ntvfs: use tevent_ fn names instead of legacy event_ ones
Simo Sorce [Tue, 25 May 2010 19:27:41 +0000 (15:27 -0400)]
s4:ntvfs: use tevent_ fn names instead of legacy event_ ones

10 years agos4:librpc: use tevent_ fn names instead of legacy event_ ones
Simo Sorce [Tue, 25 May 2010 19:27:11 +0000 (15:27 -0400)]
s4:librpc: use tevent_ fn names instead of legacy event_ ones

10 years agos4:libcli: use tevent_ fn names instead of legacy event_ ones
Simo Sorce [Tue, 25 May 2010 19:26:42 +0000 (15:26 -0400)]
s4:libcli: use tevent_ fn names instead of legacy event_ ones

10 years agos4:dsdb: use tevent_ fn names instaed of legacy event_ ones
Simo Sorce [Tue, 25 May 2010 19:26:00 +0000 (15:26 -0400)]
s4:dsdb: use tevent_ fn names instaed of legacy event_ ones

10 years agos4:messaging: use tevent_ function names instead of legacy event_ ones
Simo Sorce [Tue, 25 May 2010 19:25:26 +0000 (15:25 -0400)]
s4:messaging: use tevent_ function names instead of legacy event_ ones

10 years agotorture: use tevent_ functions names instead of the legacy event_ ones
Simo Sorce [Tue, 25 May 2010 19:23:55 +0000 (15:23 -0400)]
torture: use tevent_ functions names instead of the legacy event_ ones

10 years agoldb: Remove use after free in error case
Andrew Bartlett [Sat, 13 Aug 2011 03:42:04 +0000 (13:42 +1000)]
ldb: Remove use after free in error case

Autobuild-User: Andrew Bartlett <>
Autobuild-Date: Sat Aug 13 13:49:44 CEST 2011 on sn-devel-104

10 years agos4-provision Add support for fixing the DC rid to a particular value
Andrew Bartlett [Sat, 13 Aug 2011 03:32:18 +0000 (13:32 +1000)]
s4-provision Add support for fixing the DC rid to a particular value

This will allow an upgraded DC to keep its SID, while being upgraded
to AD.  We also watch for the highest RID in the existing DB to set
next_rid for other additional users.

Andrew Bartlett

10 years agos3-smbd Avoid races creating 'ncaclrpc dir' with epmd in a child process
Andrew Bartlett [Sat, 13 Aug 2011 03:30:16 +0000 (13:30 +1000)]
s3-smbd Avoid races creating 'ncaclrpc dir' with epmd in a child process

10 years agos4-param Set szConfigFile even for s3 loadparm contexts
Andrew Bartlett [Fri, 12 Aug 2011 12:17:26 +0000 (22:17 +1000)]
s4-param Set szConfigFile even for s3 loadparm contexts

10 years agoupgrade: Add missing bits for the s3 to s4 upgrade script
Amitay Isaacs [Fri, 12 Aug 2011 01:37:57 +0000 (11:37 +1000)]
upgrade: Add missing bits for the s3 to s4 upgrade script

Use passdb backend to import/export users

Remove unused options for upgrade_from_s3 command (--blank) and credentials options
Config file is specified with -s/--configfile option and no need to specify as an argument.

Pair-Programmed-With: Andrew Bartlett <>

10 years agotests: Update test for s3 to s4 upgrade with two cases
Amitay Isaacs [Fri, 12 Aug 2011 07:47:49 +0000 (17:47 +1000)]
tests: Update test for s3 to s4 upgrade with two cases

S3-member to S4-member and S3-dc to S4-dc

Pair-Programmed-With: Andrew Bartlett <>

10 years agos3-passdb: Added python method to get_global_sam_sid
Amitay Isaacs [Fri, 12 Aug 2011 07:10:17 +0000 (17:10 +1000)]
s3-passdb: Added python method to get_global_sam_sid

Pair-Programmed-With: Andrew Bartlett <>

10 years agos3-passdb: Return dom_sid and guid with correct python types.
Amitay Isaacs [Fri, 12 Aug 2011 07:09:19 +0000 (17:09 +1000)]
s3-passdb: Return dom_sid and guid with correct python types.

Pair-Programmed-With: Andrew Bartlett <>

10 years agopassdb: Move python wrapper for passdb in samba3 python package
Amitay Isaacs [Fri, 12 Aug 2011 06:20:11 +0000 (16:20 +1000)]
passdb: Move python wrapper for passdb in samba3 python package

10 years agopy-samba3: Create samba3 python package to hold other modules
Amitay Isaacs [Fri, 12 Aug 2011 06:19:06 +0000 (16:19 +1000)]
py-samba3: Create samba3 python package to hold other modules

This will include passdb and param.

10 years agos3-param: Add python wrapper for s3 parameters
Amitay Isaacs [Fri, 12 Aug 2011 05:48:03 +0000 (15:48 +1000)]
s3-param: Add python wrapper for s3 parameters

This provids a get_context() method to return s3 context as s4 context type.

Pair-Programmed-With: Andrew Bartlett <>

10 years agos3-passdb: Connect to specified samdb if location is provided, otherwise use default
Amitay Isaacs [Fri, 12 Aug 2011 05:45:43 +0000 (15:45 +1000)]
s3-passdb: Connect to specified samdb if location is provided, otherwise use default

Pair-Programmed-With: Andrew Bartlett <>

10 years agos3-passdb: Fix the error messages and return correct NTSTATUS
Amitay Isaacs [Fri, 12 Aug 2011 05:44:39 +0000 (15:44 +1000)]
s3-passdb: Fix the error messages and return correct NTSTATUS

Pair-Programmed-With: Andrew Bartlett <>

10 years agos4-dsdb: Provide additional method to connect to specified database path
Amitay Isaacs [Fri, 12 Aug 2011 05:43:04 +0000 (15:43 +1000)]
s4-dsdb: Provide additional method to connect to specified database path

samdb_connect() now calls samdb_connect_url() with default "sam.ldb".

Pair-Programmed-With: Andrew Bartlett <>

10 years agos3-param: Make sure we have talloc stack frame before calling in s3 code
Amitay Isaacs [Fri, 12 Aug 2011 05:40:26 +0000 (15:40 +1000)]
s3-param: Make sure we have talloc stack frame before calling in s3 code

When loading parameters as s4 context in s3 code, ensure we have a
talloc stack frame. This is required for python wrapping s3 params.

10 years agoparam: Add smb.conf loading support to s3/s4 loadparm bridge
Andrew Bartlett [Fri, 12 Aug 2011 01:26:42 +0000 (11:26 +1000)]
param: Add smb.conf loading support to s3/s4 loadparm bridge

10 years agos4-dsdb ensure we honour the hash_values control, even for really odd hashes
Andrew Bartlett [Thu, 11 Aug 2011 05:50:54 +0000 (15:50 +1000)]
s4-dsdb ensure we honour the hash_values control, even for really odd hashes

10 years agos4-dsdb Give a less worrying error message on failure to get a transaction
Andrew Bartlett [Thu, 11 Aug 2011 05:49:37 +0000 (15:49 +1000)]
s4-dsdb Give a less worrying error message on failure to get a transaction

10 years agos4-scripting Rename passdb upgrade routine to avoid conflict with upgradeprovision
Andrew Bartlett [Thu, 11 Aug 2011 06:19:24 +0000 (16:19 +1000)]
s4-scripting Rename passdb upgrade routine to avoid conflict with upgradeprovision

10 years agos3-passdb Add support for pdb_add_sam_account() and password hashes to pdb_samba4
Andrew Bartlett [Thu, 11 Aug 2011 05:47:01 +0000 (15:47 +1000)]
s3-passdb Add support for pdb_add_sam_account() and password hashes to pdb_samba4

This will help when using this as part of the Samba3 passdb -> Samba4
ldb database upgrade script.

Andrew Bartlett

10 years agos4-dsdb Add ability to force a particular SID in the upgrade case
Andrew Bartlett [Thu, 11 Aug 2011 05:46:26 +0000 (15:46 +1000)]
s4-dsdb Add ability to force a particular SID in the upgrade case

10 years agos3-passdb Make pdb_element_is_changed available to all passdb modules
Andrew Bartlett [Thu, 11 Aug 2011 05:39:47 +0000 (15:39 +1000)]
s3-passdb Make pdb_element_is_changed available to all passdb modules

This will allow pdb_samba4 to use this

Andrew Bartlett

10 years agos4-dsdb Add flag to set DSDB_BYPASS_PASSWORD_HASH control
Andrew Bartlett [Thu, 11 Aug 2011 06:14:36 +0000 (16:14 +1000)]
s4-dsdb Add flag to set DSDB_BYPASS_PASSWORD_HASH control

10 years agopassdb: Allocate talloc stackframe before calling in pdb functions.
Amitay Isaacs [Thu, 11 Aug 2011 03:59:00 +0000 (13:59 +1000)]
passdb: Allocate talloc stackframe before calling in pdb functions.

10 years agopassdb: Call with correct backend methods instead of default methods
Amitay Isaacs [Wed, 10 Aug 2011 07:32:32 +0000 (17:32 +1000)]
passdb: Call with correct backend methods instead of default methods

Pair-Programmed-With: Andrew Bartlett <>

10 years agopassdb: Added python wrapper to passdb
Amitay Isaacs [Wed, 10 Aug 2011 03:53:43 +0000 (13:53 +1000)]
passdb: Added python wrapper to passdb

 - Added python wrapper for samu structure.

 - Added python wrapper for passdb methods:

   domain_info(), getsampwnam(), getsampwsid(), create_user(),
   delete_user(), add_sam_account(), delete_sam_account(),
   update_sam_account(), rename_sam_account(), search_users()

Pair-Programmed-With: Andrew Bartlett <>

10 years agopassdb: Add a function to read secrets db from a specified path
Amitay Isaacs [Wed, 10 Aug 2011 03:50:26 +0000 (13:50 +1000)]
passdb: Add a function to read secrets db from a specified path

This allows to load secrets db from a different location. The original
secrets_init() now calls secrets_init_path() with lp_private_dir().

10 years agopassdb: Add a function to expose loaded backend list.
Amitay Isaacs [Wed, 10 Aug 2011 03:46:34 +0000 (13:46 +1000)]
passdb: Add a function to expose loaded backend list.

This function is used in python wrapper to list available python backends.

10 years agowaf: Add SAMBA3_PYTHON context to build python wrappers in samba3
Amitay Isaacs [Wed, 10 Aug 2011 03:43:18 +0000 (13:43 +1000)]
waf: Add SAMBA3_PYTHON context to build python wrappers in samba3

10 years agosamba-tool: Remove gpo setacl command
Amitay Isaacs [Wed, 3 Aug 2011 05:09:19 +0000 (15:09 +1000)]
samba-tool: Remove gpo setacl command

10 years agos3:smb2cli: pass more fields to smb2cli_req_create()/smb2cli_req_send()
Stefan Metzmacher [Fri, 12 Aug 2011 15:26:13 +0000 (17:26 +0200)]
s3:smb2cli: pass more fields to smb2cli_req_create()/smb2cli_req_send()

The caller should take care of the global cli_state values.


Autobuild-User: Stefan Metzmacher <>
Autobuild-Date: Fri Aug 12 19:38:27 CEST 2011 on sn-devel-104

10 years agos3:smb2cli: allow 32bit dyn_len in smb2cli_req_create()/smb2cli_req_send()
Stefan Metzmacher [Fri, 12 Aug 2011 15:23:04 +0000 (17:23 +0200)]
s3:smb2cli: allow 32bit dyn_len in smb2cli_req_create()/smb2cli_req_send()


10 years agos3:libsmb: keep a cli_smb_state->one_way
Stefan Metzmacher [Fri, 12 Aug 2011 15:40:04 +0000 (17:40 +0200)]
s3:libsmb: keep a cli_smb_state->one_way

This moves the SMB1 specific stuff to cli_smb_req_create(),
instead of having it in the core dispatching code.


10 years agos3:libsmb: abstract the incoming dispatch function via a function pointer
Stefan Metzmacher [Fri, 12 Aug 2011 12:50:09 +0000 (14:50 +0200)]
s3:libsmb: abstract the incoming dispatch function via a function pointer

This will allow handling of SMB2 in future.


10 years agos3:libsmb: split out cli_state_dispatch_smb1() from cli_smb_received()
Stefan Metzmacher [Fri, 12 Aug 2011 12:41:23 +0000 (14:41 +0200)]
s3:libsmb: split out cli_state_dispatch_smb1() from cli_smb_received()


10 years agos3:libsmb: add missing TALLOC_FREE(frame) to cli_smb_received()
Stefan Metzmacher [Fri, 12 Aug 2011 12:44:44 +0000 (14:44 +0200)]
s3:libsmb: add missing TALLOC_FREE(frame) to cli_smb_received()


10 years agos3:smb2_server: make sure we prefer responses over requests on the client socket
Stefan Metzmacher [Fri, 5 Aug 2011 18:34:43 +0000 (20:34 +0200)]
s3:smb2_server: make sure we prefer responses over requests on the client socket


Autobuild-User: Stefan Metzmacher <>
Autobuild-Date: Fri Aug 12 16:46:43 CEST 2011 on sn-devel-104

10 years agoselftest:Samba4: test --domain-critical-only in provision_vampire_dc()
Stefan Metzmacher [Thu, 11 Aug 2011 21:07:35 +0000 (23:07 +0200)]
selftest:Samba4: test --domain-critical-only in provision_vampire_dc()

This way only only replicate critical objects during the initial join
as DC, then we'll replicate the whole domain while 'samba' is running.


Signed-off-by: Andrew Tridgell <>
Autobuild-User: Stefan Metzmacher <>
Autobuild-Date: Fri Aug 12 14:07:50 CEST 2011 on sn-devel-104

10 years agos3:samba-tool: add --domain-critical-only to "samba-tool domain join"
Stefan Metzmacher [Mon, 8 Aug 2011 09:15:35 +0000 (11:15 +0200)]
s3:samba-tool: add --domain-critical-only to "samba-tool domain join"


Signed-off-by: Andrew Tridgell <>
10 years agos4:py/samba/join: add domain_critical_only=False to join_DC/join_RODC
Stefan Metzmacher [Mon, 8 Aug 2011 09:01:21 +0000 (11:01 +0200)]
s4:py/samba/join: add domain_critical_only=False to join_DC/join_RODC


Signed-off-by: Andrew Tridgell <>
10 years agos4:py/samba/drs_utils: pass down req/req_level to
Stefan Metzmacher [Mon, 8 Aug 2011 08:47:12 +0000 (10:47 +0200)]
s4:py/samba/drs_utils: pass down req/req_level to


Signed-off-by: Andrew Tridgell <>
10 years agos4:libnet_vampire: don't keep the replication state if DRSUAPI_DRS_CRITICAL_ONLY...
Stefan Metzmacher [Tue, 9 Aug 2011 10:23:29 +0000 (12:23 +0200)]
s4:libnet_vampire: don't keep the replication state if DRSUAPI_DRS_CRITICAL_ONLY was used

In that case we have incomplete information and need to start
from 0 in the next run.


Signed-off-by: Andrew Tridgell <>
10 years agos4:libnet: passdown the DsGetNCChangesReq* to the libnet_BecomeDC_StoreChunk handler
Stefan Metzmacher [Mon, 8 Aug 2011 08:29:05 +0000 (10:29 +0200)]
s4:libnet: passdown the DsGetNCChangesReq* to the libnet_BecomeDC_StoreChunk handler


Signed-off-by: Andrew Tridgell <>
10 years agoselftest:target/Samba4: use the correct configuration in setup_vampire_dc()
Stefan Metzmacher [Tue, 9 Aug 2011 10:20:54 +0000 (12:20 +0200)]
selftest:target/Samba4: use the correct configuration in setup_vampire_dc()

This allows "TDB_NO_FSYNC=1 make -j test TESTS=vampire" to work.


Signed-off-by: Andrew Tridgell <>
10 years agos3:libsmb: keep the request order in cli_smb_req_unset_pending()
Stefan Metzmacher [Fri, 12 Aug 2011 06:39:15 +0000 (08:39 +0200)]
s3:libsmb: keep the request order in cli_smb_req_unset_pending()


Autobuild-User: Stefan Metzmacher <>
Autobuild-Date: Fri Aug 12 12:36:03 CEST 2011 on sn-devel-104

10 years agos3:libsmb: use tevent_req_defer_callback() unless there's only one request in cli_smb...
Stefan Metzmacher [Thu, 11 Aug 2011 10:45:26 +0000 (12:45 +0200)]
s3:libsmb: use tevent_req_defer_callback() unless there's only one request in cli_smb_received()

Callers of tevent_req_done() (or similar functions) have to return directly.
Otherwise the callback could invalidate the current stack state,
which is likely to trigger segfaults.

If there was only one pending request and we just got the response
for that one, we can use tevent_req_done() directly.

Otherwise there're more pending requests and we need to call
cli_state_receive_next() or we got the response for chained requests.
Both means that we have to use tevent_req_defer_callback().


10 years agos3:libsmb: make use of cli_state_receive_next() in cli_smb_received()
Stefan Metzmacher [Thu, 11 Aug 2011 10:28:06 +0000 (12:28 +0200)]
s3:libsmb: make use of cli_state_receive_next() in cli_smb_received()


10 years agos3:libsmb: notify all request about failures in cli_smb_req_set_pending()
Stefan Metzmacher [Thu, 11 Aug 2011 10:26:31 +0000 (12:26 +0200)]
s3:libsmb: notify all request about failures in cli_smb_req_set_pending()

It's up to the caller to notify the current request,
but we have to notify all other pending requests if
we're not able to read the next response from the server.


10 years agos3:libsmb: split out cli_state_receive_next() from cli_smb_req_set_pending()
Stefan Metzmacher [Thu, 11 Aug 2011 10:16:02 +0000 (12:16 +0200)]
s3:libsmb: split out cli_state_receive_next() from cli_smb_req_set_pending()


10 years agos3:libsmb: use talloc_stackframe() in cli_smb_received()
Stefan Metzmacher [Thu, 11 Aug 2011 10:07:55 +0000 (12:07 +0200)]
s3:libsmb: use talloc_stackframe() in cli_smb_received()


10 years agos3:libsmb: call cli_smb_req_unset_pending() before tevent_req_done() also for chained...
Stefan Metzmacher [Thu, 11 Aug 2011 10:18:58 +0000 (12:18 +0200)]
s3:libsmb: call cli_smb_req_unset_pending() before tevent_req_done() also for chained requests


10 years agos3:libsmb: reset the destructor in cli_smb_req_unset_pending()
Stefan Metzmacher [Thu, 11 Aug 2011 10:18:26 +0000 (12:18 +0200)]
s3:libsmb: reset the destructor in cli_smb_req_unset_pending()


10 years agos3:libsmb: add cli_state_notify_pending() and use it
Stefan Metzmacher [Thu, 11 Aug 2011 07:35:38 +0000 (09:35 +0200)]
s3:libsmb: add cli_state_notify_pending() and use it

If we got a problem on the connection we need to notify every
pending request. But we need to make use of tevent_req_defer_callback()
before tevent_req_nterror(), otherwise the callback, triggered
by tevent_req_nterror(), could invalidate the state of current caller,
which will likely cause segfaults.


10 years agos4-test: use standard process model for 'dc' server
Andrew Tridgell [Fri, 12 Aug 2011 04:37:04 +0000 (14:37 +1000)]
s4-test: use standard process model for 'dc' server

this provides us with both 'standard' and 'single' process models in
selftest, ensuring that we test the standard process model in the
build farm

Pair-Programmed-With: Andrew Bartlett <>

Autobuild-User: Andrew Tridgell <>
Autobuild-Date: Fri Aug 12 11:06:50 CEST 2011 on sn-devel-104

10 years agosocket-wrapped: added wrappers for dup() and dup2()
Andrew Tridgell [Fri, 12 Aug 2011 04:28:03 +0000 (14:28 +1000)]
socket-wrapped: added wrappers for dup() and dup2()

The Samba4 standard process model uses dup() on incoming sockets as an
optimisation (it makes select() a tiny bit faster when used).

Adding dup() to socket wrapper allows us to use the standard process
model in selftest

Pair-Programmed-With: Andrew Bartlett <>

10 years agos3:selftest: run smbtorture3 CHAIN1/CHAIN2 tests
Stefan Metzmacher [Thu, 11 Aug 2011 20:32:49 +0000 (22:32 +0200)]
s3:selftest: run smbtorture3 CHAIN1/CHAIN2 tests


Autobuild-User: Stefan Metzmacher <>
Autobuild-Date: Fri Aug 12 09:37:04 CEST 2011 on sn-devel-104

10 years agotevent: don't force the nesting flag to false in the destructor
Andrew Tridgell [Fri, 12 Aug 2011 01:56:28 +0000 (11:56 +1000)]
tevent: don't force the nesting flag to false in the destructor

the tevent destructor is called in tevent_re_initialise(), to reset
the event context back to its original state for creating child
processes. We need the nesting flag to stay the same

Pair-Programmed-With: Andrew Bartlett <>

Autobuild-User: Andrew Tridgell <>
Autobuild-Date: Fri Aug 12 05:18:25 CEST 2011 on sn-devel-104

10 years agos4-dbcheck: offer to fix dsServiceName to be in GUID form
Andrew Tridgell [Thu, 11 Aug 2011 06:59:11 +0000 (16:59 +1000)]
s4-dbcheck: offer to fix dsServiceName to be in GUID form

this fixes the dsServiceName so it can handle server renames

Pair-Programmed-With: Andrew Bartlett <>

10 years agos4-dsdb: don't cache the NTDS settings DN
Andrew Tridgell [Thu, 11 Aug 2011 06:29:24 +0000 (16:29 +1000)]
s4-dsdb: don't cache the NTDS settings DN

this DN can change due to a server rename, so we cannot cache it. It
is set by provision, but not anywhere else.

This seems to not have a large performance impact

Pair-Programmed-With: Andrew Bartlett <>

10 years agos4-join: make dsServiceName a GUID in @ROOTDSE on join
Andrew Tridgell [Thu, 11 Aug 2011 06:05:11 +0000 (16:05 +1000)]
s4-join: make dsServiceName a GUID in @ROOTDSE on join

when joining another domain as a DC we should setup our dsServiceName
in @ROOTDSE to be a GUID so we can cope with later server renames

Pair-Programmed-With: Andrew Bartlett <>

10 years agos4-provision: create dsServiceName in @ROOTDSE in GUID form
Andrew Tridgell [Thu, 11 Aug 2011 05:45:43 +0000 (15:45 +1000)]
s4-provision: create dsServiceName in @ROOTDSE in GUID form

this allows for handling of server renames as the GUID doesn't change

Pair-Programmed-With: Andrew Bartlett <>

10 years agos4-dsdb: expand dsServiceName from GUID form at runtime
Andrew Tridgell [Thu, 11 Aug 2011 05:44:32 +0000 (15:44 +1000)]
s4-dsdb: expand dsServiceName from GUID form at runtime

this allows dsServiceName to be stored as an extended DN or GUID form
in @ROOTDSE, and its string form will be found at runtime.

Pair-Programmed-With: Andrew Bartlett <>

10 years agos4-dsdb: remove the naming_fsmo and pdc_fsmo modules
Andrew Tridgell [Thu, 11 Aug 2011 05:43:22 +0000 (15:43 +1000)]
s4-dsdb: remove the naming_fsmo and pdc_fsmo modules

these are not needed now that the rootdse modules calculates the
validFSMOs attribute at runtime

Pair-Programmed-With: Andrew Bartlett <>

10 years agos4-dsdb: calculate validFSMOs at runtime instead of pre-computing
Andrew Tridgell [Thu, 11 Aug 2011 05:40:53 +0000 (15:40 +1000)]
s4-dsdb: calculate validFSMOs at runtime instead of pre-computing

this changes the rootdse to compute the validFSMOs attribute at
runtime by checking the fSMORoleOwner attribute on the appropriate
DN. This avoids the need for the pdc_fsmo and naming_fsmo modules.

Pair-Programmed-With: Andrew Bartlett <>

10 years agotevent: fix documentation for tevent_context_init_byname()
Sumit Bose [Thu, 11 Aug 2011 10:39:57 +0000 (12:39 +0200)]
tevent: fix documentation for tevent_context_init_byname()

Signed-off-by: Simo Sorce <>
Autobuild-User: Simo Sorce <>
Autobuild-Date: Thu Aug 11 21:56:37 CEST 2011 on sn-devel-104

10 years agotevent: Set FD_CLOEXEC on epoll handle
Sumit Bose [Thu, 11 Aug 2011 10:30:48 +0000 (12:30 +0200)]
tevent: Set FD_CLOEXEC on epoll handle

If an application using libtevent starts a new process the epoll file descriptor
is leaked to the new process if the event context is not freed explicitly. By
setting FD_CLOEXEC this is not needed anymore.

Signed-off-by: Simo Sorce <>
10 years agos3-messaging: Do not register to classes we are not going to use.
Simo Sorce [Thu, 11 Aug 2011 03:28:09 +0000 (23:28 -0400)]
s3-messaging: Do not register to classes we are not going to use.

Signed-off-by: Andreas Schneider <>
Autobuild-User: Andreas Schneider <>
Autobuild-Date: Thu Aug 11 17:09:30 CEST 2011 on sn-devel-104

10 years agos3-messaging: Change classification of MSG_SMB_CONF_UPDATED.
Simo Sorce [Thu, 11 Aug 2011 03:25:56 +0000 (23:25 -0400)]
s3-messaging: Change classification of MSG_SMB_CONF_UPDATED.

smbd is not the only daemon interested in smb.conf changes. Move this
message to the GENERAL class so that all interested partied (nmbd,
winbindd, spoolssd, etc..) can receive this notification.

Signed-off-by: Andreas Schneider <>
10 years agos3-messaging: Fix messaging classes.
Simo Sorce [Thu, 11 Aug 2011 03:10:48 +0000 (23:10 -0400)]
s3-messaging: Fix messaging classes.

This has been broken since ff0ac5b0 (May 2007).
Basically all messages were belonging to the General class except for CTDB
This fixed the message_send_all() function to correctly compute the class, and
fixes registrations to include all they need to cope with the fact not all
messages are of calss general (registrations rotted a bit because as long as
FLAG_MSG_GENERAL was defined the process woould receive all messages).

Signed-off-by: Andreas Schneider <>
10 years agos3-messaging: Remove obsolete class.
Simo Sorce [Thu, 11 Aug 2011 03:36:06 +0000 (23:36 -0400)]
s3-messaging: Remove obsolete class.

The FLAG_MSG_PRINT_NOTIFY class is actually obsolete and never used, as the
only message belonging to it is not used either.

Signed-off-by: Andreas Schneider <>
10 years agos3:build(autoconf): fix bug #8369: remove irritating "." targets when recent system...
Michael Adam [Thu, 11 Aug 2011 08:49:30 +0000 (10:49 +0200)]
s3:build(autoconf): fix bug #8369: remove irritating "." targets when recent system libs exist

Autobuild-User: Michael Adam <>
Autobuild-Date: Thu Aug 11 13:26:27 CEST 2011 on sn-devel-104