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

1066 Commits

Author SHA1 Message Date
Andrew Bartlett
ad0a07c531 s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
d5e6a47f06 s3-talloc Change TALLOC_P() to talloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
73b377432c s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_REALLOC_ARRAY isn't standard talloc.

Andrew Bartlett
2011-06-09 12:40:08 +02:00
Jeremy Allison
e98fb2f2b9 Remove another PATH_MAX.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Jun  2 02:51:06 CEST 2011 on sn-devel-104
2011-06-02 02:51:06 +02:00
Andrew Bartlett
7630e73dac s3-param prepare for some lp_ functions to return const 2011-06-01 04:19:05 +02:00
Michael Adam
72f2bd6a86 s3:libads/ndr: include ../librpc/ndr/libndr.h instead of librpc/ndr/util.h 2011-05-31 12:54:22 +02:00
Michael Adam
4c542015a1 s3:libads/kerberos_proto.h: add _LIBADS_KERBEROS_PROTO_H_ guard 2011-05-31 01:44:27 +02:00
Michael Adam
6bf3228f28 s3:libads/kerberos_proto.h: add GPL/Copyright header 2011-05-31 01:44:27 +02:00
Michael Adam
eb5db22771 s3:libads/ads_proto.h: add _LIBADS_ADS_PROTO_H_ guard 2011-05-31 01:44:27 +02:00
Michael Adam
6e9c055ce2 s3:libads/ads_proto.h: add GPL/Copyright header 2011-05-31 01:44:27 +02:00
Andrew Bartlett
c615ebed6e s3-lib Replace StrCaseCmp() with strcasecmp_m()
strcasecmp_m() never needs to call to talloc, and via next_codepoint()
still has an ASCII fast-path bypassing iconv() calls.

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Günther Deschner
1e208a7057 s3-includes: no need to globally include libads/ads_status.h.
Guenther
2011-05-06 16:37:22 +02:00
Jeremy Allison
f85e095dd2 More simple const fixups. 2011-05-05 23:56:08 +02:00
Jeremy Allison
e131c94ac1 More const fixes for compiler warnings from the waf build. 2011-05-05 23:56:07 +02:00
Günther Deschner
653b84d2d6 s3-libads: run minimal_includes.pl.
Guenther
2011-05-05 02:05:26 +02:00
Andrew Bartlett
5cc7a3a222 s3-libads Move variables into if (socket_wrapper_dir()) where they are used. 2011-04-29 16:38:12 +10:00
Andrew Bartlett
a427652010 s3-libads: Use ldap_init_fd() to connect to AD server in socket_wrapper
This means that we control the connection setup, don't rely on signals
for timeouts and the connection uses socket_wrapper where that is
required in our test environment.

According to bug reports, this method is also used by curl and other
tools, so we are not the first to (ab)use the OpenLDAP libs in this
way.

It is ONLY enabled for socket_wrapper at this time, as this is the
best way to get 'make test' working for S3 winbind tests in an S4
domain.

Andrew Bartlett
2011-04-28 05:30:21 +02:00
Andrew Bartlett
818ec32d0c s3-libads Pass a struct sockaddr_storage to cldap routines
This avoids these routines doing a DNS lookup that has already been
done, and ensures that the emulated DNS lookup isn't thrown away.

Andrew Bartlett
2011-04-28 05:30:20 +02:00
Andrew Bartlett
e130dec97b s3-libsmb Use 'resolv:hosts file' as a DNS emulation when specified.
This allows make test to operate without making real DNS calls.

Andrew Bartlett
2011-04-27 11:40:18 +10:00
Andrew Bartlett
806eef63ba s3-libads Don't start a DEBUG with 'time'
This strange requirement comes from our subunit test harness.

Andrew Bartlett
2011-04-27 11:25:53 +10:00
Andrew Bartlett
ccb62947e9 s3-libads Remove KRB5_DNS_HACK
We have winbindd write a custom krb5.conf or use a kdc locator plugin
to do this properly now.

Andrew Bartlett
2011-04-26 17:16:34 +10:00
Andrew Bartlett
c18954775e libcli/dns Improve dns_hosts_file, using Samba3's struct dns_rr_srv
By reworking the 'fake DNS' file to use struct dns_rr_srv it should be
possible to emulate that resolver layer as well as the Samba4
sockaddr_storage* based layer.  This will then give us a common DNS
emulation for 'make test'.

Andrew Bartlett
2011-04-26 17:16:34 +10:00
Volker Lendecke
f9e3af71d3 s3: Fix Coverity ID 2336, NULL_RETURNS 2011-04-22 10:06:36 +02:00
Andrew Bartlett
f28f5db15a libcli/auth Move PAC parsing and verification in common.
This uses the source3 PAC code (originally from Samba4) with some
small changes to restore functionality needed by the torture tests,
and to have a common API.

Andrew Bartlett
2011-04-20 04:31:07 +02:00
Günther Deschner
6768b65123 s3-waf: try to fix the non-ldap-but-krb5 build.
Guenther
2011-04-15 12:37:55 +02:00
Günther Deschner
9824e2e5ee s3-rpc_client: add and use rpc_client/rpc_client.h.
Guenther
2011-04-13 22:23:59 +02:00
Günther Deschner
a730dff783 s3-libndr: add ../librpc/ndr/libndr.h include in some places.
Guenther
2011-03-31 00:14:01 +02:00
Günther Deschner
49ccae1c20 s3-includes: no point in including all security headers globally.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
2639f0b3ab s3-prototypes: remove protos of some dead functions.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Mar 24 00:52:01 CET 2011 on sn-devel-104
2011-03-24 00:52:01 +01:00
Volker Lendecke
8dc93bed09 s3: Fix Coverity ID 770, REVERSE_INULL
We dereference "res" in various places, no point in checking. All current
callers send "res!=NULL".
2011-03-21 15:40:10 +01:00
Günther Deschner
3aa9d3005a s3-build: only include asn1 headers where actually needed.
Guenther
2011-03-16 23:46:18 +01:00
Günther Deschner
fad0112373 s3-build: stop including ldap and lber headers everywhere in the code.
Instead use new header smb_ldap.h where all LDAP API related things are handled,
while smbldap.h only deals with our smbldap_X() API.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Mar 16 10:54:51 CET 2011 on sn-devel-104
2011-03-16 10:54:50 +01:00
Volker Lendecke
16b007c223 Quite some callers of sid_split_rid do not care about the rid 2011-03-10 18:48:34 +01:00
Volker Lendecke
32731db56f s3: Fix some nonempty blank lines 2011-02-27 19:27:44 +01:00
Günther Deschner
bc1312303d s3-libads: make ndr_print_ads_auth_flags() static.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Feb 25 01:55:26 CET 2011 on sn-devel-104
2011-02-25 01:55:26 +01:00
Andrew Bartlett
0bad0e3ff2 s3-libads Remove MIT-specific krb5_princ_realm macro calls.
When compiled against heimdal, we need to use a more elegant API.

Andrew Bartlett
2011-02-18 17:00:34 +11:00
Günther Deschner
f076c76260 s3-libads: make ads_guess_service_principal static.
Guenther
2011-02-11 12:22:41 +01:00
Günther Deschner
fdd4d56405 s3: give ../librpc/ndr/util.c its own header.
Guenther
2011-02-10 12:58:06 +01:00
Stefan Metzmacher
a34aa148ca s3:libads: use dcerpc_spoolss_X() functions
metze

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-01-21 12:30:22 +01:00
Volker Lendecke
8c6b0b61e5 s3: Fix some nonempty blank lines
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Jan 12 19:04:25 CET 2011 on sn-devel-104
2011-01-12 19:04:24 +01:00
Günther Deschner
3294ccbb6d netlogon: move netlogon helpers to ../libcli/netlogon.
Guenther
2011-01-07 15:02:24 +01:00
Andrew Bartlett
bb7806283e s3-libads Default to NOT using the server-supplied principal from SPNEGO
This principal is not supplied by later versions of windows, and using
it opens up some oportunities for man in the middle attacks.  (Becuase
it isn't the name being contacted that is verified with the KDC).

This adds the option 'client use spnego principal' to the smb.conf (as
used in Samba4) to control this behaivour.  As in Samba4, this
defaults to false.

Against 2008 servers, this will not change behaviour.  Against earlier
servers, it may cause a downgrade to NTLMSSP more often, in
environments where server names are not registered with the KDC as
servicePrincipalName values.

Andrew Bartlett
2010-12-10 16:08:30 +11:00
Volker Lendecke
da75c01762 s3: Remove unused ads_get_attrname_by_oid 2010-11-20 14:42:44 +01:00
Volker Lendecke
d14cf7a50b s3: Make ads_get_attrnames_by_oids static 2010-11-20 14:42:44 +01:00
Volker Lendecke
491fdb24e4 s3: Make ads_ranged_search_internal static 2010-11-20 14:42:44 +01:00
Volker Lendecke
365116ea92 s3: Fix some nonempty blank lines 2010-11-20 14:42:44 +01:00
Volker Lendecke
b3091e0e22 s3: Remove unused ads_search_retry_extended_dn 2010-11-20 14:42:44 +01:00
Volker Lendecke
cdf52d56d5 s3: Make ads_do_search_retry_args() static 2010-11-20 14:42:44 +01:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Jeremy Allison
d8814b1a48 Fix bug 7694 - Crash bug with invalid SPNEGO token.
Found by the CodeNomicon test suites at the SNIA plugfest.

http://www.codenomicon.com/

If an invalid SPNEGO packet contains no OIDs we crash in the SMB1/SMB2 server
as we indirect the first returned value OIDs[0], which is returned as NULL.

Jeremy.
2010-09-23 21:44:24 -07:00
Andrew Bartlett
03011bf118 s3-libads call common GUID_from_ndr_blob()
This does a length-limited check, and so avoids reading beyond the
allocated memory if the server sends less than 16 bytes.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-09-20 16:15:11 -07:00
Andrew Bartlett
d7bc452a89 s3: Replace sid_binstring and sid_guidstring with PIDL-based alternatives
This reduces the manual marshalling of these structures by removing
the duplication here.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-09-20 16:15:03 -07:00
Günther Deschner
62544c5d2b s3-build: only include smbldap.h where needed.
Guenther
2010-09-20 13:54:56 -07:00
Jeremy Allison
447d96878a Fix all sid_parse returns to be checked. Tidy up some checks and error
messages.

Jeremy.
2010-09-15 15:40:15 -07:00
Jeremy Allison
718fd39f10 Fox missing SMB_MALLOC return checks noticed by "Andreas Moroder <andreas.moroder@gmx.net>".
Jeremy.
2010-09-09 15:29:03 -07:00
Björn Jacke
5b016dbab8 s3/libads: use monotonic clock for ldap connection timeouts 2010-09-07 20:37:53 +02:00
Björn Jacke
a63822f5d2 s3/libads: use monotonic clock for DNS timeouts 2010-09-07 20:29:13 +02:00
Günther Deschner
bf3912be46 s3-libads: avoid crashing in ads_keytab_list().
Heimdal's krb5_kt_start_seq_get() will leave a non 0 fd in the krb5_kt_cursor
struct when it cannot find a given keytab.

Guenther
2010-08-31 23:17:39 +02:00
Simo Sorce
26e24928b3 s3-krb: Reformat and add doxygen comment to decode_pac_data()
Signed-off-by: Günther Deschner <gd@samba.org>
2010-08-30 14:26:37 +02:00
Simo Sorce
cbe9f879af s3-ads: Fix wrong test in if statement 2010-08-19 11:28:12 -04:00
Simo Sorce
1ab17f13a2 s3-ads: Remove unused wrapper and make function static 2010-08-18 09:37:56 -04:00
Simo Sorce
71dfa62b61 s3-ads: cleanup ads_keytab_list() 2010-08-18 07:47:10 -04:00
Simo Sorce
64d8300a56 s3-ads: cleanup ads_keytab_create_default() 2010-08-18 07:47:10 -04:00
Simo Sorce
3a9912370d s3-ads: cleanup ads_keytab_add_entry() 2010-08-18 07:47:10 -04:00
Simo Sorce
d6d1ed8bdf s3-ads: Split, simplify and cleanup keytab functions
add helper function for both smb_krb5_kt_add_entry_ext() and
ads_keytab_flush()
2010-08-18 07:47:09 -04:00
Simo Sorce
0a89722671 s3-ads: Remove unused function and file 2010-08-17 06:48:56 -04:00
Andrew Bartlett
71d80e6be0 s3-krb5 Only build ADS support if arcfour-hmac-md5 is available
Modern Kerberos implementations have either defines or enums for these
key types, which makes doing #ifdef difficult.  This shows up in files
such as libnet_samsync_keytab.c, the bulk of which is not compiled on
current Fedora 12, for example.

The downside is that this makes Samba unconditionally depend on the
arcfour-hmac-md5 encryption type at build time.  We will no longer
support libraries that only support the DES based encryption types.
However, the single-DES types that are supported in common with AD are
already painfully weak - so much so that they are disabled by default
in modern Kerberos libraries.

If not found, ADS support will not be compiled in.

This means that our 'net ads join' will no longer set the
ACB_USE_DES_KEY_ONLY flag, and we will always try to use
arcfour-hmac-md5.

A future improvement would be to remove the use of the DES encryption
types totally, but this would require that any ACB_USE_DES_KEY_ONLY
flag be removed from existing joins.

Andrew Bartlett

Signed-off-by: Simo Sorce <idra@samba.org>
2010-08-13 09:08:27 -04:00
Günther Deschner
257a1f1097 s3-krb5: include krb5pac.h where needed.
Guenther
2010-08-06 15:43:37 +02:00
Günther Deschner
c136b84f0d s3-secrets: only include secrets.h when needed.
Guenther
2010-08-05 10:12:25 +02:00
Günther Deschner
e7a6a3ec0d s3: avoid global include of ads.h.
Guenther
2010-08-05 00:32:02 +02:00
Günther Deschner
9e0000224a s3-printing: remove unused get_local_printer_publishing_data() call.
Guenther
2010-07-31 00:54:45 +02:00
Günther Deschner
813fbbd68c s3-build: avoid to globally include printing and spoolss headers.
This shrinks precompiled headers by 3MB and will slightly speed up any build.

Guenther
2010-07-31 00:50:31 +02:00
Simo Sorce
28c74564c5 cleanups: Trailing spaces, line length, etc... 2010-07-30 16:34:53 -04:00
Simo Sorce
26f1218a36 s3-libsmb: Use data_blob_talloc to get krb5 ticket and session keys 2010-07-20 20:02:09 -04:00
Jeremy Allison
5002b3a90d Add approriate TALLOC_CTX's thoughout the spnego code. No more implicit NULL contexts.
Jeremy.
2010-07-20 16:17:58 -07:00
Jeremy Allison
cce19c5162 Fix one more data_blob -> data_blob_talloc. Move away from implicit NULL context tallocs.
Jeremy.
2010-07-20 14:59:31 -07:00
Jeremy Allison
4ed9437b7e Add TALLOC_CTX argument to spnego_parse_negTokenInit, reduce
use of malloc, and data_blob().

Jeremy.
2010-07-20 13:35:43 -07:00
Jeremy Allison
7d17bfcf51 Rename spnego_gen_negTokenTarg() -> spnego_gen_krb5_negTokenInit()
as this correctly describes what this function does.

Jeremy.
2010-07-20 11:14:49 -07:00
Jeremy Allison
8a882b645c Remove gen_negTokenTarg(), as it's not actually creating a TokenTarg frame, but a TokenInit one.
Move to using spnego_gen_negTokenInit() instead.

Jeremy
2010-07-20 11:04:19 -07:00
Jeremy Allison
0bb8d133c9 Remove gen_negTokenInit() - change all callers to spnego_gen_negTokenInit().
We now have one function to do this in all calling code. More rationalization
to follow.

Jeremy.
2010-07-19 17:14:26 -07:00
Jeremy Allison
625a511389 Remove parse_negTokenTarg(), as it's actually incorrect. We're processing
negTokenInit's here. Use common code in spnego_parse_negTokenInit().

Jeremy.
2010-07-19 15:41:45 -07:00
Simo Sorce
cdcdaaa6dd s3-ntlmssp: Remove ntlmssp_end and let the talloc hierarchy handle it.
All the members are children of ntlmssp_state anyway.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 14:19:47 +10:00
Günther Deschner
04641abb33 s3-libads: move ldap posix schema defines to their own header file.
Guenther
2010-07-01 23:20:40 +02:00
Günther Deschner
dff7be8ccb s3-libads: only include libds flags where needed.
Guenther
2010-07-01 23:20:40 +02:00
Günther Deschner
56538be6af s3-libads: move ads_dns out of main includes.
Guenther
2010-07-01 23:20:40 +02:00
Günther Deschner
e64df82146 s3-libads: move ads_status to a separate header file.
Guenther
2010-07-01 23:20:39 +02:00
Günther Deschner
6b25d47fea s3-libads: move ads_protos.h to ads_ldap_protos.h.
Guenther
2010-07-01 23:20:39 +02:00
Günther Deschner
eb634e8c7f s3-libnet_join: small IDL enhancement.
Guenther
2010-07-01 21:19:52 +02:00
Günther Deschner
2f9076ac29 s3-libads: use shared well known guids.
Guenther
2010-07-01 21:17:17 +02:00
Günther Deschner
614e010daa s3: remove authdata.h
Guenther
2010-06-03 11:00:27 +02:00
Günther Deschner
ce85181430 s3: remove rpc_secdes.h completely.
Guenther
2010-06-03 11:00:26 +02:00
Matthieu Patou
57ab910b6f s3: Allow previous password to be stored and use it to check tickets
This patch is to fix bug 7099. It stores the current password in the
 previous password key when the password is changed. It also check the
 user ticket against previous password.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-06-02 14:32:23 +02:00
Andrew Bartlett
d6fa371b92 s3:ntlmssp Use a TALLOC_CTX for ntlmssp_sign_packet() and ntlmssp_seal_packet()
This ensures the results can't be easily left to leak.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:11:27 +02:00
Andrew Bartlett
ebae21f023 ntlmssp: Make the ntlmssp.h from source3/ a common header
The code is not yet in common, but I hope to fix that soon.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:10:56 +02:00
Günther Deschner
82e140c045 s3: use shared security defines.
Guenther
2010-05-31 11:53:00 +02:00
Günther Deschner
fbb7814f91 s3: only use netlogon/nbt header when needed.
Guenther
2010-05-31 11:32:37 +02:00
Günther Deschner
6d194756e0 s3-build: use ndr_misc.h where needed.
Guenther
2010-05-28 02:49:36 +02:00
Günther Deschner
ab707cb9b3 s3-printing: fix buildwarning in publishing code after registry changes.
Guenther
2010-05-26 15:14:20 +02:00