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

794 Commits

Author SHA1 Message Date
Tim Potter
872b2ba35b Placeholder for winbind aix client. -
Tim Potter
93ea047a16 Cleanup of winbind client side code.
Mostly this consists of untangling the existing code and moving it in
to operating system specific files.  The winbind client code for all
supported operating systems is now in nsswitch/winbind_nss_OSNAME.[ch]
to make things a bit clearer.
-
Jelmer Vernooij
8df30059ef Don't use old usage() function, but the one from popt.
Remove some useless arguments
-
Jelmer Vernooij
d5f9b0275c Revoke some of the popt patch from metze I applied earlier today. It added
some double options and broke some parameters.
-
Jelmer Vernooij
2ddfed298d Patch from metze to generalise POPT_COMMON_SAMBA, with some minor changes -
Andrew Bartlett
ec071ca3dc (merge from HEAD)
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
18d52ce914 Convert to popt. -
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
-
Volker Lendecke
80bfa7efd6 Fix debug message not to use an uninitialized variable.
Volker
-
Volker Lendecke
71906a5b4e Fix debug message not to use an uninitialized variable.
Volker
-
Andrew Bartlett
c5b604e2ee Jeremy merged across my string parinoia fixes, but forgot to enable them! :-)
This patch catches up on the rest of the work - as much string checking
as is possible is done at compile time, and the rest at runtime.

Lots of code converted to pstrcpy() etc, and other code reworked to correctly
call sizeof().

Andrew Bartlett
-
Tim Potter
067810ed4a Merge of popt help cleanups. -
Andrew Bartlett
b5283c00a9 Merge from HEAD - make winbindd locking sane again:
Original message:


This patch attemptes to clean up winbindd's mutex locking.

The current locking scheme in winbind is a complete mess - indeed, the
next step should be to push the locking into cli_full_connection(), but
I'll leave it for now.

This patch works on the noted behaviour that 2 parts of the connection
process need protection - and independent protection.  Tim Potter did
some work on this a little while back, verifying the second case.

The two cases are:
 - between connect() and first session setup
 - during the auth2 phase of the netlogon pipe setup.

I've removed the counter on the lock, as I fail to see what it gains us.

This patch also adds 'anonymous fallback' to our winbindd -> DC connection.

If the authenticated connection fails (wbinfo -A specifed) - say that
account isn't trusted by a trusted DC - then we try an anonymous.

Both tpot and mbp like the patch.

Andrew Bartlett
-
Tim Potter
39124b9a62 Some cosmetic changes to make the popt --usage output look nicer. -
Andrew Bartlett
bf5e0698ee If it's an fstring, use fstrcpy().
Andrew Bartlett
-
Andrew Bartlett
0620320002 This patch attemptes to clean up winbindd's mutex locking.
The current locking scheme in winbind is a complete mess - indeed, the
next step should be to push the locking into cli_full_connection(), but
I'll leave it for now.

This patch works on the noted behaviour that 2 parts of the connection
process need protection - and independent protection.  Tim Potter did
some work on this a little while back, verifying the second case.

The two cases are:
 - between connect() and first session setup
 - during the auth2 phase of the netlogon pipe setup.

I've removed the counter on the lock, as I fail to see what it gains us.

This patch also adds 'anonymous fallback' to our winbindd -> DC connection.

If the authenticated connection fails (wbinfo -A specifed) - say that
account isn't trusted by a trusted DC - then we try an anonymous.

Both tpot and mbp like the patch.

Andrew Bartlett
-
Tim Potter
560deeb4ec Remove obsolete file. -
Tim Potter
c5c1a79793 Remove obsolete file. -
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
-
Jeremy Allison
a670b57c56 Fix "might be used uninitialised" warnings.
Jeremy.
-
Andrew Tridgell
7dfd59963d fixed a crash bug in the new winbindd 'sids rule!' code -
Jeremy Allison
a82caefda4 *Excellent* patch from Michael Steffens <michael_steffens@hp.com> to limit
the unix domain sockets used by winbindd (also solves FD_SETSIZE problem
in winbindd to boot !). Adds a "last_access" field to winbindd connections,
and will close the oldest idle connection once the number of open connections
goes over WINBINDD_MAX_SIMULTANEOUS_CLIENTS (defined in local.h as 200
currently).
Jeremy.
-
Jeremy Allison
7a586552a3 *Excellent* patch from Michael Steffens <michael_steffens@hp.com> to limit
the unix domain sockets used by winbindd (also solves FD_SETSIZE problem
in winbindd to boot !). Adds a "last_access" field to winbindd connections,
and will close the oldest idle connection once the number of open connections
goes over WINBINDD_MAX_SIMULTANEOUS_CLIENTS (defined in local.h as 200
currently).
Jeremy.
-
Andrew Bartlett
052ebc44cd Fix possible memory leak on failure. -
Andrew Bartlett
9247cf08c4 Kill RID-only and domain+RID madness from winbind.
Now we deal with SIDs in almost all of winbind (a couple of limited exceptions
remain, but I'm looking into them - they use non-winbind structs ATM).

This has particular benifits in returning out-of-domain SIDs for group
membership (Need to look into this a bit more) as well as general code quality.

This also removes much of the complexity from the idmap interface, which now
only deals with mapping IDs, not with SID->domain translations.

Breifly tested, but needs more.  Fixes some valgrind-found bugs from my
previous commit.

Winbind cache chagned to using SID strings in some places, as I could not
follow exactly how to save and restore multiple packed sids properly.

Andrew Bartlett
-
Tim Potter
0501b7d0b1 Merge from appliance:
>Another hopeful fix for CR#1168.  Change the RPC used in querying
>domain users from QueryDispInfo to EnumDomainUsers.  Hopefully this
>will fix the random dropouts that keep occuring when listing large
>domains.
>
>My thought is that since QueryDispInfo is only used in the NT user
>manager it may have a bug with large domains.  A more commonly used
>RPC may not have such problems.
-
Tim Potter
df49463e62 Merge: newline on debug message. -
Tim Potter
8de62f7896 Merge: add popt_common_version to command line options table. -
Andrew Bartlett
212a52b3d2 After some comments from tridge, clean the new usergroups code into a helper
function.

Andrew Bartlett
-
Andrew Bartlett
a074f74e62 Fix a really nasty bug where some users in AD domains (particularly child
domains) would not have the tokenGroups or memberOf attributes filled in.

This would cause a user to have no supplementary group membership.

Detect this by the fact that the primaryGid must be present in the tokenGroups,
and if it isn't (ie, if there is no tokenGroups at all), do a server-side
search on all groups using the 'member' attribute and the user's DN.

Andrew Bartlett
-
Andrew Bartlett
837680ca51 Merge from HEAD client-side authentication changes:
- new kerberos code, allowing the account to change it's own password
   without special SD settings required
 - NTLMSSP client code, now seperated from cliconnect.c
 - NTLMv2 client code
 - SMB signing fixes

Andrew Bartlett
-
Andrew Bartlett
e3b73d5d65 Fix a DEBUG() formatting, add some more debug to our SID pulling code and
inline the call to prs_copy_all_data_out() so that we can know we are not
overrunning our buffer.

Also check more return values.

Andrew Bartlett
-
Jim McDonough
822083f73e rename 'winbind backend' to 'idmap backend'. Put paramter in security section...does this make sense? -
Tim Potter
1ea27d7987 Fix another compiler warning. -
Jim McDonough
35e4448dcb From aliguori@us.ibm.com:
This patch adds the architecture for an IDMAP backend system including a new
smb.conf parameter "winbind backend".  Right now, the only valid value is "tdb"
but I'm currently working on an LDAP backend.
-
Andrew Bartlett
9fdedeff6a for some (very weird) reason, the domain I was testing aginst would not
return a DN for the user.  Make sure we don't segfault.

Andrew Bartlett
-
Tim Potter
c4f46890fe Merge some random looking setenv related kerberos stuff that makes
winbindd build again.
-
Andrew Bartlett
cd6ad1f13b Merge from HEAD: We don't need this any more, setenv() is in replace.c now -
Andrew Bartlett
e9d6e2ea9a Merge minor library fixes from HEAD to 3.0.
- setenv() replacement
 - mimir's ASN1/SPNEGO typo fixes
 - (size_t)-1 fixes for push_* returns
 - function argument signed/unsigned correction
 - ASN1 error handling (ensure we don't use initiailsed data)
 - extra net ads join error checking
 - allow 'set security discriptor' to fail
 - escape ldap strings in libads.
 - getgrouplist() correctness fixes (include primary gid)

Andrew Bartlett
-
Andrew Bartlett
adad4c66fc Missed one use of SETENV. (Compat macro no longer needed, as we have a
replace.c function).
-
Andrew Bartlett
50bced1e26 Move to a in-memory ccache for winbind, and replace setenv() properly.
(According to the manpages, you cannot put a stack variable into putenv()).

Yes, this leaks memory.

Andrew Bartlett
-
Jelmer Vernooij
5de622968d Add -V option (to print out version) to utilities where possible
(pdbedit already has a -V option..)
-
Martin Pool
606bb47f24 Check return code of string_to_sid. (Merge from HEAD) -
Martin Pool
fe449328b2 Check return code from string_to_sid. -
Jeremy Allison
20798ac739 Patch based on work by Michael Steffens <michael_steffens@hp.com> to wrap
all cm_get_XX calls and their subsequent requests in a retry loop in case
we've temporarily lost connection to the DC. Makes winbindd more reliable.
Jeremy.
-
Jeremy Allison
81f358b632 Patch based on work by Michael Steffens <michael_steffens@hp.com> to wrap
all cm_get_XX calls and their subsequent requests in a retry loop in case
we've temporarily lost connection to the DC. Makes winbindd more reliable.
Jeremy.
-
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.
-
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.
-
Tim Potter
5cfb30551a Mop and bucket for trusted domain enumeration fix. -
Tim Potter
7420ddcda8 Fix for trusted domains scan not working inspired by Ken Cross.
(Sorry - I should have checked this in yesterday but forgot)
-