1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-29 21:47:30 +03:00

281 Commits

Author SHA1 Message Date
Andrew Bartlett
74b5436c75 Merge of server-side authentication changes to 3.0:
- user_ok() and user_in_group() now take a list of groups, instead of
   looking for the user in the members of all groups.

 - The 'server_info' returned from the authentication is now kept around
  - in future we won't copy the sesion key, username etc, we will just
    referece them directly.

 - rhosts upgraded to use the SAM if possible, otherwise fake up based on
   getpwnam().

 - auth_util code to deal with groups upgraded to deal with non-winbind domain
   members again.

Andrew Bartlett
-
Andrew Bartlett
6aa3aba3db Merge from HEAD - allow "" as a domain in the NLTMv2 hash calculations. Fixes
interop with clients not in our domain.

Andrew Bartlett
-
Jeremy Allison
a823fee5b4 Ensure that only parse_prs.c access internal members of the prs_struct.
Needed to move to disk based i/o later.
Jeremy.
-
Andrew Bartlett
c1cfc296c2 Cleanups: (merge from HEAD)
- use safe_strcpy() instead of pstrcpy() for malloc()ed strings

 - CUPS: a failure in an attempt to automaticly add a printer is not level 0 stuff.

 - Fix up a possible Realloc() failure segfault

Andrew Bartlett
-
Andrew Bartlett
830de56bf2 Merge HEAD: check both the account and password...
Andrew Bartlett
-
Andrew Bartlett
fbb46da79c Merge from HEAD:
- NTLMSSP over SPENGO (sesssion-setup-and-x) cleanup and code refactor.
  - also consequential changes to the NTLMSSP and SPNEGO parsing functions
  - and the client code that uses the same functions
 - Add ntlm_auth, a NTLMSSP authentication interface for use by applications
   like Squid and Apache.
  - also consquential changes to use common code for base64 encode/decode.
 - Winbind changes to support ntlm_auth (I don't want this program to need
   to read smb.conf, instead getting all it's details over the pipe).
 - nmbd changes for fstrcat() instead of fstrcpy().

Andrew Bartlett
-
cvs2svn Import User
b741abd496 This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. -
Andrew Bartlett
fe50ca8f54 Updates to the NTLMSSP code again - moving the base64 decode fuctionality out
of the SWAT code, and adding a base64 encoder.

The main purpose of this patch is to add NTLMSSP support to 'ntlm_auth', for
use with Squid.  Unfortunetly the squid side doesn't quite support what we need
yet.

Changes to winbind to get us the info we need, and a couple of consequential
changes/cleanups in the rest of the code.

Andrew Bartlett
-
Andrew Bartlett
ba13e058d4 Missed auth_ntlmssp.c in last night's checkin. Also keep track of the current
challenge in the NTLMSSP context.

Andrew Bartlett
-
Andrew Bartlett
51b1413056 Crash fixes:
- fix a crash when a second NTLMSSP session tried to free the first
 - fix a crash due to some NULL pointers in the Add Printer Wizard (or read
   printer code too it appears).  As far as I can tell it's just that the
   GUID just might not exist.

Andrew Bartlett
-
Andrew Bartlett
2a1adb8f81 Merge indirection, signed/unsigned and uninitialiased-value fixes from HEAD.
Andrew Bartlett
-
Jeremy Allison
faf443e519 Missing indirect in final free.
Jeremy.
-
Jeremy Allison
67a0b30f50 Merge of indirection fixes from HEAD.
Jeremy
-
Andrew Bartlett
740bf439d2 Always initialise this variable - and don't set the 'must change now' if it was
last changed at '0'.

We need to actually change this password sometime...

Andrew Bartlett
-
Andrew Bartlett
18e598ec24 Patch from metze to add what he feels is the correct semantics for a Domain
Controller.  As we have had a number of attempts at this over the last little
while, I need to get my test rig going, and give this whole area a poke...

Meanwhile, if you want to use this, just adjust your 'auth methods' line to use
samstrict_dc...

Andrew Bartlett
-
Andrew Bartlett
b6641badcb Updates to our NTLMSSP code:
This tries to extract our server-side code out of sessetup.c, and into a more
general lib.  I hope this is only a temporay resting place - I indend to
refactor it again into an auth-subsystem independent lib, using callbacks.

Move some of our our NTLMSSP #defines into a new file, and add two that I found
in the COMsource docs - we seem to have a double-up, but I've verified from
traces that the NTLMSSP_TARGET_TYPE_{DOMAIN,SERVER} is real.

This code also copes with ASCII clients - not that we will ever see any here,
but I hope to use this for HTTP, were we can get them.  Win2k authenticates
fine under forced ASCII, btw.

Tested with Win2k, NTLMv2 and Samba's smbclient.

Andrew Bartlett
-
Andrew Bartlett
7abca6d281 Fix to debian bug #171071 - we had the wrong dereference on the pointer to be
Realloc()ed, causing it to fail.

Big thanks to Sandor Sonfeld <sonf@linuxmail.org> for the debug, stack and
valgrind traces!

Andrew Bartlett
-
Andrew Bartlett
f42cf0783f Use size_t for the counter vars, to match the type they are assigned from
(signed/unsigned mixup).

Andrew Bartlett
-
Andrew Bartlett
32a1802a99 Merge from HEAD - updates to correctly recognise LMv2, and NT# in LM feild.
Andrew Bartlett
-
Andrew Bartlett
5c2e34b5b6 Clear up the auth_sam password checking code (the core of our password checking
routines).  In particular, we now better support the NT# in LM feild, and the
LMv2 password scheme.  (LMv2 is basicly NTLMv2 capped at 24 bytes, slightly
more secure, and in the LM feild for compatiblity).

Thanks to the Samba-TNG team and Luke Leighton for various descriptions of this
algorithm, and to MS for a solution that seems to actually make sense for once
:-).

Andrew Bartlett
-
Andrew Bartlett
610be8d483 Make it clear that the credentials are being setup on the NETLOGON channel, and
may not be to our PDC (might be BDC, or trusted DC).

Andrew Bartlett
-
Andrew Bartlett
91ca4771c6 Merge from HEAD - we already have one function for converting a unistr2 to a
static 'unix' string, so we don't need a second pdb specific version.

Andrew Bartlett
-
Andrew Bartlett
3a7458f947 Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
-
Andrew Bartlett
f71c8338d3 We already have one function to move unistr2 -> multibyte-static, so we
don't need a second just for pdb.

Also, remove magic 'is lp_guest_account' test - the magic RID should be
up to the passdb backend to set.

Andrew Bartlett
-
Andrew Bartlett
92a777d0ea BIG patch...
This patch makes Samba compile cleanly with -Wwrite-strings.
 - That is, all string literals are marked as 'const'.  These strings are
always read only, this just marks them as such for passing to other functions.

What is most supprising is that I didn't need to change more than a few lines of code (all
in 'net', which got a small cleanup of net.h and extern variables).  The rest
is just adding a lot of 'const'.

As far as I can tell, I have not added any new warnings - apart from making all
of tdbutil.c's function const (so they warn for adding that const string to
struct).

Andrew Bartlett
-
Jeremy Allison
aa8439a49e Finish adding strings to all talloc_init() calls.
Jeremy.
-
Jeremy Allison
784d15761c Finish adding strings to all talloc_init() calls.
Jeremy.
-
Jeremy Allison
842e08e52a Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
-
Jeremy Allison
09a218a9f6 Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
-
Gerald Carter
f49de4c517 merge of get_dc_name()-like code from APP_HEAD; better support password server = DC1 * -
Gerald Carter
6b18ca9511 merge of get_dc_name()-like code from APP_HEAD; better support password server = DC1 * -
Jeremy Allison
ff3a8d3728 Fixed auth module code. Added VALGRIND defines to reduce spurious warnings.
Jeremy.
-
Jeremy Allison
ec4ed45563 Fixed auth module code. Added VALGRIND defines to reduce spurious warnings.
Jeremy.
-
Andrew Bartlett
7d099e9a5b Make it clear that we might not be talking to a PDC here. -
Tim Potter
d3998307ad Merge a bunch of trivial changes from HEAD. The difference remaining
should actual functional differences between HEAD and 3.0.

 - Mostly reformatting
 - Removal of unecessary #include "smb.h"
 - Merge of dyn_DRIVERFILE removal
 - Silly bug fix for python code
-
Gerald Carter
016ef8b36b [merge from APP_HEAD]
90% fix for CR 1076.  The password server parameter will no take things
like

        password server = DC1 *

which means to contact DC1 first and the go to auto lookup if it
fails.


jerry
-
Gerald Carter
c31a17889e [merge from APP_HEAD]
90% fix for CR 1076.  The password server parameter will no take things
like

        password server = DC1 *

which means to contact DC1 first and the go to auto lookup if it
fails.


jerry
-
Andrew Bartlett
43e90eb6e3 Updates from HEAD:
- const for PACKS() in lanman.c
 - change auth to 'account before password'
 - add help to net rpc {vampire,samsync}
 - configure updates for sun workshop cc
 - become_root() around pdb_ calls in auth_util for guest login.

Andrew Bartlett
-
Andrew Bartlett
e6d2debaf6 Small auth updates:
- add static remove unnneded prototype
 - move become_root() to just around pdb calls, so as to make it easier to
remove when we kill off this silly idea
 - Change auth_sam to do 'account before password' rather than 'password before
account'.  This means that we match Win2k in giving 'account disabled' instead
of 'wrong password' if the wrong password to a disabled account is used.

Andrew Bartlett
-
Jeremy Allison
f755711df8 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
-
Jeremy Allison
82b8f749a3 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
-
Jeremy Allison
90ac8184a0 Fix bug found by tpot with given password server.
Jeremy.
-
Jeremy Allison
d46b4cb563 Fix bug found by tpot with given password server.
Jeremy.
-
Andrew Bartlett
4e74d00b36 Merge from HEAD:
- change auth_sam to use the initialisation flags to determine if
	 the password attributes are set

 - add const to secrets.c, cliconnect.c

 - passdb:  fix spelling in pdb_ldap, add group mapping back to smbpasswd

 - SAMR: add debugs to show what fails for group enum.

Andrew Bartlett
-
Tim Potter
3692919aee Don't set global_machine_password_needs_changing if
lp_machine_password_timeout() is set to zero.
-
Tim Potter
0fa87a68fe Don't set global_machine_password_needs_changing if
lp_machine_password_timeout() is set to zero.
-
Tim Potter
6ba7847ce2 Merge of get_dc_list() api change from HEAD. -
Tim Potter
1e054e3db6 Merge of get_dc_list() api change. This was slightly more intrusive
than the version in APPLIANCE so watch out for boogs.
-
Andrew Bartlett
2115335857 Move to the use of the 'initialised' flag, rather than the fact the pointer is
NULL.

Andrew Bartlett
-
Andrew Tridgell
918099f096 make_server_info_guest() can need root for the ldapsam backend -