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

670 Commits

Author SHA1 Message Date
Andrew Bartlett
8d7be8af79 build: Make util_reg subsystem in libcli/registry a library 2011-05-18 16:12:08 +02:00
Andrew Bartlett
2fc342c20a waf-build: Add more libraries to avoid duplicate symbols
The new source of duplicates is calling libnetapi from inside smbtorture.

Andrew Bartlett
2011-05-18 16:12:07 +02:00
Günther Deschner
18d3b85c40 libcli/auth/krb5_wrap: correctly use discard_const().
Jeremy, please check.

Guenther
2011-05-13 00:11:41 +02:00
Michael Adam
cd1d75c7a4 libcli/auth/smbencrypt: in E_deshash, use talloc_stackframe instead of "#if _SAMBA_BUILD_ == 3" and talloc_tos()
talloc_stackframe() is used in other shared components already,
and if the stack is a talloc_pool, then in most cases, it should
also not be more expensive than directly using talloc_tos().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu May 12 12:52:02 CEST 2011 on sn-devel-104
2011-05-12 12:52:02 +02:00
Michael Adam
75f289d30e libcli/auth: fix "no talloc stackframe around" message from the samba4.blackbox.kinit test
create_kerberos_key_from_string_direct() used talloc_tos() directly.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2011-05-10 21:59:38 +02:00
Andrew Bartlett
22cb631b4f s4-interfaces Rename interfaces code so not to conflict with source3/
The iface_count, iface_n_bcast, and load_interfaces functions
conflicted with functions of the same name in source3, so the source4
functions were renamed.  Hopefully we can actually wrap one around the
other in future.

Andrew Bartlett
2011-05-08 12:57:04 +02:00
Günther Deschner
03b9a9938b libcli/security: fix build warning, cr_descr_log_acl() is not used currently.
Guenther
2011-05-06 10:48:11 +02:00
Andrew Bartlett
e3b858496f libcli/smb Move cifs posix helper functions and headers in common
unix_perms_to_wire() was a duplicate symbol in the top level build.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Bartlett
cad704e836 errors: Remove unused unix_to_werror() 2011-05-06 07:51:24 +02:00
Andrew Bartlett
db74cad1c6 libcli/util Move NTSTATUS table to the top level 2011-05-06 07:51:24 +02:00
Andrew Bartlett
344eb08ee4 nterr: Add mem_ctx for return string from get_nt_error_c_code()
It is clearer to avoid the implicit return on talloc_tos()

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Bartlett
f1ec28827f libcli/util Merge ntstatus_to_dos() ntstatus_to_werror() to the top level
This takes the Samba4 version, with the NT_STATUS_IS_DOS() check.
This will be used in smbd/error.c shortly.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Bartlett
1475013963 lib/util Move source3 tdb_wrap_open() into the common code.
This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in
the top level build, these options are not available for these
databases.  However, having two different tdb_wrap lists is a worse
fate, so this will do for now.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Jeremy Allison
7d6ebe0de7 More const fixes. Remove CONST_DISCARD. 2011-05-06 01:44:07 +02:00
Jeremy Allison
df023b8657 Tidy up some missing checks for NULL in strlcpy. 2011-05-04 12:12:15 -07:00
Jeremy Allison
017e0c8d95 Fix simple uses of safe_strcpy -> strlcpy. Easy ones where we just remove -1. 2011-05-04 12:12:13 -07:00
Andrew Bartlett
7261a9b9f7 s4-libcli Remove resolve_name() as it conflicts with Samba3.
This was just a wrapper around resolve_name_ex(), so just call that
instead.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Günther Deschner
89ceb48978 libcli/named_pipe_auth: add forward declaration in npa_tstream.h.
Guenther
2011-05-02 15:03:43 +02:00
Stefan Metzmacher
aae1f86952 libcli/util/ntstatus: NO_S4U_PROT_SUPPORT and CROSSREALM_DELEGATION_FAILURE
metze
2011-05-02 13:58:22 +02:00
Andrew Bartlett
f96793142d build: put doserr.c into it's own subsystem, so it's no longer a duplicate
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Apr 29 10:00:32 CEST 2011 on sn-devel-104
2011-04-29 10:00:32 +02:00
Andrew Bartlett
6021af4fd3 libcli/smb Move attrib_string in common 2011-04-29 16:38:14 +10:00
Andrew Bartlett
9f75b7cbb3 libcli/smb Move FILE_ATTRIBUTE defines to the top level 2011-04-29 16:38:12 +10:00
Andrew Bartlett
f0ce322c77 auth/kerberos Move all the PAC handling functions to auth/kerberos 2011-04-27 11:56:48 +10:00
Andrew Bartlett
6ec4306f8c auth/kerberos: Create common helper to get the verified PAC from GSSAPI
This only works for Heimdal and MIT Krb5 1.8, other versions will get
an ACCESS_DEINED error.

We no longer manually verify any details of the PAC in Samba for
GSSAPI logins, as we never had the information to do it properly, and
it is better to have the GSSAPI library handle it.

Andrew Bartlett
2011-04-27 11:56:48 +10:00
Andrew Bartlett
e04bab4a19 libcli/auth Move Samba4's gssapi_error_string from GENSEC to libcli/auth
This will allow the GSSAPI PAC fetch code to use it.

Andrew Bartlett
2011-04-27 11:21:37 +10:00
Andrew Bartlett
0840d5bb8b libcli/auth Allow parsing of a PAC that is already verified.
By making the verification parameters optional, we can parse a PAC
that is already verified.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Apr 26 10:06:59 CEST 2011 on sn-devel-104
2011-04-26 10:06:58 +02: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
Jelmer Vernooij
93179239eb Add missing dependency on com_err.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Apr 23 16:53:03 CEST 2011 on sn-devel-104
2011-04-23 16:53:03 +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
Andrew Bartlett
0e5482c791 libcli/auth: Move more kerberos wrapping in common
These functions are required to get the krb5 PAC parsing and
verfication in common.

Andrew Bartlett
2011-04-20 04:31:07 +02:00
Andrew Bartlett
32c12cc279 libcli/auth Fix compile on hosts without krb5
Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Apr 14 11:08:49 CEST 2011 on sn-devel-104
2011-04-14 11:08:49 +02:00
Andrew Bartlett
4ba1375526 libcli/auth Move krb5 wrapper functions from s3 into common
This requires a small rework of the build system to ensure that the
correct #define statements are made in both the s3 and top level
builds.  We now define the various HAVE_ macros in config.h at all
times, using heimdal_build/wscript_configure when that is in use.

Andrew Bartlett
2011-04-14 16:38:26 +10:00
Andrew Bartlett
35fca85660 libcli/ldap Re-add ldap_ndr.h as a public header
as noticed by Brad Hards

Andrew Bartlett
2011-04-14 12:22:59 +10:00
Christian Ambach
96a49d23a4 libcli: allow exclusion of netbios name in NTLMV2 blob
when no hostname is given, leave away the MsvAvNbComputerName part
of the ntlmv2 blob

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-04-14 01:32:22 +02:00
Volker Lendecke
d4c693df98 Add dom_sid_parse_endp
This returns a pointer to the first non-parsed character, along the lines of
strtoul for example.

Signed-off-by: Jeremy Allison <jra@samba.org>
2011-04-13 14:13:24 -07:00
Volker Lendecke
111f4ec8b7 s3: Use talloc_tos() in the S3 build
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Apr 13 09:30:55 CEST 2011 on sn-devel-104
2011-04-13 09:30:55 +02:00
Andrew Bartlett
bf431fbedb libcli/auth Use convert_string_error to check LM hash calculation.
This allows us to know if the LM hash was built correctly or not.

NOTE: talloc_tos() is not available in the common code at this time.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:08 +10:00
Andrew Bartlett
5694ba507c libcli/ldap pull LIBCLI_LDAP_MESSAGE and LIBCLI_LDAP_NDR into a library
This reduces symbol duplication

Andrew Bartlett
2011-04-13 11:47:36 +10:00
Günther Deschner
9c6f78aae1 s3: add some forward declarations.
Guenther
2011-04-12 12:20:43 +02:00
Andrew Tridgell
5adf85e6af tstream: make npa_tstream a private library
this prevents symbol duplication of the npa_tstream symbols

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-04-06 08:12:19 +02:00
Andrew Tridgell
a8da13cd5c lib: make asn1_util a private library
this prevents symbol duplication of the asn1 symbols in the service
and ntvfs subsystems

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-04-06 08:12:19 +02:00
Andrew Bartlett
457c665be2 libcli/nbt Cope with blank lines in DNS hosts file 2011-04-06 12:34:57 +10:00
Andrew Bartlett
663dc94e63 auth: Move auth_session_info into IDL
This changes auth_session_info_transport to just be a wrapper, rather
than a copy that has to be kept in sync.

As auth_session_info was already wrapped in python, this required
changes to the existing pyauth wrapper and it's users.

Andrew Bartlett
2011-04-05 23:46:04 +02:00
Günther Deschner
0a250f4946 registry: create and use shared libcli/registry/util_reg.h header.
Guenther
2011-03-30 01:13:07 +02:00
Jeremy Allison
0c5214e2eb Ensure convert_string_XXX is always called with a valid converted_size pointer.
Preparation for cleaning up this API.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Mar 29 21:01:49 CEST 2011 on sn-devel-104
2011-03-29 21:01:49 +02:00
Jeremy Allison
52602e4f5a Fix inspired by work done by David Disseldorp for bug #8040 - smbclient segfaults when a Cyrillic netbios name or workgroup is configured.
Change msrpc_gen to return NTSTATUS and ensure everywhere this is
used it is correctly checked to return that status.

Jeremy.
2011-03-28 23:12:07 +02:00
Volker Lendecke
8db0374251 s3: Fix Coverity ID 682: NEGATIVE_RETURNS 2011-03-27 22:22:10 +02:00
Andrew Tridgell
5a20325c86 libcli: created smb_constants.h
this starts the (long!) process of moving some of the SMB constants
into common files. This just moves the FLAGS2_ defines, which are
needed for common string routines (for FLAGS2_UNICODE_STRINGS)
2011-03-25 04:37:06 +01:00
Andrew Tridgell
15e84a9a09 charcnv: removed the allow_badcharcnv and allow_bad_conv options to convert_string*()
we shouldn't accept bad multi-byte strings, it just hides problems

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104
2011-03-24 01:47:26 +01:00
Stefan Metzmacher
4928d66fc2 libcli/security: make sure that we don't grant SEC_STD_DELETE to the owner by default
In the file server SEC_STD_DELETE is granted on the file/directory
or by FILE_DELETE_CHILD on the parent directory.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Mar 21 23:25:05 CET 2011 on sn-devel-104
2011-03-21 23:25:05 +01:00
Matthieu Patou
d772b8e780 ldapcli: allocate control value on the control object not on the control container 2011-03-20 11:27:25 +01:00
Jelmer Vernooij
fa387825e2 libcli/: Fix prototypes for all functions. 2011-03-19 03:20:05 +01:00
Günther Deschner
e1f84330ba libcli/security: move display_sec headers to own header file and add to
security.h grouping header.

Guenther
2011-03-16 10:11:08 +01:00
Andrew Tridgell
73e7b72936 libcli: openchange doesn't need these headers any more
thanks to Simo for pointing this out

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Mar 16 00:25:10 CET 2011 on sn-devel-104
2011-03-16 00:25:10 +01:00
Andrew Tridgell
b2b41a5087 libcli: protect access_check.h against double inclusion
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Mar 15 05:07:01 CET 2011 on sn-devel-104
2011-03-15 05:07:01 +01:00
Andrew Tridgell
6c6ab50a40 waf: build substituted public headers in build tree
the bin/default/include/public directory will contain headers that are
ready to install
2011-03-15 12:22:19 +11: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
be3e851fea Fix some nonempty blank lines
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Mar  5 15:16:02 CET 2011 on sn-devel-104
2011-03-05 15:16:02 +01:00
Volker Lendecke
70517477f8 Add dom_sid_string_buf
This prints into a fixed buffer with the same overflow semantics as snprintf
has: Return required string length, regardless of whether it fit or not.
2011-03-03 22:08:49 +01:00
Andrew Bartlett
86aa05e860 libcli/security Add unix_token and unix_info to auth_session_info too
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Mar  1 07:13:43 CET 2011 on sn-devel-104
2011-03-01 07:13:43 +01:00
Volker Lendecke
f7bd09665a libcli: Eliminate select from smb_readline_replacement 2011-02-28 16:40:20 +01:00
Matthias Dieter Wallnöfer
22c407d8bd libcli/nbt/wscript_build - fix build of "lmhosts"
Needs also the "talloc" dependency.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Fri Feb 25 11:01:31 CET 2011 on sn-devel-104
2011-02-25 11:01:31 +01:00
Jeremy Allison
ed3ae87830 Implement the SMB2 close flag SMB2_CLOSE_FLAGS_FULL_INFORMATION (and move definition to correct place).
Thanks to Nick Meier @ Microsoft for finding this @ Connectathon.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Feb 25 00:40:52 CET 2011 on sn-devel-104
2011-02-25 00:40:52 +01:00
Andrew Tridgell
11a97d60d9 build: moved util_reg.c into a common subsystem
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Feb 24 05:53:52 CET 2011 on sn-devel-104
2011-02-24 05:53:52 +01:00
Andrew Tridgell
74947964d9 build: moved spnego_parse.c into a common subsystem 2011-02-24 15:08:50 +11:00
Andrew Tridgell
52fe20c310 build: moved lmhosts.c into a common subsystem
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-24 11:57:48 +11:00
Andrew Tridgell
8dbe665a0c build: moved schannel_sign.c into a shared COMMON_SCHANNEL subsystem
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-24 11:57:48 +11:00
Andrew Tridgell
d37a55548b build: moved libcli/auth/ntlmssp*.c into a common libcliauth.so library
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-24 11:57:48 +11:00
Andrew Bartlett
e3821f2c40 s4-auth Move libcli/security/session.c to the top level
This code is now useful in common, as the elements of the
auth_session_info structure have now been defined in common IDL.

Andrew Bartlett
2011-02-22 16:20:11 +11:00
Andrew Tridgell
9aa85b6e30 s3-waf: use common libcli/nbt build rules
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-22 02:51:09 +01:00
Andrew Tridgell
efc932112c libcli/nbt: allow use of the waf build for nbt in source3
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-22 02:51:09 +01:00
Matthias Dieter Wallnöfer
d2b336ae31 libcli/security/security_descriptor.c - fix three wrong counter variables
These strictly need to be "uint32_t" since "acl*->num_aces" has been
defined by this type.

This counter patchset has been reviewed by Andrew Bartlett.
2011-02-21 10:46:40 +01:00
Matthias Dieter Wallnöfer
618c11cc15 libcli/security/privileges.c - fix wrong counter type
This strictly needs to be from type "uint32_t" since "privset->count"
is defined with this type.
2011-02-21 10:43:43 +01:00
Matthias Dieter Wallnöfer
e7659fa802 libcli/security/privileges.c - fix the counting of privileges
Since the privileges are always counted with a signed integer, there is no
reason to specify the upper limit with a "uint32_t".
2011-02-21 10:43:43 +01:00
Matthias Dieter Wallnöfer
a2ded04973 libcli/security/sddl.c - fix wrong counter type
This strictly needs to be from type "uint32_t" since "acl->num_aces" is
defined of this type.
2011-02-21 10:43:43 +01:00
Matthias Dieter Wallnöfer
055857a8d4 libcli/security/display_sec.c - fix wrong counter type
This strictly needs to be of type "uint32_t" due to
"sec_acl->num_aces" which is of type "uint32_t".
2011-02-21 10:43:43 +01:00
Andrew Tridgell
5debcb1027 idl: naming a structure 'VERSION' is not a good idea!
this renames it to ntlmssp_VERSION

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-17 00:55:23 +01:00
Matthias Dieter Wallnöfer
6bfaa4c109 libcli/security - fix two output format specifiers 2011-02-15 11:19:37 +01:00
Günther Deschner
3e9faf7efd libcli/auth: fix PAM_ERRORS subsystem build.
(waf-)god knows why, without this (fake) dependency, ./configure && make fails
while including replace.h while ./configure.developer && make succeeds...

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Feb 11 23:50:40 CET 2011 on sn-devel-104
2011-02-11 23:50:40 +01:00
Nadezhda Ivanova
c3f6cc9993 security: Fixed some handling of ACEs with INHERITED flag provided by the user
Some tests showed that these ACEs are not removed if the DACL_PROTECTED flag is provided at the same time.
This is not documented but tests prove it and it has been observerd in deployment.
2011-02-10 12:43:58 +02:00
Andrew Tridgell
8dc92c8f71 ldb: use #include <ldb.h> for ldb
thi ensures we are using the header corresponding to the version of
ldb we're linking against. Otherwise we could use the system ldb for
link and the in-tree one for include

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

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

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-02-10 06:51:06 +01:00
Andrew Bartlett
543ef3b5bf libcli/named_pipe_auth Remove support for unused levels 0-2.
The only client and server for this code uses level 3 exclusively.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-02-10 06:51:06 +01:00
Günther Deschner
34722c72f6 pam: share pam errors in a common location.
Guenther
2011-02-08 14:05:36 +01:00
Jelmer Vernooij
242797aca9 pysecurity: Add missing dependency on pytalloc-util.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Tue Feb  8 13:16:43 CET 2011 on sn-devel-104
2011-02-08 13:16:43 +01:00
Volker Lendecke
1d58fcc925 libcli/security: Make add_sid_to_array_unique use a uin32_t counter
Logical consequence of the previous commit

Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Mon Feb  7 19:24:19 CET 2011 on sn-devel-104
2011-02-07 19:24:19 +01:00
Volker Lendecke
91a56b420a libcli/security: Make del_sid_from_array take a uint32_t
This aligns it with add_sid_to_array

Signed-off-by: Michael Adam <obnox@samba.org>
2011-02-07 18:37:43 +01:00
Stefan Metzmacher
24acddf806 libcli/util: add NT_STATUS_RPC_SEC_PKG_ERROR define
metze
2011-01-30 17:36:20 +01:00
Kai Blin
278c6f8fc5 errormap: Add unix_to_werror() function
While this function technically is closest to the
map_nt_status_from_unix() function, I think it is better to keep the new
function in line with our usual fooerror_to_barerror() naming scheme.

Signed-off-by: Kai Blin <kai@samba.org>

Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Wed Jan 26 23:07:24 CET 2011 on sn-devel-104
2011-01-26 23:07:24 +01:00
Stefan Metzmacher
0dc1eee0b8 libcli/ldap: use lib/ldb_compat.h for the s3 build
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Jan 24 14:55:50 CET 2011 on sn-devel-104
2011-01-24 14:55:50 +01:00
Andrew Bartlett
084b4e235e libcli/auth move ntlmssp_wrap() and ntlmssp_unwrap() into common code.
The idea here is to allow the source3/libads/sasl.c code to call this
instead of the lower level ntlmssp_* functions.

Andrew Bartlett
2011-01-20 23:44:05 +01:00
Nadezhda Ivanova
fed925079b s4-security: Fixed incorrect inheritance of IO flagged ACES
They should be inherited without the IO flag unless they contain generic information.
2011-01-18 15:08:17 +01:00
Andrew Bartlett
012e570416 libcli/security Add python bindings for se_access_check
Andrew Bartlett
2011-01-14 16:39:32 +11:00
Nadezhda Ivanova
961f503f0d security: Fixed incorrect indentation in create_descriptor.c
Autobuild-User: Nadezhda Ivanova <nivanova@samba.org>
Autobuild-Date: Thu Jan 13 15:53:16 CET 2011 on sn-devel-104
2011-01-13 15:53:16 +01:00
Nadezhda Ivanova
980f68a6f2 security: Fixed bugs in expansion of generic information ACEs
When an ACE gontaining GA, GE, GR, GW, CO or CG is provided by a user or inherited
the final SD actually has to have 2 ACEs, one is an effective expanded one, and the
original one with IO flag added.
2011-01-11 12:20:43 +02:00
Günther Deschner
45227e96c2 libcli/security: fix sid_type_lookup().
It *always* returned "SID *TYPE* is INVALID".

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Mon Jan 10 12:47:00 CET 2011 on sn-devel-104
2011-01-10 12:47:00 +01:00
Günther Deschner
3294ccbb6d netlogon: move netlogon helpers to ../libcli/netlogon.
Guenther
2011-01-07 15:02:24 +01:00
Stefan Metzmacher
e22c4c5632 libcli/auth: add netsec_outgoing_sig_size()
The size of the signature blob depends on the used
algorithm.

metze
2011-01-03 16:44:28 +01:00
Volker Lendecke
41179c2538 Fix a valgrind error
Thanks to Tridge for the hint.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jan  2 10:58:51 CET 2011 on sn-devel-104
2011-01-02 10:58:51 +01:00
Jelmer Vernooij
5792fa90ac s4-python: Only set BASETYPE flag if subclassing is supported.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Jan  1 03:39:58 CET 2011 on sn-devel-104
2011-01-01 03:39:58 +01:00
Jelmer Vernooij
f5fe9c32ef s4-python: Add more prototypes. 2011-01-01 02:54:05 +01:00
Matthias Dieter Wallnöfer
13fa6743d8 s3/s4:auth SPNEGO - adaptions for the removed "const" from OIDs
This is needed in order to suppress warnings.
2010-12-21 15:10:37 +11:00
Günther Deschner
10eaad2977 libcli/security: remove unused variable.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Dec 17 13:56:27 CET 2010 on sn-devel-104
2010-12-17 13:56:27 +01:00
Andrew Bartlett
4a4d8e4b0f libcli/security Add sid_blob_parse() to directly parse a binary SID blob 2010-12-16 15:54:30 +11:00
Stefan Metzmacher
aac0c58e04 libcli/echo: fix off by 1 crash bug
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sat Dec 11 13:48:54 CET 2010 on sn-devel-104
2010-12-11 13:48:54 +01:00
Stefan Metzmacher
b6fef94ec1 libcli/echo: lowercase testsuite names
metze
2010-12-11 11:06:56 +01:00
Kai Blin
1f2518df5a s4 libcli: Add libcli_echo lib and torture test
Autobuild-User: Kai Blin <kai@samba.org>
Autobuild-Date: Thu Dec  9 23:57:03 CET 2010 on sn-devel-104
2010-12-09 23:57:03 +01:00
Andrew Bartlett
a21cb5a0a1 libcli/auth bring ADS_IGNORE_PRINCIPAL in common 2010-12-08 08:55:04 +01:00
Stefan Metzmacher
15c33ada6b libcli/auth: let spnego_write_mech_types() check the asn1_load() return
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Dec  7 18:23:41 CET 2010 on sn-devel-104
2010-12-07 18:23:41 +01:00
Matthias Dieter Wallnöfer
93d85ca5fd s4:fix some shadowed declaration warnings on Solaris by renaming the symbols 2010-12-06 11:28:58 +01:00
Jeremy Allison
75508cea4a Turns out there are lots of places in S3 where token passed in
here can be NULL (become_root() sets the current security token to
NULL for example). Ensure we don't crash.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Dec  2 03:26:03 CET 2010 on sn-devel-104
2010-12-02 03:26:03 +01:00
Matthias Dieter Wallnöfer
3035fe041f libcli/security/object_tree.c - remove unreachable statement 2010-11-29 14:48:12 +01:00
Arnaud Faucher
2ac5cedb71 Avoid the use of PyAPI_DATA, which is for internal Python API's.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Mon Nov 22 00:52:56 CET 2010 on sn-devel-104
2010-11-22 00:52:56 +01:00
Andrew Tridgell
9a744c634f s4-doserr: telling our users to "see Windows help" doesn't seem right 2010-11-17 23:55:39 +11:00
Volker Lendecke
eb769f2234 raw.h is only needed in the S4 build
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Nov  9 14:49:14 UTC 2010 on sn-devel-104
2010-11-09 14:49:14 +00:00
Kamen Mazdrashki
717b1158a6 idl: Use DRSUAPI_ATTID_ prefix instead of DRSUAPI_ATTRIBUTE_ for ATTID values
Those values are actually ATTID values and such, they are used
for ATTIDs for Attributes, Classes and Syntaxes.
2010-10-31 23:54:04 +00:00
Jelmer Vernooij
3deece5591 s4: Remove the old perl/m4/make/mk-based build system.
The new waf-based build system now has all the same functionality, and
the old build system has been broken for quite some time.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Oct 31 02:01:44 UTC 2010 on sn-devel-104
2010-10-31 02:01:44 +00:00
Andrew Tridgell
eb0005dfca s4-tdb: make tdb-wrap into a private library
this prevents double linking of the tdb wrap code
2010-10-30 23:49:01 +11:00
Jelmer Vernooij
a74e8be6d1 waf: Stop automaticaly changing dashes to underscores in library names. 2010-10-26 10:17:18 -07:00
Jelmer Vernooij
8cf61377aa waf: Remove lib prefix from libraries manually. 2010-10-26 10:17:17 -07:00
Jelmer Vernooij
d9cbcdd410 s4: Drop duplicate 'lib' prefix for private libraries. 2010-10-26 10:17:16 -07:00
Andrew Bartlett
14686e4b5a libcli/security Remove unused sec_acl_equal()
This was orphaned by changing sec_desc_equal() to the stricter
security_descriptor_equal() by
f4195183a4 in 2009.

(The difference here was that sec_acl_equal allowed for equivilent ordering.  I've checked the callers, and this function is only used to skip actual ACL sets, or to reference a cache, so this seems

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sun Oct 24 22:21:23 UTC 2010 on sn-devel-104
2010-10-24 22:21:23 +00:00
Jelmer Vernooij
599afb0651 s4: Rename LIBCLI_NBT -> cli_nbt. 2010-10-24 00:20:04 +00:00
Jelmer Vernooij
5224de3f74 s4: Rename LIBCLI_LDAP to libcli_ldap. 2010-10-24 00:20:04 +00:00
Jelmer Vernooij
833480d3ad s4: Rename LIBSAMBA-* to libsamba-* 2010-10-24 00:20:04 +00:00
Jelmer Vernooij
ca16d805bd s4: Rename LIBSECURITY{_SESSION,} to libsecurity{_session,} 2010-10-24 00:20:04 +00:00
Jelmer Vernooij
9065f9644b s4: Rename LIBNETIF to libnetif. 2010-10-23 22:24:06 +00:00
Matthias Dieter Wallnöfer
18103d34e2 create_descriptor.c - fix comment
The location in MS-DTYPE changed.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sat Oct 23 21:33:46 UTC 2010 on sn-devel-104
2010-10-23 21:33:45 +00:00
Kai Blin
eeac222398 s4 dns: Import DNS win32 error codes from MS-ERREF 2010-10-23 10:17:05 +00:00
Jeremy Allison
3e79cd6856 Fix const warning. Allocate off NULL as we always talloc_free(). 2010-10-22 17:33:03 +00:00
Andrew Tridgell
d98effffe4 libcli: LIBSECURITY depends on NDR_SECURITY
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-21 19:03:27 +11:00
Andrew Tridgell
2dcb596e83 s4-waf: removed dependencies on missing subsystems
these were left over from the old config.mk system
2010-10-21 19:03:24 +11:00
Andrew Tridgell
35b61c2365 libcli: make LIBCLI_NBT a private library 2010-10-21 19:03:24 +11:00
Andrew Tridgell
8709c3c0f2 libcli: make the LIBSECURITY subsystem into a private library
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-21 19:03:23 +11:00
Jeremy Allison
94dc63056a Now we have SeSystemSecurity, remove the source3-only #ifdef.
Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Oct 21 01:35:00 UTC 2010 on sn-devel-104
2010-10-21 01:35:00 +00:00
Jeremy Allison
e00c2b3cdf Add code to implement SeSecurityPrivilege in net rpc rights, and in the
open and get/set NT security descriptor code.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Oct 21 00:15:57 UTC 2010 on sn-devel-104
2010-10-21 00:15:57 +00:00
Matthias Dieter Wallnöfer
caf6b3686f libcli/security/access_check.c - fix a memory leak 2010-10-20 12:31:05 +00:00
Andrew Bartlett
4a8c17a41c libcli/ldap Don't try and encode a control with a NULL OID
ctrl->oid is set to NULL by the Samba4 rootDSE module when removing
controls that should not be exposed over LDAP (to avoid a realloc).

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Oct 20 04:13:44 UTC 2010 on sn-devel-104
2010-10-20 04:13:44 +00:00
Jeremy Allison
45794dd30a Fix shadow warning for "access" variable.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Oct 19 22:53:38 UTC 2010 on sn-devel-104
2010-10-19 22:53:38 +00:00
Andrew Tridgell
7197bcc513 readline: fixed the test for history_list() 2010-10-19 11:22:35 +11:00
Stefan Metzmacher
a610ce4aa6 libcli/nbt: we don't need LIBCLI_COMPOSITE anymore
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Oct 18 16:18:32 UTC 2010 on sn-devel-104
2010-10-18 16:18:32 +00:00
Stefan Metzmacher
820ae3d9a3 libcli/nbt: convert nbt_name_register_bcast_send/recv to tevent_req
metze
2010-10-18 15:36:16 +00:00
Stefan Metzmacher
0b8056d580 libcli/nbt: s/name_register_bcast_handler/nbt_name_register_bcast_handler
metze
2010-10-18 15:36:16 +00:00
Stefan Metzmacher
c654a6c02b libcli/nbt: s/register_bcast_state/nbt_name_register_bcast_state/
metze
2010-10-18 15:36:16 +00:00
Stefan Metzmacher
77d82fe944 libcli/nbt: move nbt_name_register_bcast_send to the top of nbt_name_register_bcast_*
metze
2010-10-18 15:36:16 +00:00
Stefan Metzmacher
e3a0463414 libcli/nbt: convert nbt_name_register_wins_send/recv to tevent_req
metze
2010-10-18 15:36:15 +00:00
Stefan Metzmacher
4f233c7ff8 libcli/nbt: s/name_register_wins_handler/nbt_name_register_wins_handler
metze
2010-10-18 15:36:15 +00:00
Stefan Metzmacher
b16681374c libcli/nbt: s/register_wins_state/nbt_name_register_wins_state
metze
2010-10-18 15:36:15 +00:00
Stefan Metzmacher
549b594c57 libcli/nbt: move nbt_name_register_wins_send() to the top of all nbt_name_register_wins_* related code
metze
2010-10-18 15:36:15 +00:00
Stefan Metzmacher
43fb7f1698 libcli/nbt: convert nbt_name_refresh_wins_send/recv to tevent_req
metze
2010-10-18 15:36:15 +00:00
Stefan Metzmacher
332f261bbf libcli/nbt: s/name_refresh_wins_handler/nbt_name_refresh_wins_handler
metze
2010-10-18 15:36:15 +00:00
Stefan Metzmacher
3ded1da8e9 libcli/nbt: s/refresh_wins_state/nbt_name_refresh_wins_state
metze
2010-10-18 15:36:15 +00:00
Stefan Metzmacher
e36e7295da libcli/nbt: move nbt_name_refresh_wins_send() to the top of all nbt_name_refresh_wins_* related code
metze
2010-10-18 15:36:15 +00:00
Stefan Metzmacher
72a8966499 libcli/util: add pipe related NT_STATUS_RPC_* codes
metze
2010-10-18 14:50:21 +02:00
Andrew Tridgell
40a6e019fd security: ensure the merge of libcli/security doesn't change s3 behaviour
Jeremy, you put a #if 0 around this logic in this commit:

  8344e945 (Jeremy Allison    2008-10-31 10:51:45 -0700 181)

is this still needed?

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

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Oct 14 03:16:41 UTC 2010 on sn-devel-104
2010-10-14 03:16:41 +00:00
Andrew Bartlett
f7ffc12e2d libcli/security Use static SIDs rather than parsing from strings
This should make the security_token_is_*() calls a little faster.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14 02:35:05 +00:00
Andrew Bartlett
a879a4610d libcli/auth Merge source4/libcli/security and util_sid.c into the common code
This should ensure we only have one copy of these core functions
in the tree.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14 02:35:05 +00:00
Andrew Bartlett
8b22eefd25 libcli/security Define traditional constants in terms of IDL macros
The source3/ code uses these constants in a lot of places, and it will
take time and care to rename them, if that is desired.  Linking the
macros here will at least allow common code to use the IDL based macros,
and preserve a documentary link between the constants (other than just their value)

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14 02:35:05 +00:00
Andrew Bartlett
949541cc6f libcli/security Move source3/lib/util_seaccess.c into the common code
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14 02:35:05 +00: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
Andrew Bartlett
0487ef0a70 libcli/security Add debug class to security_token_debug() et al
This will allow it to replace functions in source3 that use debug classes.

Andrew Bartlett
2010-10-12 02:54:16 +00:00
Andrew Bartlett
ae52f953af libcli/security Move most of security_token.c to common code.
The source4-specific session_info functions have been left in session.c

Andrew Bartlett
2010-10-12 02:54:16 +00:00
Jelmer Vernooij
2c9ebb7646 libsecurity-common: Add missing dependency on libndr. 2010-10-11 01:06:35 +02:00
Jelmer Vernooij
dc47e8dc52 libcli-auth: Remove unnecessary dependency on libsamba-hostconfig. 2010-10-11 01:06:35 +02:00
Jeremy Allison
b69bec03cc Add some const. Needed for my SD work.
Jeremy
2010-10-08 18:05:02 -07:00
Stefan Metzmacher
42d1a84a36 libcli/ldap: ldap_full_packet() requires at least 6 bytes
metze
2010-10-04 14:05:15 +00:00
Günther Deschner
0ff7e0c998 samba: share readline wrappers among all buildsystems.
Guenther
2010-10-01 22:30:22 +02:00
Stefan Metzmacher
9d4df79080 libcli/ldap: correctly marshall LDAP Unbind PDUs
metze
2010-09-27 08:24:35 +02:00
Stefan Metzmacher
95b56aabcb libcli/ldap: let ldap_full_packet() use asn1_peek_tag_needed_size()
This allows us to read a full packet without read byte after byte
or possible read to much.

metze
2010-09-26 06:45:40 +02:00
Stefan Metzmacher
e628bf1081 libcli/util: let tstream_read_pdu_blob_* cope with variable length headers
metze
2010-09-26 06:45:38 +02:00
Simo Sorce
678993470f libcli: fix compile warning
Signed-off-by: Günther Deschner <gd@samba.org>
2010-09-23 10:54:24 -07:00
Steven Danneman
bf1a4b2bc4 s4:libcli:smb2 Rename pending_id to async_id and make 64-bit
Match MS-SMB2 - 2.2.1.1   SMB2 Packet Header - ASYNC
2010-09-22 17:52:53 -07:00
Andrew Bartlett
ccbcffadb6 libcli/ldap Add const to ldap_encode_ndr_dom_sid()
Signed-off-by: Günther Deschner <gd@samba.org>
2010-09-20 15:06:30 -07:00
Günther Deschner
4006160179 libcli: add dom_sid_compare_domain()
Guenther
2010-09-20 14:03:13 -07:00
Kamen Mazdrashki
1fac1f0d28 werror: Add W_ERROR_HAVE_NO_MEMORY_AND_FREE() macro 2010-09-18 15:09:46 +03:00
Andrew Bartlett
6832d5e933 libcli/auth/ntlmssp Be clear about talloc parents for session keys
The previous API was not clear as to who owned the returned session key.
This fixes a valgrind-found use-after-free in the NTLMSSP key derivation code,
and avoids making allocations - we steal and zero instead.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-16 21:09:17 +10:00
Andrew Tridgell
5a0bb2234e cldap: prevent crashes when freeing cldap socket
As a callback may destroy the cldap socket we need to ensure we don't
reference the cldap structure after the callback

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-09-15 15:39:36 +10:00
Andrew Tridgell
4ff452151a cldap: use ipv4 not up for unbound cldap sockets
If we use "ip" we end up with a PF_INET6 socket which breaks sendto()
for v4 addresses.
2010-09-15 15:39:35 +10:00
Andrew Tridgell
67ac8555b1 s4-auth: set the RODC bit for RODC schannel
When we are using SEC_CHAN_RODC we need to set the
NETLOGON_NEG_RODC_PASSTHROUGH bit in the negotiated flags in
ServerAuthenticate2

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-09-15 15:39:34 +10:00
Jeremy Allison
55b315094e Fix string_to_sid() to allow non '\0' termination of the string - allows
string_to_sid() to be used in formatted strings like FOO/S-1-5-XXXX-YYYY/BAR.

Jeremy.
2010-09-14 14:48:50 -07:00
Andrew Bartlett
46f585e364 libcli/security Use sid_append_rid() in dom_sid_append_rid()
This ensures that the maximum number of sub-authorities is respected,
otherwise we may run off the end of the array.

Andrew Bartlett
2010-09-14 14:48:49 -07:00
Andrew Bartlett
51ecf79654 libcli/security Merge source3/ string_to_sid() to common code
The source3 code repsects the limit of a maximum of 15 subauths,
while the source4 code does not, creating a security issue as
we parse string-form SIDs from clients.

Andrew Bartlett
2010-09-14 14:48:49 -07:00
Volker Lendecke
8768f627dc ntlm_check: Fix some nonempty blank lines 2010-09-13 18:39:30 +02:00
Matthias Dieter Wallnöfer
b9b93b845c libcli/auth/schannel_state_tdb.c - fix includes
Otherwise we get a "declared inside parameter list" warning.
2010-09-11 12:53:21 +02:00
Andrew Bartlett
fdcadb5c3c libcli/privileges Fix comment 2010-09-11 18:46:13 +10:00
Andrew Bartlett
0eea8ecfe2 s4-privs Seperate rights and privileges
These are related, but slightly different concepts.  The biggest difference
is that rights are not enumerated as a system-wide list.

This moves the rights to security.idl due to dependencies.

Andrew Bartlett
2010-09-11 18:46:13 +10:00
Andrew Bartlett
ee943fb2bf libcli/security Remove unused SE_NONE define
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:13 +10:00
Andrew Bartlett
eb6a0cc326 libcli/security Move 'private' privileges functions to another header
These functions work on the bitmap, and are only exposed because
the source3/ privileges storage uses the bitmap in account_policy.tdb

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:13 +10:00
Andrew Bartlett
6d2b1ef71d libcli/security Remove 'always true' return from se_priv_put_all_privileges
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:13 +10:00
Andrew Bartlett
eb84c7ac90 libcli/auth Failure to find the cached session key for SCHANNEL isn't level 0
This happens all the time, particularly now that we don't keep the
db around after a reboot.  Don't scare the admins with the level 0.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:12 +10:00
Andrew Tridgell
382e2b321b privileges: privilege luids are not all below 64
the ones brought across from s3 have higher values

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-09-11 18:46:12 +10:00
Andrew Bartlett
a32cdadb7c libcli/security Make sec_privilege_from_index() return SEC_PRIV_INVALID on failure
This is clearer and more consistent than using a magic -1 return

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:11 +10:00
Andrew Bartlett
0b41ef7895 libcli/security Remove unused declarations from privileges.h
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:11 +10:00
Andrew Bartlett
71832a404e libcli/security Expose sec_privilege_mask()
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:11 +10:00
Andrew Bartlett
6d78e11e17 libcli/security make sec_privilege_id() return SEC_PRIV_INVALID on failure.
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:10 +10:00
Andrew Bartlett
8ff6bc2350 libcli/security Remove unused functions and constants.
All the callers to these functions have been removed or reworked.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:10 +10:00
Andrew Bartlett
a53a42ffb8 libcli/security Rename all privilege bitmaps constants
The idea here to to make it very clear how they differ from the
enumerated LUID values.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:10 +10:00
Andrew Bartlett
2bb7b827d6 libcli/security Remove luid_to_se_priv() and luid_to_privilege_name()
These functions duplicate other functions in the merged code.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:10 +10:00
Andrew Bartlett
aab0b557b9 libcli/security Improve dump of privileges: Just walk the table
This removes some logic recently added that was just too smart - it
is easier to just walk the table and do a bit match here.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:09 +10:00
Andrew Bartlett
0e2142a927 s3-privs Remove pointer indirection from se_priv_to_privilege_set()
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:09 +10:00
Andrew Bartlett
cbd72ab93b libcli/security Don't export privs[] as a global variable
Instead, provide access functions for the LSA and net sam callers
for the information they need.

They still only enumerate the first 8 privileges that have traditionally
been exposed.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:08 +10:00
Andrew Bartlett
3c93d1ecbf libcli/security Merge privilege lists from source3 and source4
The LSA enumeration in source3 will not show the new privileges,
but otherwise, they are now in common, and can be set by name.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:08 +10:00
Andrew Bartlett
d2e41105e2 libcli/security Return number of entries in the old source3 list
This ensures there isn't a behaviour change when the source3 list is combined
with the longer source4 list.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:08 +10:00
Andrew Bartlett
eb8e3155de libcli/privileges Simplify get_privilege_luid() to return just the enum
As Samba only deals with the lower 32 bits of the LUID, just return those
and let the LSA layer deal with the upper 0 bits.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:08 +10:00
Andrew Bartlett
cdda15c062 libcli/security Don't memcpy a uint64_t value, just assign it.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:08 +10:00
Andrew Bartlett
780de03f00 libcli/security Use ARRAY_SIZE() consistantly.
This avoids the use of SE_END, and has all callers walking the
array using the same termination condition.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:08 +10:00
Andrew Bartlett
66ac968dd5 libcli/security Fix and clarify privilege manipulation function comments
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:07 +10:00
Andrew Bartlett
9fb92c6014 libcli/security Make the two privileges tables share a common struct definition
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:07 +10:00
Andrew Bartlett
dbee98d30f libcli/security Move source4/ privileges code into the common libcli/security
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:07 +10:00
Andrew Bartlett
0d25212cc1 s3-privs Move manual prototypes to common privileges.h
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:07 +10:00
Andrew Bartlett
b29b6c13a3 s3-privs Inline dump_se_priv into callers now that it's just a uint64_t
The previous 128 bit structure needed this helper function.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:07 +10:00
Andrew Bartlett
f85b822bd4 libcli/security Use talloc_realloc() not TALLOC_REALLOC_ARRAY()
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:07 +10:00
Andrew Bartlett
3f589c2155 libcli/security Use C99 types
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:07 +10:00
Andrew Bartlett
b0690d6da7 libcli/security Use true and false, not True and False
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:06 +10:00
Andrew Bartlett
f20bba97d8 s3-privs Move source3/ privileges implmentation into common
Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:06 +10:00
Matthias Dieter Wallnöfer
5c33ef2758 s3/s4:libcli/tstream - add more "char *" casts in order to suppress Solaris warnings 2010-09-10 22:45:49 +02:00
Günther Deschner
fe30e35967 libcli/netlogon: add LOGON_REQUEST handling to pull_nbt_netlogon_response().
Guenther
2010-09-09 23:07:10 +02:00
Günther Deschner
9a1dbe04a8 libcli/netlogon: add LOGON_RESPONSE2 to pull_nbt_netlogon_response().
Guenther
2010-09-09 23:07:10 +02:00
Günther Deschner
daa948df2b libcli/netlogon: add NETLOGON_RESPONSE2 to push_nbt_netlogon_response().
Guenther
2010-09-09 23:07:10 +02:00
Matthias Dieter Wallnöfer
1991c2a8ee libcli/auth/ntlm_check.c - fix parameter indentation 2010-08-26 21:06:07 +02:00
Jelmer Vernooij
e260965929 manpages: Avoid using Samba-Team specific DTD, which requires net access
or modification of /etc/catalogs.
2010-08-26 04:04:37 +02:00
Günther Deschner
898c612335 s3-dcerpc: avoid talloc_move on schannel creds in cli_rpc_pipe_open_schannel_with_key().
Initially, the schannel creds were talloc memduped, then, during the netlogon
creds client merge (baf7274fed) they were first
talloc_referenced and then later (53765c81f7)
talloc_moved.

The issue with using talloc_move here is that users of that function in winbind
will only be able to have two schanneled connections, as the cached schannel
credentials pointer from the netlogon pipe will be set to NULL. Do a deep copy
of the struct instead.

Guenther
2010-08-24 02:04:27 +02:00
Matthias Dieter Wallnöfer
7ffae93762 werror.h - fix order and duplicate DS error codes 2010-08-14 19:41:46 +02:00
Günther Deschner
feb432292e ntlmssp: fix unitialized variable in ntlmssp_server_postauth().
Guenther
2010-08-12 16:28:10 +02:00
Volker Lendecke
f62756e8f0 Fix a typo 2010-08-12 08:07:50 +02:00
Andrew Bartlett
75adca63f2 libcli/auth Make the source3/ implementation of the NTLMSSP server common
This means that the core logic (but not the initialisation) of the
NTLMSSP server is in common, but uses different authentication backends.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-08-10 16:22:04 +02:00
Günther Deschner
78fa58f8c3 libcli/auth/ntlmssp: remove outdated comment. The version flag is well understood now.
Guenther
2010-08-10 11:56:33 +02:00
Andrew Bartlett
1e83b36afb libcli/auth Move some source3/ NTLMSSP functions to the common code.
libcli/auth Use true and false rather than True and False in common code

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-08-10 11:56:33 +02:00
Andrew Tridgell
6b266b85cf s4-loadparm: 2nd half of lp_ to lpcfg_ conversion
this converts all callers that use the Samba4 loadparm lp_ calling
convention to use the lpcfg_ prefix.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-16 18:24:27 +10:00
Günther Deschner
5f8678f34b libcli/netlogon: re-enable debugging.
Now that we do not share binary objects anymore, we can safely enable
debugging here again.

Guenther

This reverts commit 3eb122069b.
2010-07-16 02:37:51 +02:00
Günther Deschner
3f453f73a8 s3-libads: move spnego defines to their appropriate header file.
Guenther
2010-07-01 23:20:40 +02:00
Andreas Schneider
45fc728498 libcli: Fixed a build warning for a missing prototype. 2010-06-30 10:26:59 +02:00
Andrew Bartlett
c84b74dddd schannel Change to TDB_CLEAR_IF_FIRST to reduce fsync()
By making this DB TDB_NOSYNC, and by making that safe with
TDB_CLEAR_IF_FIRST, we greatly reduce the fsync() load on the server.

This particularly helps the source4/ 'make test', which otherwise tries
to disable fsync() in ldb.

Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>
2010-06-25 12:00:36 -07:00
Andrew Bartlett
825b2f456c libcli/auth make open_schannel_session_store() public
This will allow TDB_CLEAR_IF_FIRST to be used

Signed-off-by: Jeremy Allison <jra@samba.org>
2010-06-25 11:57:23 -07:00
Stefan Metzmacher
eb3ee7801f libcli/named_pipe_auth: fix error handling in _tstream_npa_connect_recv()
metze
2010-06-21 16:20:25 +02:00
Stefan Metzmacher
67a24fe933 libcli/named_pipe_auth: fix memory handling for temporary data
In a tevent_req based function tevent_req_create() should be the first
function! If it fails it's the only reason, why the function
could every return NULL.

And all temporary data belongs to 'state' and gets free'ed by
tevent_req_received() in the _recv function.

metze
2010-06-21 16:16:15 +02:00
Matthias Dieter Wallnöfer
276a1a7fec s3/s4 - remove "talloc_tos()" from common code since s4 doesn't support it
Please don't use this in common code parts until we change the policy regarding
it.
2010-06-21 12:35:51 +02:00
Brendan Powers
d3a99579f6 libcli: Fixed a segfault in security_acl_dup when the acl is NULL.
This can happen when duplicating a security descriptor that is missing either sacls or dacls.

Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
2010-06-19 22:20:48 +02:00
Jeremy Allison
c705c35076 Fix warning messages about unused result of talloc_move. We're really talloc_steal'ing here. 2010-06-14 16:26:13 -07:00
Andrew Bartlett
d25e9ab9a1 named_pipe_auth Always lower case the incoming pipe name
Windows connects to an upper case NETLOGON pipe, and we can't find the
socket to connect to until we lower case the name.

Andrew Bartlett
2010-06-07 23:34:28 +10:00
Andrew Bartlett
fdc6db34ca s4:ntlmssp Use common code for ntlmssp_sign.c
The common code does not have a mem_ctx on ntlmssp_check_packet() and
ntlmssp_unseal_packet().

We do however need some internal working of the code exposed, so some
structures are moved to ntlmssp_sign.h

Andrew Bartlett
2010-06-01 17:11:24 +10:00
Andrew Bartlett
62708fbd1b s3:ntlmssp Move ntlmssp_sign.c from source3 to common code.
This needs a small re-arrangement of the supporting code.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:11:36 +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
c00407bd35 libcli/nbt/lmhosts: fix missing prototype warning.
Andrew, please check.

Guenther
2010-05-31 11:25:24 +02:00
Simo Sorce
b7159e6ffd named_pipe_auth: implement tstream_npa_accept_existing_send/recv
Pair-programmed-with: Stefan Metzmacher <metze@samba.org>
2010-05-26 09:23:47 +02:00
Jeremy Allison
b2a7ad8c95 Make DFS work over SMB2.
Jeremy.
2010-05-21 16:56:10 -07:00
Jeremy Allison
2d46e07c47 Fix what looks like a cut-and-paste error in our read_negTokenInit() function.
We should never be calling asn1_push_XXX functions inside an asn1
reading function. Change asn1_push_tag() -> asn1_start_tag() and
asn1_pop_tag() -> asn1_end_tag(). This allows us to connect to a
NetApp filer at the Microsoft plugfest.

Andrew PLEASE CHECK !

Jeremy.
2010-05-20 14:50:16 -07:00
Jeremy Allison
b0d7a3d123 Thanks to Andrew Bartlett's advice, fix the NTLMSSP version problem the correct way.
No more magic blobs :-). Use ndr_push_struct_blob() to
push a properly formatted VERSION struct.

Jeremy.
2010-05-19 10:36:39 -07:00
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Jelmer Vernooij
f9ca9e46ad Finish removal of iconv_convenience in public API's. 2010-05-18 11:45:30 +02:00