1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-12 04:23:49 +03:00
Commit Graph

874 Commits

Author SHA1 Message Date
Andrew Bartlett
24dbf34352 r11198: The recent changes to netlogon changed this from a RID to a SID.
Andrew Bartlett
2007-10-10 13:45:00 -05:00
Andrew Tridgell
5ec486bb81 r11114: - fixed error handling on bad bind in ildap client
- added nicer error display, giving a string version of the error code
2007-10-10 13:44:52 -05:00
Volker Lendecke
3e535cce74 r11095: Implement wb_getuserdomgroups.
Tridge, if you have the time, you might want to look at a problem I'm having
with unix domain stream sockets. From a comment in this commit:

	/* Using composite_trigger_error here causes problems with the client
	 * socket. Linux 2.6.8 gives me a ECONNRESET on the next read after
	 * writing the reply when I don't wait the 100 milliseconds. */

This is in winbind/wb_cmd_userdomgroups.c:93.

The problem I have is that I can not *immediately* send an error reply to the
client because the next receive fails. Waiting 100 milliseconds helps. It
might also be a problem with epoll(), I don't really know.

I'd appreciate if you took a brief look at this, maybe I'm doing something
wrong.

Thanks,

Volker
2007-10-10 13:44:48 -05:00
Stefan Metzmacher
3f7b09a308 r11090: we need this to run correct under socket_wrapper
metze
2007-10-10 13:44:47 -05:00
Stefan Metzmacher
471c0ca4ab r11052: bring samba4 uptodate with the samba4-winsrepl branch,
before the bad merge

metze
2007-10-10 13:44:43 -05:00
Stefan Metzmacher
6913e33840 r11037: 2007-10-10 13:42:33 -05:00
Stefan Metzmacher
a599d7a4ae r10997: r11980@SERNOX (orig r10037): metze | 2005-09-05 14:21:40 +0200
add struct nbt_peer_socket and use it instead of passing const char *addr, uint16 port everyhwere

 (tridge: can you review this please, (make test works)

 metze
2007-10-10 13:39:52 -05:00
Andrew Bartlett
09c9576330 r10981: Pull code to decide between and implement NTLMv2, NTLM and LM
authentication out of the various callers and into the kitchen
sink.. err, credentials subsystem.

This should ensure consistant logic, as well as get us one step closer
to security=server operation in future.

Andrew Bartlett
2007-10-10 13:39:50 -05:00
Andrew Tridgell
f6818daecc r10913: This patch isn't as big as it looks ...
most of the changes are fixes to make all the ldb code compile without
warnings on gcc4. Unfortunately That required a lot of casts :-(

I have also added the start of an 'operational' module, which will
replace the timestamp module, plus add support for some other
operational attributes

In ldb_msg_*() I added some new utility functions to make the
operational module sane, and remove the 'ldb' argument from the
ldb_msg_add_*() functions. That argument was only needed back in the
early days of ldb when we didn't use the hierarchical talloc and thus
needed a place to get the allocation function from. Now its just a
pain to pass around everywhere.

Also added a ldb_debug_set() function that calls ldb_debug() plus sets
the result using ldb_set_errstring(). That saves on some awkward
coding in a few places.
2007-10-10 13:39:41 -05:00
Volker Lendecke
deb127e04e r10878: Reply to some comments by tridge and metze:
* rename the composite helper functions from comp_* to composite_*

* Move the lsa initialization to wb_connect_lsa.c

* Equip smb_composite_connect with a fallback_to_anonymous

The latter two simplify wb_init_domain.c quite a bit.

Volker
2007-10-10 13:39:39 -05:00
Stefan Metzmacher
b436206c49 r10867: add WERR_UNKNOWN_REVISION errorcode
metze
2007-10-10 13:39:37 -05:00
Volker Lendecke
3e69fdc07c r10852: Continuation-based programming can become a bit spaghetti...
Initialize a domain structure properly. Excerpt from wb_init_domain.c:

/*
 * Initialize a domain:
 *
 * - With schannel credentials, try to open the SMB connection with the machine
 *   creds. Fall back to anonymous.
 *
 * - If we have schannel creds, do the auth2 and open the schannel'ed netlogon
 *   pipe.
 *
 * - Open LSA. If we have machine creds, try to open with ntlmssp. Fall back
 *   to schannel and then to anon bind.
 *
 * - With queryinfopolicy, verify that we're talking to the right domain
 *
 * A bit complex, but with all the combinations I think it's the best we can
 * get. NT4, W2k3SP1 and W2k all have different combinations, but in the end we
 * have a signed&sealed lsa connection on all of them.
 *
 * Is this overkill? In particular the authenticated SMB connection seems a
 * bit overkill, given that we do schannel for netlogon and ntlmssp for
 * lsa later on w2k3, the others don't do this anyway.
 */

Thanks to Jeremy for his detective work, and to the Samba4 team for providing
such a great infrastructure.

Next step is to connect to SAM. Do it via LDAP if we can, fall back to samr
with all we have.

Volker
2007-10-10 13:39:36 -05:00
Jelmer Vernooij
48d22a9910 r10848: Fix warning 2007-10-10 13:39:36 -05:00
Andrew Bartlett
675b7df2ee r10847: Fix up new 'decrypt samlogon reply' routine to be more robust, and use
it in the RPC-SAMLOGON test.

Andrew Bartlett
2007-10-10 13:39:35 -05:00
Andrew Bartlett
6d24d8d12c r10845: Add new function to decrypt the session keys in samlogon responses.
Andrew Bartlett
2007-10-10 13:39:35 -05:00
Stefan Metzmacher
e7ee73a747 r10836: giving NT_STATUS_NO_MEMORY, when the connection fails wasn't a good idea...
metze
2007-10-10 13:39:33 -05:00
Andrew Bartlett
fd7203789a r10810: This adds the hooks required to communicate the current user from the
authenticated session down into LDB.  This associates a session info
structure with the open LDB, allowing a future ldb_ntacl module to
allow/deny operations on that basis.

Along the way, I cleaned up a few things, and added new helper functions
to assist.  In particular the LSA pipe uses simpler queries for some of
the setup.

In ldap_server, I have removed the 'ldasrv:hacked' module, which hasn't
been worked on (other than making it continue to compile) since January,
and I think the features of this module are being put into ldb anyway.

I have also changed the partitions in ldap_server to be initialised
after the connection, with the private pointer used to associate the ldb
with the incoming session.

Andrew Bartlett
2007-10-10 13:39:32 -05:00
Stefan Metzmacher
dfc95de8fa r10766: - make it possible to mark a wrepl_request as send only,
used for WREPL_REPL_INFORM* messsages
- make it possible to close the connection after a request was send
  used for WREPL_ASSOCIATION_STOP
- fix the torture test that tests the assoc context handling
  between connections, you can issue a request and get the reply
  on another connection, I think we should not implement that in our server
  code, as I think it's a security hole, you can cause a windows server
  to send the replies to someone another client, that doesn't wait for data,
  and as there're no massage_id in the protocol the client would be confused
  by a replies that doesn't belong to a query

metze
2007-10-10 13:39:28 -05:00
Stefan Metzmacher
2f46e54e1b r10761: we need to use a pointer to a nbt_name to fix compiler warnings, because we can
only use a pointers to unknown types in proto.h

metze
2007-10-10 13:39:28 -05:00
Andrew Tridgell
b714ab64fd r10754: fixed a valgrind error for unmatched SMB replies 2007-10-10 13:39:26 -05:00
Andrew Bartlett
1f6fec8e6b r10712: Use data_blob_talloc, thanks to valgrind for finding the errors.
Andrew Bartlett
2007-10-10 13:39:23 -05:00
Volker Lendecke
6b88de182e r10677: Add smb_composite_connectmulti: Send out multiple SYN packets at once, use the
first one that replies correctly.

Add a talloc context to smb_composite_connect()

Volker
2007-10-10 13:39:17 -05:00
Andrew Tridgell
fd6d895ebd r10668: added a ildap_search_bytree() function 2007-10-10 13:39:16 -05:00
Tim Potter
09d4abecb0 r10646: Hey Jelmer what do you think of this? The SConscript for the libcli
directory now looks like the config.mk file but with different
punctuation.

The only weird bit is that it creates a proto.h file for each subsystem.
2007-10-10 13:39:14 -05:00
Stefan Metzmacher
131e5dfe69 r10638: - add wrepl_socket_merge() function that creates a wrepl_socket on top
of an existing socket, that is needed to handle WREPL_REPL_UPDATE
  in the server, because we need to flig the connection and act as client on it

metze
2007-10-10 13:39:14 -05:00
Rafal Szczesniak
ef29863d99 r10636: Formatting for better readability.
rafal
2007-10-10 13:39:13 -05:00
Rafal Szczesniak
7b3a4096b5 r10635: Formatting for better readability.
rafal
2007-10-10 13:39:13 -05:00
Stefan Metzmacher
ba3685c41d r10627: - use a wrepl specific enum for the node type
- the unknown flag 0x10 seems to mean that this name was localy registered on this
  currently asked server, that flag is not present in replica records

metze
2007-10-10 13:39:13 -05:00
Stefan Metzmacher
b98efc2905 r10608: - fix hierachical memory handling in ndr_pull_nbt_name
- add wrepl_nbt_name scalar type and do the pull/push in the ndr layer
  instead of the caller
- give the flags and group_flag in the wrepl_name a meaning

metze
2007-10-10 13:39:12 -05:00
Andrew Bartlett
0d757b169a r10598: Factor out common code, in preperation for a move elsewhere.
Andrew Bartlett
2007-10-10 13:39:10 -05:00
Jelmer Vernooij
b53313dc51 r10586: Add MergedObject() builder. Default to Library() rather
then StaticLibrary()
2007-10-10 13:39:08 -05:00
Stefan Metzmacher
bfd548ca10 r10569: add all info that we have to wrepl_name, as we need it for replication :-)
metze
2007-10-10 13:39:06 -05:00
Stefan Metzmacher
ff12723477 r10547: - add wrepl_request timeout handling
- when we got an unexpected READ event, we need to do a socket_recv() to find connection errors
  and we need to mark the socket as dead (and remove the fde_event) to prevent,
  endless loops on broken connections

tridge: we should look carefull at other protocol, to handle broken connections without spinning

metze
2007-10-10 13:39:04 -05:00
Stefan Metzmacher
e753114e86 r10545: map ECONNRESET to NT_STATUS_CONNECTION_RESET
metze
2007-10-10 13:39:04 -05:00
Stefan Metzmacher
e06ca726f3 r10542: if the transport is dead we need to return
tridge: I think this is correct, comments?

metze
2007-10-10 13:39:03 -05:00
Stefan Metzmacher
495996cfc4 r10537: - we now use a much nicer way to handle talloc_free(timed_event)
the events code replaces a destructor to one that returns allways -1
  while it's calling the event handler
- we don't need the composite and winsrepl specific fixes any more
- this also fixes the problem with smbcli, dcerpc, cldap, ldap and nbt
  request timeouts

metze
2007-10-10 13:39:03 -05:00
Stefan Metzmacher
0983452bf8 r10530: - fix some crash bugs when we lost the connection...
metze
2007-10-10 13:39:02 -05:00
Stefan Metzmacher
dc5d5953b6 r10529: fix a crash bug in full async code the uses the composite_trigger_done() code
the event subsystem wants to free timed_events!

metze
2007-10-10 13:39:02 -05:00
Jelmer Vernooij
a5b88bcd42 r10513: Reduce some use of pstring. The main reason some parts of the code still
use pstring is next_token() now.
2007-10-10 13:38:58 -05:00
Stefan Metzmacher
4527815a0a r10504: - seperate implementation specific stuff, from the generic composite
stuff.
- don't use SMBCLI_REQUEST_* state's in the genreic composite stuff
- move monitor_fn to libnet.

NOTE: I have maybe found some bugs, in code that is dirrectly in DONE or ERROR
      state in the _send() function. I haven't fixed this bugs in this
      commit! We may need some composite_trigger_*() functions or so.
      And maybe some other generic helper functions...

metze
2007-10-10 13:38:57 -05:00
Tim Potter
3c9c3a52e3 r10499: Export cli_ldap library. 2007-10-10 13:38:56 -05:00
Volker Lendecke
4637964b19 r10491: First step towards wbinfo -t: This issues a name request for the primary
domain and gets the DC's name via a mailslot call.

Metze, I renamed wbsrv_queue_reply to wbsrv_send_reply in accordance with
irpc_send_reply. Having _queue_ here and _send_ there is a bit confusing. And
as everything is async anyway, the semantics should not be too much of a
problem.

Volker
2007-10-10 13:38:54 -05:00
Tim Potter
4a03773c99 r10482: Add files to proto_files enough to build libcli and librpc directories. 2007-10-10 13:38:53 -05:00
Jelmer Vernooij
703ffbaaac r10478: More work on proto headers; we now generate a couple of smaller ones
that are then included by include/proto.h
2007-10-10 13:38:52 -05:00
Jelmer Vernooij
29919a7105 r10438: Move portability functions to lib/replace/; replace now simply ensures
that a given set of (working) POSIX functions are available (without
prefixes to their names, etc). See lib/replace/README for a list.

Functions that behave different from their POSIX specification
(such as sys_select, sys_read, etc) have kept the sys_ prefix.
2007-10-10 13:38:45 -05:00
Andrew Bartlett
194e8f07c0 r10402: Make the RPC-SAMLOGON test pass against Win2k3 SP0 again.
I still have issues with Win2k3 SP1, and Samba4 doesn't pass it's own
test for the moment, but I'm working on these issues :-)

This required a change to the credentials API, so that the special
case for NTLM logins using a principal was indeed handled as a
special, not general case.

Also don't set the realm from a ccache, as then it overrides --option=realm=.

Andrew Bartlett
2007-10-10 13:38:39 -05:00
Volker Lendecke
17dbbf965b r10395: While playing with winbind, I found a segfault because I had given
resolve_name_send a stack-allocated method list. Duplicate it.

Volker
2007-10-10 13:38:39 -05:00
Jelmer Vernooij
4f0d7f75b9 r10348: Add scons scripts for remaining subsystems. Most subsystems build now,
but final linking still fails (as does generating files asn1, et, idl and proto
files)
2007-10-10 13:38:30 -05:00
Jelmer Vernooij
59d4450453 r10336: Add sconscript for a couple more subsystems. 2007-10-10 13:38:29 -05:00
Andrew Tridgell
09948a5933 r10213: fixed a memory leak in the ldap client and server code spotted by Karl
Melcher. ldap_encode() now takes a memory context to use for the data
blob
2007-10-10 13:38:09 -05:00