kai/samba.git
12 years agopidl: generate code for dissecting null terminated strings
Matthieu Patou [Tue, 2 Aug 2011 07:56:32 +0000 (11:56 +0400)]
pidl: generate code for dissecting null terminated strings

12 years agopidl: don't expect to have quote when creating import headers
Matthieu Patou [Tue, 2 Aug 2011 07:50:32 +0000 (11:50 +0400)]
pidl: don't expect to have quote when creating import headers

Currently the $_ didn't contains the quote anymore, in order to avoid
any further regression the cleanup of quote is done before so that if
$_ still have quotes we clean them in anycase.

12 years agos4-scripting: allow to specify the number max of iteration around getNcChanges
Matthieu Patou [Thu, 4 Aug 2011 15:59:49 +0000 (19:59 +0400)]
s4-scripting: allow to specify the number max of iteration around getNcChanges

12 years agos3:rpc_transport_tstream: only use tstream_cli_np_use_trans() for sync requests
Stefan Metzmacher [Thu, 28 Jul 2011 12:15:15 +0000 (14:15 +0200)]
s3:rpc_transport_tstream: only use tstream_cli_np_use_trans() for sync requests

Currently the caller doesn't cope with multiple async requests anyway,
so this is just protection for the future.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Aug  5 22:31:12 CEST 2011 on sn-devel-104

12 years agos3: Make srv_enc_ctx static
Volker Lendecke [Fri, 5 Aug 2011 14:19:27 +0000 (16:19 +0200)]
s3: Make srv_enc_ctx static

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Aug  5 18:29:24 CEST 2011 on sn-devel-104

12 years agos3: Fix a debug message
Volker Lendecke [Fri, 5 Aug 2011 14:14:11 +0000 (16:14 +0200)]
s3: Fix a debug message

12 years agos3: Fix some nonempty blank lines
Volker Lendecke [Fri, 5 Aug 2011 14:01:23 +0000 (16:01 +0200)]
s3: Fix some nonempty blank lines

12 years agos3: Fix "ISO C90 forbids mixed declarations and code"
Volker Lendecke [Fri, 5 Aug 2011 13:40:22 +0000 (15:40 +0200)]
s3: Fix "ISO C90 forbids mixed declarations and code"

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Aug  5 16:58:37 CEST 2011 on sn-devel-104

12 years agos3: Fix some nonempty blank lines
Volker Lendecke [Fri, 5 Aug 2011 13:38:33 +0000 (15:38 +0200)]
s3: Fix some nonempty blank lines

12 years agos3-docs: document --user-sidinfo wbinfo option.
Günther Deschner [Fri, 5 Aug 2011 10:25:52 +0000 (12:25 +0200)]
s3-docs: document --user-sidinfo wbinfo option.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Aug  5 14:06:09 CEST 2011 on sn-devel-104

12 years agos3: make linking of pthreadpooltest work on more platforms
Björn Jacke [Thu, 4 Aug 2011 21:47:47 +0000 (23:47 +0200)]
s3: make linking of pthreadpooltest work on more platforms

Autobuild-User: Björn Jacke <bj@sernet.de>
Autobuild-Date: Fri Aug  5 12:48:55 CEST 2011 on sn-devel-104

12 years agos3/ldap: delay the ldap search alarm termination a bit
Björn Jacke [Thu, 4 Aug 2011 14:42:37 +0000 (16:42 +0200)]
s3/ldap: delay the ldap search alarm termination a bit

do the alarm termination of the the ldap search a bit delayed so the LDAP
server has a chance to tell us that the time limit was reached and the
search was abandoned. If the search is terminated this way we also get
the correct LDAP return code in the logs. If alarm() stops the search the ldap
search routine will report that the LDAP server is down which would trigger us
to rebind to the server needlessly which we also want to avoid.

12 years agos3-nmbd: fix talloc/malloc mismatch in create_listen_pollfds().
Günther Deschner [Thu, 4 Aug 2011 15:32:22 +0000 (17:32 +0200)]
s3-nmbd: fix talloc/malloc mismatch in create_listen_pollfds().

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Aug  4 19:06:39 CEST 2011 on sn-devel-104

12 years agos3/swat: use strlcat instead of strncat to fix build on old Linux distros
Björn Jacke [Thu, 4 Aug 2011 14:25:08 +0000 (16:25 +0200)]
s3/swat: use strlcat instead of strncat to fix build on old Linux distros

SLES 9's glibc for example had weird macros where the use of strncat resulted
in the use of strcat which we don't allow.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User: Björn Jacke <bj@sernet.de>
Autobuild-Date: Thu Aug  4 17:50:24 CEST 2011 on sn-devel-104

12 years agos4-librpc: Fix double free.
Andreas Schneider [Wed, 3 Aug 2011 21:44:45 +0000 (23:44 +0200)]
s4-librpc: Fix double free.

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Thu Aug  4 12:31:18 CEST 2011 on sn-devel-104

12 years agos4-ldb: two DNs only match if they have the same deletion status
Andrew Tridgell [Thu, 4 Aug 2011 04:59:47 +0000 (14:59 +1000)]
s4-ldb: two DNs only match if they have the same deletion status

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Aug  4 09:34:08 CEST 2011 on sn-devel-104

12 years agotalloc: check block count aftter references test
Andrew Tridgell [Thu, 4 Aug 2011 02:07:19 +0000 (12:07 +1000)]
talloc: check block count aftter references test

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

12 years agos4-samdb: save the url in the samdb class
Andrew Tridgell [Wed, 3 Aug 2011 01:31:45 +0000 (11:31 +1000)]
s4-samdb: save the url in the samdb class

this is useful for debugging, so we know which database we are dealing
with

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

12 years agos4-dsdb: extend the extended_dn_in module to handle DN links
Andrew Tridgell [Tue, 2 Aug 2011 07:19:16 +0000 (17:19 +1000)]
s4-dsdb: extend the extended_dn_in module to handle DN links

this replaces DN components in incoming filter expressions with the
full extended DN of the target, which allows search expressions based
on <GUID=> and <SID=> DNs, as well as fixing the problem with one-way
links in search expressions

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

12 years agoldb: rule_id in ldb_parse_tree should be const
Andrew Tridgell [Tue, 2 Aug 2011 07:17:13 +0000 (17:17 +1000)]
ldb: rule_id in ldb_parse_tree should be const

this allows assignment to a constant string without allocation

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

12 years agoldb: added a new always-fail ldap extended match OID
Andrew Tridgell [Tue, 2 Aug 2011 07:16:44 +0000 (17:16 +1000)]
ldb: added a new always-fail ldap extended match OID

this is used when rewriting filter rules to replace a filter rule with
one that is guaranteed not to match

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

12 years agoldb: changed DN matching rules to obey GUID/SID/string ordering
Andrew Tridgell [Tue, 2 Aug 2011 07:15:28 +0000 (17:15 +1000)]
ldb: changed DN matching rules to obey GUID/SID/string ordering

when matching two DNs, the GUID takes priority, then the SID, then the
string component

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

12 years agos4-dsdb: handle search expressions containing extended DNs
Andrew Tridgell [Mon, 1 Aug 2011 07:48:53 +0000 (17:48 +1000)]
s4-dsdb: handle search expressions containing extended DNs

this allows for searches like member=<SID=S-1-2-3>

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

12 years agos4-dsdb: added dn_format attribute of a dsdb_attribute
Andrew Tridgell [Mon, 1 Aug 2011 07:47:34 +0000 (17:47 +1000)]
s4-dsdb: added dn_format attribute of a dsdb_attribute

this is faster than string comparisons during searches at runtime

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

12 years agos4-dsdb: fixed outgoing one way link DNs
Andrew Tridgell [Mon, 1 Aug 2011 03:55:58 +0000 (13:55 +1000)]
s4-dsdb: fixed outgoing one way link DNs

when we return a DN which is a one way link, fix the string DN
component by searching for the GUID and replacing the DN components

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

12 years agos4-dsdb: setup a one_way_link attribute on schema attributes
Andrew Tridgell [Mon, 1 Aug 2011 03:54:58 +0000 (13:54 +1000)]
s4-dsdb: setup a one_way_link attribute on schema attributes

this allows us to quickly determine if a DN is a one way link

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

12 years agos4-dsdb: fixed a warning on dsdb_delete()
Andrew Tridgell [Mon, 1 Aug 2011 02:40:24 +0000 (12:40 +1000)]
s4-dsdb: fixed a warning on dsdb_delete()

struct ldb_dn is never const

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

12 years agos4-dsdb: make requests for STORAGE_FORMAT control non-critical
Andrew Tridgell [Mon, 1 Aug 2011 02:25:11 +0000 (12:25 +1000)]
s4-dsdb: make requests for STORAGE_FORMAT control non-critical

this allows us to use dsdb_module_dn_by_guid() from levels below the
extended_dn_out module

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

12 years agoldb: added signatures for 1.1.2
Andrew Tridgell [Wed, 3 Aug 2011 06:44:28 +0000 (16:44 +1000)]
ldb: added signatures for 1.1.2

12 years agoldb: raise minor version save-diskspace-tags/ldb-1.1.2
Andrew Tridgell [Mon, 1 Aug 2011 02:24:38 +0000 (12:24 +1000)]
ldb: raise minor version

needed for new module function ldb_dn_replace_components()

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

12 years agoldb: added ldb_parse_tree_walk()
Andrew Tridgell [Mon, 1 Aug 2011 07:46:39 +0000 (17:46 +1000)]
ldb: added ldb_parse_tree_walk()

this walks a ldb parse tree, calling a callback on each node

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

12 years agoldb: added ldb_dn_replace_components()
Andrew Tridgell [Mon, 1 Aug 2011 02:24:13 +0000 (12:24 +1000)]
ldb: added ldb_dn_replace_components()

this allows you to replace the string part of a DN with the string
part from another DN. This is useful when you want to fix a DN that
has the right GUID but the wrong string part, because the target
object has moved.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>

12 years agos3-ntlmssp void function cannot return value
Andrew Bartlett [Wed, 3 Aug 2011 22:38:21 +0000 (08:38 +1000)]
s3-ntlmssp void function cannot return value

Removing the return is reasonable here because while no callers
currently specify more than one flag at a time, the
ntlmssp_want_feature code allows it.

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Aug  4 02:19:46 CEST 2011 on sn-devel-104

12 years agos3: Fix some nonempty blank lines
Volker Lendecke [Wed, 3 Aug 2011 18:12:20 +0000 (20:12 +0200)]
s3: Fix some nonempty blank lines

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Aug  3 22:00:19 CEST 2011 on sn-devel-104

12 years agos3-printing: fix some build warnings in queue_process.c
Günther Deschner [Wed, 3 Aug 2011 10:59:17 +0000 (12:59 +0200)]
s3-printing: fix some build warnings in queue_process.c

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Aug  3 17:48:33 CEST 2011 on sn-devel-104

12 years agontlmssp: Add ntlmssp_blob_matches_magic()
Andrew Bartlett [Tue, 2 Aug 2011 23:33:29 +0000 (09:33 +1000)]
ntlmssp: Add ntlmssp_blob_matches_magic()

This avoids having the same check in 3 different parts of the code

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Aug  3 12:45:04 CEST 2011 on sn-devel-104

12 years agos3-ntlmssp Remove rudundent comment
Andrew Bartlett [Tue, 2 Aug 2011 23:26:55 +0000 (09:26 +1000)]
s3-ntlmssp Remove rudundent comment

This is explained where SESSION_KEY maps to SIGN at the NTLMSSP layer

Andrew Bartlett

12 years agos3-ntlmssp Remove a level of nesting in if/else statement
Andrew Bartlett [Tue, 2 Aug 2011 13:17:02 +0000 (23:17 +1000)]
s3-ntlmssp Remove a level of nesting in if/else statement

12 years agoselftest: test plugin_s4_dc against all ncacn_np tests
Andrew Bartlett [Tue, 2 Aug 2011 03:17:24 +0000 (13:17 +1000)]
selftest: test plugin_s4_dc against all ncacn_np tests

Changes to the s3 epmapper behaviour seem to have fixed the rest of these
tests.

Andrew Bartlett

12 years agos3-ntlmssp clarify session key behaviour after create_local_token() changes
Andrew Bartlett [Tue, 2 Aug 2011 01:29:43 +0000 (11:29 +1000)]
s3-ntlmssp clarify session key behaviour after create_local_token() changes

12 years agos3-ntlmssp Remove auth_ntlmssp_state_destructor, use the talloc tree instead
Andrew Bartlett [Tue, 2 Aug 2011 01:28:51 +0000 (11:28 +1000)]
s3-ntlmssp Remove auth_ntlmssp_state_destructor, use the talloc tree instead

12 years agoldb-samba: Explain the current behaviour of ldif_canonicalise_objectCategory
Andrew Bartlett [Mon, 1 Aug 2011 23:35:23 +0000 (09:35 +1000)]
ldb-samba: Explain the current behaviour of ldif_canonicalise_objectCategory

12 years agos3-auth directly return the result of make_server_info_guest()
Andrew Bartlett [Mon, 1 Aug 2011 23:06:22 +0000 (09:06 +1000)]
s3-auth directly return the result of make_server_info_guest()

12 years agos3-auth rename auth_ntlmssp_steal_session_info()
Andrew Bartlett [Mon, 1 Aug 2011 22:53:10 +0000 (08:53 +1000)]
s3-auth rename auth_ntlmssp_steal_session_info()

There is no longer any theft of memory as the underlying routines now
produce a new auth_session_info for this caller, allocating it
on the supplied memory context.

Andrew Bartlett

12 years agoselftest: print %U in smbclient -L output to allow testing
Andrew Bartlett [Fri, 29 Jul 2011 02:12:36 +0000 (12:12 +1000)]
selftest: print %U in smbclient -L output to allow testing

12 years agos3-smbd Be consistent with %U subs on guest logins
Andrew Bartlett [Wed, 27 Jul 2011 06:06:31 +0000 (16:06 +1000)]
s3-smbd Be consistent with %U subs on guest logins

The NTLMSSP code always specified "" as the username, and this makes
guest logins via the old-style session setup do the same.

Andrew Bartlett

12 years agoselftest: Add kerberos tests to plugin_s4_dc tests
Andrew Bartlett [Tue, 26 Jul 2011 06:17:30 +0000 (16:17 +1000)]
selftest: Add kerberos tests to plugin_s4_dc tests

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-auth use auth_generic_start to get full GENSEC in Samba3 session setup
Andrew Bartlett [Tue, 26 Jul 2011 05:11:47 +0000 (15:11 +1000)]
s3-auth use auth_generic_start to get full GENSEC in Samba3 session setup

This tests if the auth_generic_start() hook is available on the auth
context during the negprot, and if so it uses auth_generic_start() to
hook to GENSEC to handle the full SPNEGO blob.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-auth Add function to start any GENSEC mech by OID
Andrew Bartlett [Tue, 26 Jul 2011 04:40:33 +0000 (14:40 +1000)]
s3-auth Add function to start any GENSEC mech by OID

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-smbd clarify behaviour by not passing an OID that will not be used
Andrew Bartlett [Tue, 26 Jul 2011 04:12:23 +0000 (14:12 +1000)]
s3-smbd clarify behaviour by not passing an OID that will not be used

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-smbd Ensure we do not read past the end of a possible NTLMSSP blob
Andrew Bartlett [Tue, 26 Jul 2011 04:11:56 +0000 (14:11 +1000)]
s3-smbd Ensure we do not read past the end of a possible NTLMSSP blob

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-auth clarify the role of these session keys
Andrew Bartlett [Tue, 26 Jul 2011 03:46:25 +0000 (13:46 +1000)]
s3-auth clarify the role of these session keys

This comment can be clarified now the auth subsystem does not use the same
structure as the rest of the code.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-auth remove sanitized_username from auth_serversupplied_info
Andrew Bartlett [Tue, 26 Jul 2011 03:43:33 +0000 (13:43 +1000)]
s3-auth remove sanitized_username from auth_serversupplied_info

This structure element was only written to, not read.

It is filled into the companion structure, auth_session_info()
by create_local_token().

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-auth set session_info->sanitized_username in create_local_token()
Andrew Bartlett [Tue, 26 Jul 2011 03:37:36 +0000 (13:37 +1000)]
s3-auth set session_info->sanitized_username in create_local_token()

Rather than passing this value around the callers, and eventually
setting it in register_existing_vuid(), we simply pass it to
create_local_token().  This also removes the need for
auth_ntlmssp_get_username().

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp Split auth_ntlmssp_start into two functions
Andrew Bartlett [Tue, 26 Jul 2011 00:19:54 +0000 (10:19 +1000)]
s3-ntlmssp Split auth_ntlmssp_start into two functions

This helps map on to the GENSEC semantics better, and ensures that the
full set of desired features are set before the mechanism starts.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp Split calls to gensec plugin into prepare and start
Andrew Bartlett [Tue, 26 Jul 2011 00:01:39 +0000 (10:01 +1000)]
s3-ntlmssp Split calls to gensec plugin into prepare and start

GENSEC has the concept of starting the GENSEC subsystem before starting the
actual mechansim.  Between these two stages is when most context methods
are called, to specify credentials and features.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agogensec: Don't keep a second copy of the auth4_context in gensec_ntlmssp_state
Andrew Bartlett [Mon, 25 Jul 2011 07:20:45 +0000 (17:20 +1000)]
gensec: Don't keep a second copy of the auth4_context in gensec_ntlmssp_state

The auth4_context is already in the gensec_security structure, which is
available by de-reference here anyway.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp Remove auth_ntlmssp_and_flags()
Andrew Bartlett [Wed, 27 Jul 2011 03:52:27 +0000 (13:52 +1000)]
s3-ntlmssp Remove auth_ntlmssp_and_flags()

There is no need to mask out these flags as they simply are not set
yet.

The correct abstraction is to ask for NTLMSSP features.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp Remove rpccli_get_pwd_hash and auth_ntlmssp_get_nt_hash
Andrew Bartlett [Mon, 25 Jul 2011 01:21:31 +0000 (11:21 +1000)]
s3-ntlmssp Remove rpccli_get_pwd_hash and auth_ntlmssp_get_nt_hash

The session key we want here (the only one that is availble to the
encryption layer) is the one obtained by cli_get_session_key(), as
NTLMSSP creates a per-session session key via key exchange and NTLMv2
negotiation.

The key was never directly the NT hash anyway (this is simply a
mistake, the extra MD4() was lost during my previous cleanup
f28f113d8e76824b080359c90efd9c92de533740 in 2008), but was MD4(NT
hash) in early implementations of NTLMSSP.

However, regardless this call is not available on domain trusts
between AD domains and Windows 2003 R2, making this less useful.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agoselftest: Test encrypted RPC pipes against plugin_s4_dc
Andrew Bartlett [Fri, 22 Jul 2011 02:32:15 +0000 (12:32 +1000)]
selftest: Test encrypted RPC pipes against plugin_s4_dc

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agoselftest: use the s4 winbindd in plugin_s4_dc test
Andrew Bartlett [Thu, 21 Jul 2011 22:03:56 +0000 (08:03 +1000)]
selftest: use the s4 winbindd in plugin_s4_dc test

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-auth Add hook to start a GENSEC mech to auth_samba4
Andrew Bartlett [Thu, 21 Jul 2011 04:48:59 +0000 (14:48 +1000)]
s3-auth Add hook to start a GENSEC mech to auth_samba4

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp Remove auth_ntlmssp_or_flags
Andrew Bartlett [Fri, 22 Jul 2011 02:15:06 +0000 (12:15 +1000)]
s3-ntlmssp Remove auth_ntlmssp_or_flags

We now just use auth_ntlmssp_want_feature to get extra flags
on the NTLMSSP context

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp Remove calls to auth_ntlmssp_and_flags from the server
Andrew Bartlett [Fri, 22 Jul 2011 02:10:30 +0000 (12:10 +1000)]
s3-ntlmssp Remove calls to auth_ntlmssp_and_flags from the server

This is changed so that the callers ask for the additional flags
that they need, starting with no additional flags.

This helps to create a proper abstraction layer in
ntlmssp_wrap/auth_ntlmssp.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp Add mem_ctx argument to auth_ntlmssp_update
Andrew Bartlett [Tue, 26 Jul 2011 07:20:35 +0000 (17:20 +1000)]
s3-ntlmssp Add mem_ctx argument to auth_ntlmssp_update

This clarifies the lifetime of the returned token.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp NTLMSSP sealing implies signing, so set both flags
Andrew Bartlett [Wed, 27 Jul 2011 03:35:01 +0000 (13:35 +1000)]
s3-ntlmssp NTLMSSP sealing implies signing, so set both flags

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp Add hooks to optionally call into GENSEC in auth_ntlmssp
Andrew Bartlett [Wed, 27 Jul 2011 03:34:34 +0000 (13:34 +1000)]
s3-ntlmssp Add hooks to optionally call into GENSEC in auth_ntlmssp

This allows the current behaviour of the NTLMSSP code to be unchanged
while adding a way to hook in an alternate implementation via an auth
module.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp Add mem_ctx argument to auth_ntlmssp_get_session_key()
Andrew Bartlett [Tue, 2 Aug 2011 00:24:28 +0000 (10:24 +1000)]
s3-ntlmssp Add mem_ctx argument to auth_ntlmssp_get_session_key()

12 years agos3-auth Allow auth modules to provide an initialised GENSEC context
Andrew Bartlett [Thu, 21 Jul 2011 04:27:00 +0000 (14:27 +1000)]
s3-auth Allow auth modules to provide an initialised GENSEC context

This will allow auth plugins such as auth_samba4 to provide an initialised
GENSEC context to auth subsystem callers.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp Use auth_ntlmssp_*() functions in more places
Andrew Bartlett [Thu, 21 Jul 2011 09:13:59 +0000 (19:13 +1000)]
s3-ntlmssp Use auth_ntlmssp_*() functions in more places

This allows auth_ntlmssp_get_ntlmssp_state() to be removed.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp Remove unused auth_ntlmssp_get_domain()
Andrew Bartlett [Fri, 22 Jul 2011 01:41:46 +0000 (11:41 +1000)]
s3-ntlmssp Remove unused auth_ntlmssp_get_domain()

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-ntlmssp Remove unused auth_ntlmssp_get_client
Andrew Bartlett [Thu, 21 Jul 2011 09:30:28 +0000 (19:30 +1000)]
s3-ntlmssp Remove unused auth_ntlmssp_get_client

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-rpc_server use session_info to print user details
Andrew Bartlett [Thu, 21 Jul 2011 09:29:10 +0000 (19:29 +1000)]
s3-rpc_server use session_info to print user details

This is the authoritative source for what the user was actually
authenticated as.

The previous message printed only what they claimed, and the DC might
map this.

The workstation is no longer printed in the logs, as it allows
auth_ntlmssp_get_client() to be removed.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-auth Use else if in do_map_to_guest_server_info
Andrew Bartlett [Wed, 27 Jul 2011 03:20:59 +0000 (13:20 +1000)]
s3-auth Use else if in do_map_to_guest_server_info

This means we can't ever call make_server_info_guest() twice.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3-auth Move map to guest to directly after the check_password calls
Andrew Bartlett [Fri, 22 Jul 2011 01:33:52 +0000 (11:33 +1000)]
s3-auth Move map to guest to directly after the check_password calls

This means we no longer need two different map to guest functions
and have consistent logic with fewer layering violations.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agogensec: clarify memory ownership for gensec_session_info() and gensec_session_key()
Andrew Bartlett [Mon, 1 Aug 2011 05:39:01 +0000 (15:39 +1000)]
gensec: clarify memory ownership for gensec_session_info() and gensec_session_key()

This is slightly less efficient, because we no longer keep a cache on
the gensec structures, but much clearer in terms of memory ownership.
Both gensec_session_info() and gensec_session_key() now take a mem_ctx
and put the result only on that context.

Some duplication of memory in the callers (who were rightly uncertain
about who was the rightful owner of the returned memory) has been
removed to compensate for the internal copy.

Andrew Bartlett

12 years agogensec: Remove mem_ctx from calls that do not return memory
Andrew Bartlett [Thu, 21 Jul 2011 09:10:15 +0000 (19:10 +1000)]
gensec: Remove mem_ctx from calls that do not return memory

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agogensec: split GENSEC into mechanism-dependent and runtime functions
Andrew Bartlett [Thu, 21 Jul 2011 03:20:26 +0000 (13:20 +1000)]
gensec: split GENSEC into mechanism-dependent and runtime functions

The startup and runtime functions that have no dependencies are moved
into the top level.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
12 years agos3:libsmb/clifile: make use of cli_set_timeout()
Stefan Metzmacher [Tue, 2 Aug 2011 20:58:57 +0000 (22:58 +0200)]
s3:libsmb/clifile: make use of cli_set_timeout()

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Aug  3 10:16:18 CEST 2011 on sn-devel-104

12 years agos3:cli_np_tstream: make use of cli_set_timeout()
Stefan Metzmacher [Tue, 2 Aug 2011 20:56:52 +0000 (22:56 +0200)]
s3:cli_np_tstream: make use of cli_set_timeout()

metze

12 years agos3:torture: make use of cli_set_timeout()
Stefan Metzmacher [Tue, 2 Aug 2011 20:55:32 +0000 (22:55 +0200)]
s3:torture: make use of cli_set_timeout()

metze

12 years agos3:winbindd_cm: make use of cli_set_timeout()
Stefan Metzmacher [Tue, 2 Aug 2011 20:55:00 +0000 (22:55 +0200)]
s3:winbindd_cm: make use of cli_set_timeout()

metze

12 years agos3:libsmb/clidfs: make use of cli_state_encryption_on()
Stefan Metzmacher [Tue, 2 Aug 2011 20:54:28 +0000 (22:54 +0200)]
s3:libsmb/clidfs: make use of cli_state_encryption_on()

metze

12 years agos4-libcli: Fix the fd leak. Close open file descriptor before return.
Amitay Isaacs [Wed, 3 Aug 2011 00:50:31 +0000 (10:50 +1000)]
s4-libcli: Fix the fd leak. Close open file descriptor before return.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Aug  3 07:49:12 CEST 2011 on sn-devel-104

12 years agosamba-tool: Rename samba-tool command gpo2 --> gpo
Amitay Isaacs [Tue, 2 Aug 2011 23:37:04 +0000 (09:37 +1000)]
samba-tool: Rename samba-tool command gpo2 --> gpo

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agosamba-tool: Remove C version of samba-tool
Amitay Isaacs [Tue, 2 Aug 2011 23:21:21 +0000 (09:21 +1000)]
samba-tool: Remove C version of samba-tool

Python version of samba-tool has now implemented all the commands
from C version and more.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agosamba-tool: Add implementation of gpo create command
Amitay Isaacs [Tue, 2 Aug 2011 06:13:43 +0000 (16:13 +1000)]
samba-tool: Add implementation of gpo create command

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agosamba-tool: Add functions to create directories and copy files over SMB share
Amitay Isaacs [Tue, 2 Aug 2011 06:13:01 +0000 (16:13 +1000)]
samba-tool: Add functions to create directories and copy files over SMB share

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agos4-libcli: get_acl and set_acl require raw_open to set security descriptor
Amitay Isaacs [Tue, 2 Aug 2011 06:10:21 +0000 (16:10 +1000)]
s4-libcli: get_acl and set_acl require raw_open to set security descriptor

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agos4-libcli: Check if short_name is not null, before converting to python string
Amitay Isaacs [Tue, 2 Aug 2011 06:07:43 +0000 (16:07 +1000)]
s4-libcli: Check if short_name is not null, before converting to python string

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agos4-libcli: Replace smb_composite_connect() with smb_full_connection()
Amitay Isaacs [Tue, 2 Aug 2011 06:04:52 +0000 (16:04 +1000)]
s4-libcli: Replace smb_composite_connect() with smb_full_connection()

Python smb connection now uses smb_full_connection method.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agos4-policy: Use the correct local directory for stat.
Amitay Isaacs [Tue, 2 Aug 2011 05:13:36 +0000 (15:13 +1000)]
s4-policy: Use the correct local directory for stat.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agosamba-tool: Rename copy_directory_recurse to copy_directory_remote_to_local
Amitay Isaacs [Mon, 1 Aug 2011 05:47:10 +0000 (15:47 +1000)]
samba-tool: Rename copy_directory_recurse to copy_directory_remote_to_local

gpo fetch is remote->local and gpo create is local->remote
local is local filesystem and remote is smb share.
Need two functions to copy local->remote and remote->local.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agosamba-tool: Addd functions to print GPO flags and GPlink options
Amitay Isaacs [Mon, 1 Aug 2011 05:41:19 +0000 (15:41 +1000)]
samba-tool: Addd functions to print GPO flags and GPlink options

Use methods from python wrapper to convert gpo flags and gplink
options to string.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agos4-policy: Add python wrapper for ads_to_dir_access_mask() function
Amitay Isaacs [Mon, 1 Aug 2011 05:35:32 +0000 (15:35 +1000)]
s4-policy: Add python wrapper for ads_to_dir_access_mask() function

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agos4-policy: Expose gp_ads_to_dir_access_mask() function
Amitay Isaacs [Mon, 1 Aug 2011 04:51:25 +0000 (14:51 +1000)]
s4-policy: Expose gp_ads_to_dir_access_mask() function

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agos4-libcli: Added python SMB methods for mkdir(), rmdir(), chkpath()
Amitay Isaacs [Fri, 29 Jul 2011 06:17:49 +0000 (16:17 +1000)]
s4-libcli: Added python SMB methods for mkdir(), rmdir(), chkpath()

Updated docstrings for all methods.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agopyldb: return a copy of key constant DNs via python interface
Andrew Tridgell [Mon, 1 Aug 2011 02:39:48 +0000 (12:39 +1000)]
pyldb: return a copy of key constant DNs via python interface

this prevents an easy coding error where the caller modifies one of
the key DNs for the database, by using an add_child function or
similar

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
12 years agoWe don't need check_name() here. All possible paths to dptr_create()
Jeremy Allison [Tue, 2 Aug 2011 23:25:22 +0000 (16:25 -0700)]
We don't need check_name() here. All possible paths to dptr_create()
have already called check_name.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Aug  3 03:00:55 CEST 2011 on sn-devel-104

12 years agos3: Fix smb2 handling error returns from aio
Volker Lendecke [Tue, 2 Aug 2011 19:16:26 +0000 (21:16 +0200)]
s3: Fix smb2 handling error returns from aio

Found when reading with aio_fork beyond the end of file.

Metze, Jeremy, please check!

Without this we get

[2011/08/02 21:02:54.082661,  0] lib/util.c:778(smb_panic_s3)
  PANIC (pid 2302): smbd/smb2_read.c:593: Type mismatch: name[NULL] expected[struct smbd_smb2_read_state]
[2011/08/02 21:02:54.094316,  0] lib/util.c:882(log_stack_trace)
  BACKTRACE: 23 stack frames:
   #0 bin/smbd(log_stack_trace+0x2d) [0xb72873d8]
   #1 bin/smbd(smb_panic_s3+0x7c) [0xb7287529]
   #2 bin/smbd(smb_panic+0x2f) [0xb7277e1f]
   #3 /root/git/s3-work/source3/bin/libtalloc.so.2 [0xb6c6bc48]
   #4 /root/git/s3-work/source3/bin/libtalloc.so.2 [0xb6c6ec79]
   #5 /root/git/s3-work/source3/bin/libtalloc.so.2(_talloc_get_type_abort+0x34) [0xb6c6ecb3]
   #6 bin/smbd [0xb6fbc405]
   #7 bin/smbd(_tevent_req_notify_callback+0x4a) [0xb729a85a]
   #8 bin/smbd [0xb729a888]
   #9 bin/smbd(_tevent_req_done+0x19) [0xb729aa73]
   #10 bin/smbd [0xb6fae517]
   #11 bin/smbd [0xb6fad258]
   #12 bin/smbd(smbd_aio_complete_aio_ex+0xf5) [0xb6fad6e8]
   #13 /root/git/inst/modules/vfs/aio_fork.so [0xb66d4992]
   #14 bin/smbd(run_events_poll+0x400) [0xb7297df2]
   #15 bin/smbd(smbd_process+0xd75) [0xb6f9d3a7]
   #16 bin/smbd [0xb756f07b]
   #17 bin/smbd(run_events_poll+0x400) [0xb7297df2]
   #18 bin/smbd [0xb7298254]
   #19 bin/smbd(_tevent_loop_once+0x9e) [0xb72986ac]
   #20 bin/smbd(main+0x185c) [0xb7570e59]
   #21 /lib/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb6b08455]
   #22 bin/smbd [0xb6f14e01]

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Aug  2 22:33:15 CEST 2011 on sn-devel-104