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

15433 Commits

Author SHA1 Message Date
Tim Potter
72de1cd0f7 Fix typo in RW2 torture test. Closes bugzilla bug #924.
(This used to be commit d22313998a)
2004-01-05 02:57:33 +00:00
Andrew Bartlett
430eb9ad45 Add const.
(This used to be commit aacb817e89)
2004-01-05 02:16:51 +00:00
Andrew Bartlett
3c2371dcfc There is some memory corruption hidden somewhere in our winbind code. If I
could reproduce it, I would fix it, but for now just make sure we always
SAFE_FREE() and set our starting pointers to NULL.

Andrew Bartlett
(This used to be commit c279e178bc)
2004-01-05 02:12:38 +00:00
Andrew Bartlett
af8fb7e01e Change (unused) structure parameter for cli_ds_enum_domain_trusts() cleanup.
(This used to be commit 6e5b084c20)
2004-01-05 02:05:19 +00:00
Andrew Bartlett
614c18d24b rpc_client/cli_lsarpc.c:
rpc_parse/parse_lsa.c:
nsswitch/winbindd_rpc.c:
nsswitch/winbindd.h:
 - Add const

libads/ads_ldap.c:
 - Cleanup function for use

nsswitch/winbindd_ads.c:
 - Use new utility function ads_sid_to_dn
 - Don't search for 'dn=', rather call the ads_search_retry_dn()

nsswitch/winbindd_ads.c:
include/rpc_ds.h:
rpc_client/cli_ds.c:
 - Fixup braindamage in cli_ds_enum_domain_trusts():
    - This function was returning a UNISTR2 up to the caller, and
      was doing nasty (invalid, per valgrind) things with memcpy()
    - Create a new structure that represents this informaiton in a useful way
      and use talloc.

Andrew Bartlett
(This used to be commit 06c3f15aa1)
2004-01-05 02:04:37 +00:00
Andrew Bartlett
685e0cbeb8 Fix for bug 707, getent group for huge ads groups (>1500 members)
This introduces range retrieval of ADS attributes.

VL rewrote most of Gnther's patch, partly to remove code duplication and
partly to get the retrieval of members in one rush, not interrupted by the
lookups for the DN.

I rewrote that patch, to ensure that we can keep an eye on the USN
(sequence number) of the entry - this allows us to ensure the read was
atomic.

In particular, the range retrieval is now generic, for strings.  It
could easily be made generic for any attribute type, if need be.

Andrew Bartlett
(This used to be commit 131bb928f1)
2004-01-05 01:48:21 +00:00
Andrew Bartlett
11bd06198b I'm not quite sure what happened here - but replace the ads_sid_to_dn
function with one that compiles.

Andrew Bartlett
(This used to be commit 0d5b0345a6)
2004-01-05 01:06:56 +00:00
Andrew Bartlett
b0682de709 We can't possilby get 'ok' here, as the if statement above just checked for it.
(This used to be commit cf44549694)
2004-01-05 00:15:34 +00:00
Andrew Bartlett
684da13206 Make arbitary binary data unsigned char.
(This used to be commit a78b020562)
2004-01-05 00:14:12 +00:00
Andrew Bartlett
39c7d3dc4a Add a utilty function for converting a sid to a DN.
Andrew Bartlett
(This used to be commit 49a7a3fd17)
2004-01-05 00:13:00 +00:00
Andrew Bartlett
d4954eff57 Make it clear that we cannot sign if we don't have a session key.
(This used to be commit a2f6dec05b)
2004-01-05 00:11:35 +00:00
Andrew Bartlett
e8984d6b9a Automaticly initialise the signing engine, if we have a session key.
(This used to be commit cb063c1b69)
2004-01-05 00:11:02 +00:00
Jelmer Vernooij
430f9abd5f - Put functions for generating SQL queries in pdb_sql.c
- Add pgSQL backend (based on patch by Hamish Friedlander)
- Use query generate functions from pdb_mysql and pdb_pgsql
- Only pdb_pgsql.c needs to be changed whenever the fields in SAM_ACCOUNT change
(This used to be commit 65ad2c02fd)
2004-01-04 21:09:42 +00:00
Volker Lendecke
fd35232584 Commit the translation of the realm to the netbios domain name in the kerberos
session setup. After talking to jht and abartlet I made this unconditional, no
additional parameter.

Jerry: This is a change in behaviour, but I think it is necessary.

Volker
(This used to be commit 3ce6c9f273)
2004-01-04 11:51:31 +00:00
Andrew Bartlett
cc02d8690c Even if the 'device type' is always an ascii string, use push_string to get
it out onto the wire.  Avoids valgrind warnings because the fstrcpy() causes
part of the wire buffer to be 'marked'.

Andrew Bartlett
(This used to be commit 53d802c72a)
2004-01-04 11:05:30 +00:00
Volker Lendecke
d01733eb32 And yet another const
Volker
(This used to be commit dafa4d202b)
2004-01-03 20:20:59 +00:00
Andrew Bartlett
4cc701196e There is not a particularly good excuse for complaining to the *client* that
it sent 'INVALID_PARAMETER', when it was us as the server that could not
come up with a session key.  Instead, allow normal authentication to take
place, but do not setup a session key.

Andrew Bartlett
(This used to be commit e5abd93d79)
2004-01-03 01:12:56 +00:00
Andrew Bartlett
8c1d0fb955 Match Win2k, and return NT_STATUS_INVALID_PARAMETER
if this parameter is not an account type

Andrew Bartlett
(This used to be commit faddf5d8f9)
2004-01-02 23:55:44 +00:00
Andrew Bartlett
fd346ce0c9 Under certain error conditions (a talloc() failure above) this would cause
a double-free(), and the resultant malloc heap corruption.

This may be one of our lurking winbind segfaults.

Andrew Bartlett
(This used to be commit 903263a1bd)
2004-01-02 11:39:07 +00:00
Andrew Bartlett
ffedf5a1aa Having no members of a group is a perfectly valid (if unusual) situation.
Andrew Bartlett
(This used to be commit 3f6d0cd3a8)
2004-01-02 05:33:14 +00:00
Andrew Bartlett
b4593e92ff JHT came up with a nasty (broken) torture case in preparing examples for
his book.

This prompted me to look at the code that reads the unix group list.  This
code did a lot of name -> uid -> name -> sid translations, which caused
problems.  Instead, we now do just name->sid

I also cleaned up some interfaces, and client tools.

Andrew Bartlett
(This used to be commit f9e59f8bc0)
2004-01-02 05:32:07 +00:00
Volker Lendecke
9f662094af After talking with abartlet remove the fix for bug 707 again.
Volker
(This used to be commit 0c8ee04c78)
2004-01-01 21:10:35 +00:00
Volker Lendecke
31ff56fd3e Fix for bug 707, getent group for huge ads groups (>1500 members)
This introduces range retrieval of ADS attributes.

I've rewritten most of Gnther's patch, partly to remove code duplication and
partly to get the retrieval of members in one rush, not interrupted by the
lookups for the DN.

Andrew, you told me that you would like to see a check whether the AD sequence
number is the same before and after the retrieval to achieve atomicity. This
would be trivial to add, but I'm not sure that we want this, as this adds two
roundtrips to every membership query. We can not know before the first query
whether we get additional range values, and at that point it's too late to ask
for the USN.

Tested with a group of 4000 members along with lots of small groups.

Volker
(This used to be commit 9d8235bf41)
2004-01-01 20:30:50 +00:00
Andrew Bartlett
5d55674b52 Changes to our PAM code to cope with the fact that we can't handle some
domains (in particular, the domain of the current machine, if it is not a PDC)

By changing the error codes, we now return values that PAM can correctly
use for better stacking of PAM modules - in particular of the password change
module.

This allows pam_winbind to co-exist with other pam modules for password changes.

Andrew Bartlett
(This used to be commit 6a8cc7f012)
2003-12-31 08:45:03 +00:00
Andrew Bartlett
b34401b48a Forgot to commit this for the 'get our primary domain' change.
(This used to be commit 6f3cd9e2af)
2003-12-31 08:42:22 +00:00
Andrew Bartlett
e6de276ff4 Jerry rightly complained that we can't assume that the first domain is
our primary domain - new domains are added to the front of the list. :-(

Use a much more reliable 'flag test' instead.  (note:  changes winbind structures, make clean).

Andrew Bartlett
(This used to be commit cc050e0137)
2003-12-31 05:26:29 +00:00
Andrew Bartlett
5eee23cc64 auth/auth_util.c:
- Fill in the 'backup' idea of a domain, if the DC didn't supply one.  This
   doesn't seem to occour in reality, hence why we missed the typo.

lib/charcnv.c:
lib/smbldap.c:
libads/ldap.c:
libsmb/libsmbclient.c:
printing/nt_printing.c:
 - all the callers to pull_utf8_allocate() pass a char ** as the first
   parammeter, so don't make them all cast it to a void **

nsswitch/winbind_util.c:
 - Allow for a more 'correct' view of when usernames should be qualified
   in winbindd.  If we are a PDC, or have 'winbind trusted domains only',
   then for the authentication returns stip the domain portion.
 - Fix valgrind warning about use of free()ed name when looking up our
   local domain.  lp_workgroup() is maniplated inside a procedure that
   uses it's former value.  Instead, use the fact that our local domain is
   always the first in the list.

Andrew Bartlett
(This used to be commit 494781f628)
2003-12-31 00:31:43 +00:00
Andrew Bartlett
bcd0e51e28 Get the DOMAIN\username around the right way (I had username\domain...)
Push the unix username into utf8 for it's trip across the socket.

Andrew Bartlett
(This used to be commit 3225f262b1)
2003-12-30 22:27:33 +00:00
Gerald Carter
318190580d Move to short lived TALLOC_CTX* for allocating printer
objects from the print handle cache.   Fixes bug that
caused smbd to consume large amounts of RAM when

(a) a printer handle was kept open over an extended
    period of time, and
(b) the client issued frequent requests that resulted
    in a call to get_a_printer()
(This used to be commit 10b9976e0a)
2003-12-30 22:17:14 +00:00
Volker Lendecke
2abf5f928f Another little one: Make pdb_test.c at least compile, although its way out of
date.

Volker
(This used to be commit 5d7a14166a)
2003-12-30 21:12:36 +00:00
Volker Lendecke
0ac7dcce6b The AFS pts command always generates completely lower-case user names. As case
is not significant in windows user names we should not lose information by
lower-casing the name before handing it to AFS.

Volker
(This used to be commit 6d2285b6d1)
2003-12-30 16:00:56 +00:00
Volker Lendecke
a0f8007da5 Fix Bug # 924
Volker
(This used to be commit 3663ed2b96)
2003-12-30 15:18:25 +00:00
Andrew Bartlett
829188b34f Try to gain a bit more consistancy in the output of usernames from ntlm_auth:
Instead of returning a name in DOMAIN\user format, we now return it in the
same way that nsswtich does - following the rules of 'winbind use default
domain', in the correct case and with the correct seperator.

This should help sites who are using Squid or the new SASL code I'm working
on, to match back to their unix usernames.

Andrew Bartlett
(This used to be commit 7a3a5a6361)
2003-12-30 13:20:39 +00:00
Andrew Bartlett
43772e1d4a Make the name of the NTLMSSP client more consistant before we lock it in stone.
(This used to be commit 0fa268863b)
2003-12-30 08:52:46 +00:00
Andrew Bartlett
ca1b7e353d Remove testing hack
(This used to be commit 96f3beb462)
2003-12-30 07:38:32 +00:00
Andrew Bartlett
adc07646a3 Move our basic password checking code from inside the authentication
subsystem into a seperate file - ntlm_check.c.

This allows us to call these routines from ntlm_auth.  The purpose of this
exercise is to allow ntlm_auth (when operating as an NTLMSSP server) to
avoid talking to winbind.  This should allow for easier debugging.

ntlm_auth itself has been reorgainised, so as to share more code between
the SPNEGO-wrapped and 'raw' NTLMSSP modes.  A new 'client' NTLMSSP mode
has been added, for use with a Cyrus-SASL module I am writing (based on vl's
work)

Andrew Bartlett
(This used to be commit 48315e8fd2)
2003-12-30 07:33:58 +00:00
Andrew Bartlett
bccf3f374b Refactor our authentication and authentication testing code.
The next move will be to remove our password checking code from the SAM
authentication backend, and into a file where other parts of samba can use
it.

The ntlm_auth changes provide for better use of common code.

Andrew Bartlett
(This used to be commit 2375abfa00)
2003-12-30 05:02:32 +00:00
Andrew Bartlett
d90e416006 Add the alignment required before all 2-byte quantities in NDR. Allows us
to correctly parse plaintext netlogon calls with odd-length passwords

Andrew Bartlett
(This used to be commit de3c3cbeeb)
2003-12-29 04:21:32 +00:00
Andrew Bartlett
5dff713735 Shutting down the connection closes outstanding sessions, so we don't need
to do it twice...

Amdrew Bartlett
(This used to be commit 8f9a069c59)
2003-12-28 09:57:29 +00:00
Andrew Bartlett
f73492a58a This patch corrects some errors in the NTLMSSP implementation, that
would incorrectly return INVALID_PARAMETER, instead of allowing a
login.

Andrew Bartlett
(This used to be commit 76c59469a3)
2003-12-27 11:33:24 +00:00
Volker Lendecke
82027c1ea2 Preliminary fix for our signing problem with failed NTLMSSP logins. This patch
solves the problem for me here, I can still successfully set up signing using
NTLMSSP against w2k3 and it does not show a signing error anymoe when the
password was wrong.

Jeremy, you might want to take a further look at it as this is not
particularly elegant.

Volker
(This used to be commit f5afaafd61)
2003-12-27 10:11:26 +00:00
Volker Lendecke
e84d8b7015 Collecting another little patch from gd@suse.de
As broken as it might be, smbwrapper.so should be put into the
libdir and not bindir.

Volker
(This used to be commit d74137d227)
2003-12-26 21:33:53 +00:00
Volker Lendecke
8bfc33f5ed Collecting some minor patches...
This adds the ability to specify the new user password for 'net ads password'
on the command line. As this needs the admin password on the command line, the
information leak is minimally more.

Patch from gd@suse.de

Volker
(This used to be commit e6b4b956f6)
2003-12-26 19:38:36 +00:00
Andrew Bartlett
66f039d58c Check the return value of string_to_sid in a few more places. (But
string_to_sid also needs to be less permissive on what it thinks are
valid sids...)

Andrew Bartlett
(This used to be commit 9080c30de8)
2003-12-26 03:14:31 +00:00
Andrew Bartlett
988f561477 Show the error message for failure to set the ldap password.
(For 'ldap password sync = yes')

Andrew Bartlett
(This used to be commit 5b682aef67)
2003-12-26 00:43:48 +00:00
Andrew Bartlett
db088293ae Based on patch by Petri Asikainen <paca@sci.fi> fix bug #387 and #330.
This patch will change order how attributes are modified
from: add, delete
to:   delete, add

This is needed to update single valued attributes in Novell NDS and
should not harm anyone else.
(This used to be commit fabf801690)
2003-12-26 00:38:12 +00:00
Andrew Bartlett
38b17cb153 ldap rebind sleep -> ldap replication sleep
While writing documentation for metze's patch, it became clear that this is a
better name.

Andrew Bartlett
(This used to be commit 6f828ff3d3)
2003-12-25 23:11:07 +00:00
Volker Lendecke
3a1b189a9f This is metze's LDAP rebind sleep patch:
When smb.conf tells us to write to a read-only LDAP replica and we are
redirected by the LDAP server, the replication might take some seconds,
especially over slow links. This patch delays the next read after a rebind for
'ldap rebind sleep' milliseconds.

Metze, thanks for your patience.

Volker
(This used to be commit 63ffa770b6)
2003-12-25 22:42:15 +00:00
Volker Lendecke
38d0c9698f Fix our parsing of the LDAP url. We get around it as all decent systems seem
to have ldap_initialize.

Thanks to abartlet for the fix (and the bug in the first place ;-))

Volker
(This used to be commit 17473a65eb)
2003-12-25 22:29:38 +00:00
Volker Lendecke
91e1154370 abartlet pointed me at the fact that the order and flags in loadparm.c are
actually used.... 'afs username map' should not show up in the swat basic
view. :-)

Maybe I should use swat from time to time....

Volker
(This used to be commit d4e071d14b)
2003-12-25 10:08:31 +00:00