1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
Commit Graph

617 Commits

Author SHA1 Message Date
Andrew Bartlett
96b4187963 - Make 'net' use a single funciton for setting the 'use machine account' code.
- Make winbindd try to use kerberos for connections to DCs, so that it can
   access RA=2 servers, particularly for netlogon.
 - Make rpcclient follow the new flags for the NETLOGON pipe
 - Make all the code that uses schannel use the centralised functions for doing so.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
e10f0529fe - Fix the kerberos downgrade problem:
- When connecting to the NETOGON pipe, we make a call to auth2, in order
   to verify our identity.  This call was being made with negotiation flags
   of 0x1ff.  This caused our account to be downgraded.  If we instead make
   the call with flags > 1ff (such as 0x701ff), then this does not occour.

 - This is *not* related to the use of kerberos for the CIFS-level connection

My theory is that Win2k has a test to see if we are sending *exactly* what
NT4 sent - setting any other flags seems to cause us to remain intact.

Also ensure that we only have 'setup schannel' code in a few places, not
scattered around cmd_netlogon too.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Gerald Carter
5be5151568 working on fix for BUG #294. Not done yet, but this at least clears
up some of the false positives in "rpcclient -c getdriver".
Also make sure that we ask for version2 and 3 drivers on x86.
0001-01-01 00:00:00 +00:00
Herb Lewis
398bd14fc6 get rid of more compiler warnings 0001-01-01 00:00:00 +00:00
Andrew Bartlett
3547cb3def Change Samba to always use extended security for it's guest logins, (ie,
NTLMSSP with "" username, NULL password), and add --machine-pass (-P) to
all of Samba's clients.

When connecting to an Active Directory DC, you must initiate the CIFS level
session setup with Kerberos, not a guest login.  If you don't, your machine
account is demoted to NT4.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
8516baf58d Patch from waider@waider.ie to print out Port Type.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
879309671d Add a command line option (-S on|off|required) to enable signing on client
connections. Overrides smb.conf parameter if set.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
f8abdd23e1 add a few more tidy ups. Now onto winbindd 0001-01-01 00:00:00 +00:00
Gerald Carter
c691c7f7d9 add support for DsEnumerateDomainTrusted for enumerating all the
trusted domains in a forest.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
fa4d7be161 Schannel, once setup, may be used on *ANY* TCP/IP connection until the
connection that set it up has been shut down.

(Also, pipes still connected, and reconnections to the same pipe (eg SAMR)
may continue to use that session key until their TCP/IP connection is shut
down)

Allow further testing by printing out the session key, and allowing it's input
into rpcclient.

Next step is automatic storage in a TDB.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Gerald Carter
9f835b85dd convert snprintf() calls using pstrings & fstrings
to pstr_sprintf() and fstr_sprintf() to try to standardize.
lots of snprintf() calls were using len-1; some were using
len.  At least this helps to be consistent.
0001-01-01 00:00:00 +00:00
Tim Potter
8b818ce381 Replace the eight (!) copies of dummy become/unbecome root with a single one. 0001-01-01 00:00:00 +00:00
Andrew Bartlett
5472ddc9ea Jeremy requested that I get my NTLMSSP patch into CVS. He didn't request
the schannel code, but I've included that anyway. :-)

This patch revives the client-side NTLMSSP support for RPC named pipes
in Samba, and cleans up the client and server schannel code.  The use of the
new code is enabled by the 'sign', 'seal' and 'schannel' commands in
rpcclient.

The aim was to prove that our separate NTLMSSP client library actually
implements NTLMSSP signing and sealing as per Microsoft's NTLMv1 implementation,
in the hope that knowing this will assist us in correctly implementing
NTLMSSP signing for SMB packets.  (Still not yet functional)

This patch replaces the NTLMSSP implementation in rpc_client/cli_pipe.c with
calls to libsmb/ntlmssp.c.  In the process, we have gained the ability to
use the more secure NT password, and the ability to sign-only, instead of
having to seal the pipe connection.  (Previously we were limited to sealing,
and could only use the LM-password derived key).

Our new client-side NTLMSSP code also needed alteration to cope with our
comparatively simple server-side implementation.  A future step is to replace
it with calls to the same NTLMSSP library.

Also included in this patch is the schannel 'sign only' patch I submitted to
the team earlier.  While not enabled (and not functional, at this stage) the
work in this patch makes the code paths *much* easier to follow.  I have also
included similar hooks in rpccleint to allow the use of schannel on *any* pipe.

rpcclient now defaults to not using schannel (or any other extra per-pipe
authenticiation) for any connection.  The 'schannel' command enables schannel
for all pipes until disabled.

This code is also much more secure than the previous code, as changes to our
cli_pipe routines ensure that the authentication footer cannot be removed
by an attacker, and more error states are correctly handled.

(The same needs to be done to our server)

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Gerald Carter
f005f1cf12 more compile fixes for become/unbecome_root() 0001-01-01 00:00:00 +00:00
Jeremy Allison
4f78d747e6 More conversions I missed. Thanks metze.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ff222716a0 Removed strupper/strlower macros that automatically map to strupper_m/strlower_m.
I really want people to think about when they're using multibyte strings.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
f8cab8635b * s/get_dc_name/rpc_dc_name/g (revert a previous change)
* move back to qsort() for sorting IP address in get_dc_list()

* remove dc_name_cache in cm_get_dc_name() since it slowed
  things down more than it helped.  I've made a note of where
  to add in the negative connection cache in the ads code.
  Will come back to that.

* fix rpcclient to use PRINTER_ALL_ACCESS for set printer (instead
  of MAX_ALLOWED)

* only enumerate domain local groups in our domain

* simplify ldap search for seqnum in winbindd's rpc backend
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
d817eaf0ec Reverse previous patch from Stefan and me after comments by Andrew Bartlett 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
74d9ecfe2d Patch from metze and me that adds dummy smb_register_*() functions so
that is now possible to, for example, load a module which contains
an auth method into a binary without the auth/ subsystem built in.
0001-01-01 00:00:00 +00:00
Volker Lendecke
5b3cb7725a This puts real netlogon connection caching to winbind. This becomes
important once we start doing schannel, as there would be a lot more
roundtrips for the second PIPE open and bind. With this patch logging
in to a member server is a matter of two (three if you count the
ack...) packets between us and the DC.

Volker
0001-01-01 00:00:00 +00:00
Tim Potter
f8db590b07 Merge:
> Perform lp_load() before popt to fix -W option.
0001-01-01 00:00:00 +00:00
Tim Potter
b1ad692688 Merge:
>Patch from waider to set exit code of last executed command specified
>as an argument to -c.
0001-01-01 00:00:00 +00:00
Tim Potter
2e5f75beaf Merge from HEAD:
>Return NT_STATUS_UNSUCCESSFUL if the sourcedata and echodata rpcs
>return unexpected data.
>
>Closes bug #2.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
32fb801ddc Merge the 'safe' parts of my StrnCpy patch - many of the users really wanted
a pstrcpy/fstrcpy or at most a safe_strcpy().

These have the advantage of being compiler-verifiable.

Get these out of the way, along with a rewrite of 'get_short_archi' in the
spoolss client and server.  (This pushes around const string pointers, rather
than copied strings).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
876e00fd11 Merge from HEAD - save the type of channel used to contact the DC.
This allows us to join as a BDC, without appearing on the network as one
until we have the database replicated, and the admin changes the configuration.

This also change the SID retreval order from secrets.tdb, so we no longer
require a 'net rpc getsid' - the sid fetch during the domain join is sufficient.
Also minor fixes to 'net'.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Tim Potter
6a1d99d318 Merge: remove unused variable. 0001-01-01 00:00:00 +00:00
Tim Potter
38337ec5ef Merge Jelmer's popt updates from HEAD.
Also merged a bunch of other random changes as this file has
been drifting off due to lack of janitors.
0001-01-01 00:00:00 +00:00
Tim Potter
017da9393b Merge of rpcecho pipe for testing large dcerpc requests and responses.
Only compiled in when --enable-developer argument passed to configure.
0001-01-01 00:00:00 +00:00
Tim Potter
5b1807dddf Merge of samr lookup domain rpc client call from HEAD. 0001-01-01 00:00:00 +00:00
cvs2svn Import User
381649916e This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. 0001-01-01 00:00:00 +00:00
Tim Potter
4ccd34ef83 A new RPC pipe! The \pipe\echo named pipe is for testing large RPC
requests and responses and is only compiled in when --enable-developer
is passed to configure.  It includes server and client side code for
generating and responding to functions on this pipe.  The functions are:

 - AddOne: add one to the uint32 argument and return ig
 - EchoData: echo back a variable sized char array to the caller
 - SourceData: request a variable sized char array
 - SinkData: send a variable sized char array and throw it away

There's a win32 implementation of the client and server in the
junkcode CVS repository in the rpcecho-win32 subdirectory.
0001-01-01 00:00:00 +00:00
Volker Lendecke
eaef0d8aef This is the netlogon schannel client code. Try a
rpcclient -S pdc -U% -c "samlogon user password"

and it should work with the schannel. Needs testing against platforms
different from NT4SP6.

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
ecd0ee4d24 This is the netlogon schannel client code. Try a
rpcclient -S pdc -U% -c "samlogon user password"

and it should work with the schannel. Needs testing platforms
different from NT4SP6.

Volker
0001-01-01 00:00:00 +00:00
Tim Potter
67bc6bccc2 SAMR lookupdomain rpc client patches from amber palekar <amber@nu3.net> 0001-01-01 00:00:00 +00:00
Tim Potter
6174560e50 This file deleted in HEAD. 0001-01-01 00:00:00 +00:00
Jelmer Vernooij
d5f9b0275c Revoke some of the popt patch from metze I applied earlier today. It added
some double options and broke some parameters.
0001-01-01 00:00:00 +00:00
Jelmer Vernooij
2ddfed298d Patch from metze to generalise POPT_COMMON_SAMBA, with some minor changes 0001-01-01 00:00:00 +00:00
Tim Potter
fb91bfa7a2 Merge of waider's rpcclient return type patch. 0001-01-01 00:00:00 +00:00
Tim Potter
8cabdd635d Merge of enumdomusers rpcclient command. 0001-01-01 00:00:00 +00:00
Tim Potter
ac3df9a805 Applied waider's patch to return DOS error codes for pipes that
support it.
0001-01-01 00:00:00 +00:00
Martin Pool
0e9a2f41df Patch from Ronan Waide:
> when doing "enumdomusers", rpcclient prints each one preceded by the
> word "group" instead of "user"
0001-01-01 00:00:00 +00:00
Martin Pool
17567dd1d5 Patch from Ronan Waide:
> when doing "enumdomusers", rpcclient prints each one preceded by the
> word "group" instead of "user"
0001-01-01 00:00:00 +00:00
Andrew Bartlett
1f605fe77c safe_strcpy() -> fstrcpy() fix, and a cleanup to how rpcclient calls the
IP address resolving code.
0001-01-01 00:00:00 +00:00
Tim Potter
992b5eb4e0 Use PRINTER_ALL_ACCESS instead of MAXIMUM_ALLOWED_ACCESS in setprinter
command.  From Ronan Waide <waider@waider.ie>.
0001-01-01 00:00:00 +00:00
Tim Potter
20f153cee3 Merge: const fixes.
Merge: add popt_common_version to command line options table.

Merge: mbp's rewrite of do_cmd()
0001-01-01 00:00:00 +00:00
Tim Potter
a20aba0999 Merge: const fixes. 0001-01-01 00:00:00 +00:00
Tim Potter
018733eedd More const fixes and flow on fixes from yesterday's const-fest. 0001-01-01 00:00:00 +00:00
Tim Potter
923425e497 Fixed up some const related compiler warnings. 0001-01-01 00:00:00 +00:00
Tim Potter
30353da3e9 Added enumdomusers command. 0001-01-01 00:00:00 +00:00
Tim Potter
7418351427 Fix for only specifying one command with -c 0001-01-01 00:00:00 +00:00