1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-11 17:58:16 +03:00

291 Commits

Author SHA1 Message Date
Gerald Carter
5ccf6baad7 more 2.2.x compatibility fixes - allow user looksup in the kerb5
sesssetup to fall back to 'user' instaed of failing is REA.LM\user
doesn't exist.

also fix include line in smb_acls.h as requested by metze
-
Gerald Carter
19925e3a04 make sure to call get_user_groups() with the full winbindd name for a user if he;she has one; bug 406 -
Gerald Carter
c17a7dc9a1 sync 3.0 into HEAD for the last time -
Simo Sorce
3101c236b8 port latest changes from SAMBA_3_0 tree -
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
-
Tim Potter
e063c95bd5 Spelling. -
Gerald Carter
63bb1e21eb volker's fix for crash when my_private_data == NULL -
Volker Lendecke
55cdb6b878 Correctly initialize winbind auth method. -
Jelmer Vernooij
3d804efe76 Patch from Luke Howard <lukeh@PADL.COM> that fixes some weird handling of
modules in auth/
-
Tim Potter
249a697470 spelling -
Simo Sorce
6d036761e5 *id_to_*id call reshape to return NTSTATUS errors
plus internal fixes
1st stage
-
Jelmer Vernooij
3895571eee Use ints for the version numbers in the smb_register_*() functions (patch by metze) -
Simo Sorce
6a6f603246 This is a nice rewrite:
SAM_ACCOUNT does not have anymore uid and gid fields
all the code that used them has been fixed to use the proper idmap calls

fix to idmap_tdb for first time idmap.tdb initialization.

auth_serversupplied_info structure has now an uid and gid field

few other fixes to make the system behave correctly with idmap

tested only with tdbsam, but smbpasswd and nisplus should be ok

have not tested ldap !
-
Jelmer Vernooij
f4576757d1 Use NTSTATUS as return value for smb_register_*() functions and init_module()
function. Patch by metze with some minor modifications.
-
Andrew Bartlett
c0903951a1 Merge compile warning fixes from 3.0 -
Andrew Bartlett
3bdbd320b0 Add some static and #ifdef DEVELOPER -
Andrew Bartlett
6e6b7b79ed Store the type of 'sec channel' that we establish to the DC. If we are a
workstation, we have to use the workstation type, if we have a BDC account,
we must use the BDC type - even if we are pretending to be a workstation
at the moment.

Also actually store and retreive the last change time, so we can do
periodic password changes again (for RPC at least).

And finally, a couple of minor fixes to 'net'.

Andrew Bartlett
-
Andrew Bartlett
119a1c276a Cause the winbind auth module to call the ntdomain module if winbind is not
running.

This causes Samba not to contact the NT domain controller if Winbind is there,
but the user had the wrong password.

Andrew Bartlett
-
Andrew Bartlett
7c7c5594b3 We never actually got an 'ads' auth module, so don't send the auth subsystem
off on a wild probing spree looking for it.

Andrew Bartlett
-
Simo Sorce
5ac94535d7 some more idmapping :) -
Andrew Bartlett
1afb2695a0 Map a useless error code to a useful one... -
Jelmer Vernooij
71b05cd14a - Support building all auth modules as .so's
- Change 2 variable names to avoid conflicts (patch by Stephan Kulow <coolo@kde.org>)
-
Volker Lendecke
8e3f300f21 Make auth.c compile again. I'm not sure what this does though...
Volker
-
Jelmer Vernooij
3defbd5e06 - Add support to auth/ for the new modules system
- Quite some small fixes (also fixes the build)
-
Andrew Bartlett
6fbee12a81 Fix compile. -
Andrew Bartlett
dcdc75ebd8 NTLM Authentication:
- Add a 'privileged' mode to Winbindd.  This is achieved by means of a directory
  under lockdir, that the admin can change the group access for.

- This mode is now required to access with 'CRAP' authentication feature.
- This *will* break the current SQUID helper, so I've fixed up our ntlm_auth
  replacement:
 - Update our NTLMSSP code to cope with 'datagram' mode, where we don't get a
   challenge.
 - Use this to make our ntlm_auth utility suitable for use in current Squid 2.5
   servers.
 - Tested - works for Win2k clients, but not Win9X at present.  NTLMSSP updates
   are needed.
 - Now uses fgets(), not x_fgets() to cope with Squid environment (I think
   somthing to do with non-blocking stdin).

- Add much more robust connection code to wb_common.c - it will not connect to
  a server of a different protocol version, and it will automatically try and
  reconnect to the 'privileged' pipe if possible.
  - This could help with 'privileged' idmap operations etc in future.

- Add a generic HEX encode routine to util_str.c,
- fix a small line of dodgy C in StrnCpy_fn()

- Correctly pull our 'session key' out of the info3 from th the DC.  This is
  used in both the auth code, and in for export over the winbind pipe to
  ntlm_auth.

- Given the user's challenge/response and access to the privileged pipe,
  allow external access to the 'session key'.  To be used for MSCHAPv2
  integration.

Andrew Bartlett
-
Jelmer Vernooij
41ea416adb Fix some comment typos -
Andrew Bartlett
7154fe1096 Now that mimir has done the grunt work, I'll fix up the comment -
Rafal Szczesniak
0cd45d5d3b Extending code to work both in case of domain membership
and domain controller respecting interdomain trust relationships.
In the latter case we need to find DC of remote domain instead
of ours. In the former 'domain' is our domain name.


Rafal
-
Rafal Szczesniak
5281ee7e84 Fresh meat in trusted domains code:
- packing/unpacking utility functions for trusted domain
   password struct; can be used to prepare buffer to store
   in secrets.tdb or (soon) passdb backend
 - similiar functions for DOM_SID
 - respectively modified secrets_(fetch|store) routines
 - new auth mapping code utilising introduced is_trusted_domain
   function
 - added tdb (un)packing of single bytes



Rafal
-
Andrew Bartlett
afe5a3832f Make sure that the 'remote' machine name can only be set once. For some weird
reason, during a Win2003 installation, when you select 'domain join' it sends
one machine name in the name exchange, and litraly 'machinename' during the
NTLMSSP login.

Also fix up winbindd's logfile handling, so that it matches smbd and nmbd.

(This helps me, by seperating the logs by pid).

Andrew Bartlett
-
Martin Pool
9dbc3dcfe0 Doxygen janitor: rpc_resolve_dc parameter is spelled "trust_passwd" -
Martin Pool
571c3ce193 Doxygen janitor: check_domain_match parameter is spelled
"auth_context".
-
Andrew Bartlett
5a472e2a3c Make sure we set the error code to indicate failure...
Andrew Bartlett
-
Andrew Bartlett
cfc4cc7768 See if I can make this look slightly like C. It compiled locally, honest...
Andrew Bartlett
-
Andrew Bartlett
61e3e26958 First check if the user is in the passdb, then check Get_Pwnam().
We check passdb becouse the user might have things like a logon script set,
but we have to check the passdb becouse the user might not be in smbpasswd at
all.

This is in preperation for the removal of unixsam as an assuption.

Andrew Bartlett
-
Andrew Bartlett
980eda74b7 For a number of months now, support for being a domain member without also
running winbind has been broken.  This fixes that, by removing assumptions
about being able to call sid_to_uid() at will.  This whole area needs
revising when we get groups into the PDB.

Andrew Bartlett
-
Andrew Bartlett
960c53bf95 If we didn't make the server_info correctly, then don't segfault trying to
set the 'guest' bit.

Andrew Bartlett
-
Andrew Bartlett
ddaa42423b Add the 'session key' output of the NTLMSSP exchange to the cli struct, so
it can be used for 'net rpc join'.

Also fix a bug in our server-side NTLMSSP code - a client without any domain
trust links to us may calculate the NTLMv2 response with "" as the domain.

Andrew Bartlett
-
Jeremy Allison
4c3ee228fc 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
162477bb08 Some cleanups:
- Don't use pstrcpy into an allocated string - use safe_strcpy() directly
instead.

- Keep a copy of the 'server_info' attached to the vuid.  In future use this
for things like the session key, homedir and full name instead of current
copies.

- Try to avoid memory leak/segfault on Realloc failure

- clear up #endif comments

Andrew Bartlett
-
Andrew Bartlett
49640635b1 Actually checking both the account and password tests would be a good idea...
Andrew Bartlett
-
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
-
Jeremy Allison
faf443e519 Missing indirect in final free.
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
-