1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

649 Commits

Author SHA1 Message Date
Volker Lendecke
ae6840320f Implement NETLOGON GetDCName client side. You can ask a DC for the name of
a DC it trusts.

Volker
-
Jim McDonough
1976843345 More sync between passdb on 3.0 and HEAD.
Replace unknown_3 with fields_present.  Also causes rpc_samr structure field changes.
-
Gerald Carter
faec928564 fix another bug caused by cli_lsa_query_info_policy() changes -
Andrew Bartlett
7c34de8096 This merges in my 'always use ADS' patch. Tested on a mix of NT and ADS
domains, this patch ensures that we always use the ADS backend when
security=ADS, and the remote server is capable.

The routines used for this behaviour have been upgraded to modern Samba
codeing standards.

This is a change in behaviour for mixed mode domains, and if the trusted
domain cannot be reached with our current krb5.conf file, we will show
that domain as disconnected.

This is in line with existing behaviour for native mode domains, and for
our primary domain.

As a consequence of testing this patch, I found that our kerberos error
handling was well below par - we would often throw away useful error
values.  These changes move more routines to ADS_STATUS to return
kerberos errors.

Also found when valgrinding the setup, fix a few memory leaks.

While sniffing the resultant connections, I noticed we would query our
list of trusted domains twice - so I have reworked some of the code to
avoid that.

Andrew Bartlett
-
Andrew Bartlett
6e5b084c20 Change (unused) structure parameter for cli_ds_enum_domain_trusts() cleanup. -
Tim Potter
a999f7f23f Fix comment. -
Tim Potter
c5865e3dfe Patch from James Henstridge to allow rpcclient adddriver command to specify
printer driver version.  Closes bug #514.
-
Tim Potter
67dd1c4366 Remove trailing comma on typedef enum. albert chin (china@thewrittenword.com) -
Jim McDonough
4e86243ea1 Add initshutdown pipe commands to rpcclient. Second part of fix to bug
#534
-
cvs2svn Import User
e569418861 This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. -
Jim McDonough
532fab74c1 New files for support of initshutdown pipe. Win2k doesn't respond properly
to all requests on the winreg pipe, so we need to handle this new pipe.

First part of fix for bug #534
-
Jeremy Allison
89d42685b7 Fixed typo spotted by Daniel Jarboe <daniel.jarboe@custserv.com>.
Jeremy.
-
Jeremy Allison
c68b6f64d9 Fixed typo spotted by Daniel Jarboe <daniel.jarboe@custserv.com>.
Jeremy.
-
Jim McDonough
71dcdf54e6 Several updates:
- add support for named pipe and netbios queries in parse code
- fix map request structure...unknown byte was alignment
- add sample of named pipe over netbios query in rpcclient (comment only)
-
Jim McDonough
1d68e108a7 Add epmapper commands to rpcclient -
Jim McDonough
3ca8240aff Add client side code to do endpoint map queries. Currently does one
fixed query.  Updates to come soon.
-
Gerald Carter
9d2e585e5e commit sign only patch from Andrew; bug 167; tested using 2k & XP clientspreviously joined to the Samba domain -
Gerald Carter
3802f5895e commit sign only patch from Andrew; bug 167; tested using 2k & XP clientspreviously joined to the Samba domain -
Tim Potter
e2ab9e54cd Merge from 3.0:
>Fix for #480. Change the interface for init_unistr2 to not take a length
>but a flags field. We were assuming that 2*strlen(mb_string) == length of ucs2-le string.
>This is not the case. Count it after conversion.
>Jeremy.
-
Jeremy Allison
f82c273a42 Fix for #480. Change the interface for init_unistr2 to not take a length
but a flags field. We were assuming that 2*strlen(mb_string) == length of ucs2-le string.
This is not the case. Count it after conversion.
Jeremy.
-
Jeremy Allison
71ecd10181 The "unknown_5" 32 bit field in the user structs is actually 2 16-bit
fields, bad_password_count and logon_count. Ensure this is stored/fetched
in the various SAMs. As it replaces the unknown_5 field this fits
exactly into the tdb SAM without any binary problems. It also is added
to the LDAP SAM as two extra attributes. It breaks compatibility with
the experimental SAMs xml and mysql. The maintainers of these SAMs must
fix them so upgrades like this can be done transparently. I will insist
on the "experimental" status until this is solved.
Jeremy.
-
Jeremy Allison
cd7bd8c2da The "unknown_5" 32 bit field in the user structs is actually 2 16-bit
fields, bad_password_count and logon_count. Ensure this is stored/fetched
in the various SAMs. As it replaces the unknown_5 field this fits
exactly into the tdb SAM without any binary problems. It also is added
to the LDAP SAM as two extra attributes. It breaks compatibility with
the experimental SAMs xml and mysql. The maintainers of these SAMs must
fix them so upgrades like this can be done transparently. I will insist
on the "experimental" status until this is solved.
Jeremy.
-
Gerald Carter
c17a7dc9a1 sync 3.0 into HEAD for the last time -
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
-
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
-
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.
-
Herb Lewis
398bd14fc6 get rid of more compiler warnings -
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
-
Jeremy Allison
8516baf58d Patch from waider@waider.ie to print out Port Type.
Jeremy.
-
Simo Sorce
3101c236b8 port latest changes from SAMBA_3_0 tree -
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.
-
Gerald Carter
f8abdd23e1 add a few more tidy ups. Now onto winbindd -
Gerald Carter
c691c7f7d9 add support for DsEnumerateDomainTrusted for enumerating all the
trusted domains in a forest.
-
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
-
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.
-
Tim Potter
8b818ce381 Replace the eight (!) copies of dummy become/unbecome root with a single one. -
Gerald Carter
adb98e7b7c trying to get HEAD building again. If you want the code
prior to this merge, checkout HEAD_PRE_3_0_0_BETA_3_MERGE
-
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
-
Gerald Carter
f005f1cf12 more compile fixes for become/unbecome_root() -
Jeremy Allison
4f78d747e6 More conversions I missed. Thanks metze.
Jeremy.
-
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.
-
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
-
Jelmer Vernooij
d817eaf0ec Reverse previous patch from Stefan and me after comments by Andrew Bartlett -
Jelmer Vernooij
d31509fe88 Reverse previous patch from Stefan and me after comments by Andrew Bartlett. -
Jelmer Vernooij
367a5cad1e Patch from metze and me that adds dummy smb_register_*() functions -
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.
-
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
-
Tim Potter
f8db590b07 Merge:
> Perform lp_load() before popt to fix -W option.
-
Tim Potter
d20f4bf5d8 Perform lp_load() before popt to fix -W option. -
Tim Potter
b1ad692688 Merge:
>Patch from waider to set exit code of last executed command specified
>as an argument to -c.
-