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

173 Commits

Author SHA1 Message Date
Gerald Carter
df1e2693dc r21009: Patch from Danilo Almeida @ Centeris (via me).
Patch details:

Support most options in pam_winbind.conf; support comma-separated names in
require-membership-of.  Details below:

1) Provides support for almost all config options in pam_winbind.conf
   (all except for use_first_pass, use_authtok, and unknown_ok).

 - That allows us to work well when invoked via call_modules from
   pam_unix2.conf as well as allowing use of spaces in names used
   w/require_membership_of.

2) Support for comma-separated list of names or SID strings in
   require_membership_of/require-membership-of.

 - Increased require_membership_of field in winbind request from fstring
   (256) to pstring (1024).

 - In PAM side, parse out multiple names or SID strings and convert
   all of them to SID strings.

 - In Winbind side, support membership check against multiple SID strings.
(This used to be commit 4aca986489)
2007-10-10 12:17:26 -05:00
Gerald Carter
c47347ebe9 r20905: Windows 2000 returns NT_STATUS_ACCOUNT_RESTRICTION if the pw
chnage fails due to policy settings where as 2003 (the chgpasswd3()
request) fails with NT_STATUS_PASSWORD_RESTRICTION.  Thunk down
to the same return code so we correctly retreive the password policy
in both cases.
(This used to be commit 262bb80e9c)
2007-10-10 12:17:18 -05:00
Volker Lendecke
afb5cda0de r20725: Get rid of a bool passed down -- gd, please check
(This used to be commit 1ef910f423)
2007-10-10 12:17:07 -05:00
Günther Deschner
0d538f7370 r20687: Implement grace logons for offline authentications in pam_winbind.
In case a user authenticated sucessfully and his password just expired
while beeing disconnected, we should allow a user to logon (given a
clear warning). We currently forced the user into a password change
dialogue in that scenario; this did not make much sense while offline.

Guenther
(This used to be commit 668b278653)
2007-10-10 12:17:02 -05:00
Günther Deschner
bd7b2c76f3 r20254: The pam_chauthtok needs to go through the async interface as well.
This fixes pam password changes in the online case.

Guenther
(This used to be commit 2d2de1ac27)
2007-10-10 12:16:37 -05:00
Jeremy Allison
63d8197453 r20180: Ensure that pam returns the correct error messages
when offline and or doing password changes.
Jeremy.
(This used to be commit 4a74c55384)
2007-10-10 12:16:30 -05:00
Günther Deschner
3ff4f4410f r20171: Don't delete the krb5 credential if others still reference to it.
Guenther
(This used to be commit a1378979be)
2007-10-10 12:16:29 -05:00
Jeremy Allison
9421a0a9cd r19207: Properly canonicalize incoming names to the
NSS protocols auth, chauthtok, logoff, ccache_ntlm_auth.
That way we ensure winbindd only deals with fully
qualified names internally. The NSS protocols
auth_crap and chng_pswd_auth_crap should be fixed
to do the same thing.
Jeremy.
(This used to be commit dbd2454d33)
2007-10-10 12:15:21 -05:00
Jeremy Allison
10ada62bed r19148: Finish last nights patch - make offline
work again. Still under test.
Jeremy.
(This used to be commit 40a455db78)
2007-10-10 12:15:16 -05:00
Günther Deschner
35b1d063e1 r18871: Fix copy/paste mixup.
Guenther
(This used to be commit 2a605a0b17)
2007-10-10 12:14:40 -05:00
Günther Deschner
c4046b0e88 r18710: Prevent that our offline cache can get outdated after a password change.
Guenther
(This used to be commit 8006cf962b)
2007-10-10 12:00:50 -05:00
Jeremy Allison
07e9f4e61a r18551: Implement a 30 seconds from startup, during which we
try hard to connect a DC even if we might be offline.
Jeremy.
(This used to be commit a9f1151407)
2007-10-10 11:51:49 -05:00
Gerald Carter
2b27c93a9a r18271: Big change:
* autogenerate lsa ndr code
* rename 'enum SID_NAME_USE' to 'enum lsa_SidType'
* merge a log more security descriptor functions from
  gen_ndr/ndr_security.c in SAMBA_4_0

The most embarassing thing is the "#define strlen_m strlen"
We need a real implementation in SAMBA_3_0 which I'll work on
after this code is in.
(This used to be commit 3da9f80c28)
2007-10-10 11:51:18 -05:00
Günther Deschner
cf469f2af1 r18259: Fix the non-krb5 builds.
Guenther
(This used to be commit 576488933b)
2007-10-10 11:51:18 -05:00
Jeremy Allison
01285feba1 r18239: THIS IS GUENTHER'S WORK !!! He's allowing me to merge
this at the moment as I'm working on this area. Thanks
a lot Guenther.
Add the capability to get krb5 tickets even if we
log on in the offline state and have to cache
the credentials. Once we go online we should
start getting krb5 tickets again. Currently
this code waits until lp_winbind_cache_time()
seconds (5 minutes by default) before getting
tickets. This is correct in the DC down case,
but not in the global offline -> online case.
I'll later add a trigger to force an immediate refresh
on the offline -> online state transition.
Jeremy.
(This used to be commit 04fe034f4a)
2007-10-10 11:51:17 -05:00
Jelmer Vernooij
995205fc60 r18188: merge 3.0-libndr branch
(This used to be commit 1115745cae)
2007-10-10 11:43:56 -05:00
Günther Deschner
030cf71d61 r18158: Stop winbindd from accumulating memory creds infinitely when doing
pam offline logons.

Guenther
(This used to be commit 95788cb291)
2007-10-10 11:43:29 -05:00
Jeremy Allison
d2465b1730 r18062: Fix to ensure the name used by pam matches the
name that will be returned by winbindd. This
(should) fix the bug where the user logs in
with DOMAIN\user but winbindd returns only
"user" for the username due to 'winbind use
default domain' being set.
Jeremy.
(This used to be commit 1b2aa17354)
2007-10-10 11:43:24 -05:00
Volker Lendecke
f5906de76d r18028: Fix warnings on non-krb5 systems
(This used to be commit 30df6cb65f)
2007-10-10 11:43:23 -05:00
Jeremy Allison
8e0a4e7e6f r17897: Store the uid in the memory creds. Don't request the
krb5 refresh creds when doing cached NTLM auth, request
the memory creds instead.
Jeremy.
(This used to be commit 310ac0b226)
2007-10-10 11:38:57 -05:00
Jeremy Allison
e627362622 r17837: Split out the storing of memory cached credentials
from the krb5 ticket renewal code. This allows cached
credentials to be stored for single sign-on via ntlm_auth
for machines in a domain still using NTLM. Also (hopefully)
fixes the reference counting problem with pam_logon/logoff
so multiple logons/logoffs won't lose cached credentials.
This compiles, but I'm intending to test it over the weekend
so don't complain too much :-). I also want it in the tree
so Coverity can scan it for errors. Guenther, check this over
please - I ran through the architecture with Jerry and he's
ok with it, but this is modifying your code a lot.
Jeremy.
(This used to be commit 679eeeb911)
2007-10-10 11:38:53 -05:00
Gerald Carter
975b159490 r17723: * BUG 3969: Fix unsigned time comparison with expiration policy from AD DC
* Merge patches from SLES10 to make sure we talk to the correct
  winbindd process when performing pam_auth (and pull the password policy info).
(This used to be commit 43bd8c00ab)
2007-10-10 11:38:46 -05:00
Jeremy Allison
4031af7606 r17617: Take Andrew Bartletts excellent advice and don't store
the nt hash directly in the winbindd cache, store a
salted version (MD5 of salt + nt_hash). This is what
we do in the LDAP password history code. We store
this salted cache entry under the same name as an old
entry (CRED/<sid>) but detect it on read by checking
if there are 17 bytes of data after the first stored
hash (1 byte len, 16 bytes hash). GD PLEASE CHECK.
Jeremy.
(This used to be commit 89d0163a97)
2007-10-10 11:38:43 -05:00
Jeremy Allison
b41e14abfd r17610: Added the ability for firefox to drive the winbindd
ntlm_auth module to allow it to use winbindd cached
credentials.The credentials are currently only stored
in a krb5 MIT environment - we need to add an option to
winbindd to allow passwords to be stored even in an NTLM-only
environment.
Patch from Robert O'Callahan, modified with some fixes
by me.
Jeremy.
(This used to be commit ae7cc298a1)
2007-10-10 11:38:43 -05:00
Volker Lendecke
0b56ff1ea3 r17605: Some C++ warnings
(This used to be commit 05268d7a73)
2007-10-10 11:38:42 -05:00
Andrew Bartlett
0dc8f720e1 r17005: Add a new helper mode to ntlm_auth: ntlm-change-password-1
This mode proxies pre-calculated blobs from a remote (probably VPN)
client into the domain.  This allows clients to change their password
over a PPTP connection (where they would not be able to connect to
SAMR directly).

The precalculated blobs do not reveal the plaintext password.

Original patch by Alexey Kobozev <cobedump@gmail.com>
(This used to be commit 967292b713)
2007-10-10 11:19:17 -05:00
Jeremy Allison
61578c2308 r16610: Subtle one from Klocwork #2076. If multiple flags
are set in a winbindd request it might overwrite existing
state->response.extra_data.data values without freeing.
Jeremy.
(This used to be commit 4e7262c81a)
2007-10-10 11:19:03 -05:00
Günther Deschner
e9b3f293ae r16480: (Ugly) workaround before the set_dc_type_flags & friends cleanup:
When trying to login using krb5 with a trusted domain account, we
need to make sure that our and the remote domain are AD.

Guenther
(This used to be commit 5853525f11)
2007-10-10 11:18:56 -05:00
Günther Deschner
4e7e731849 r16473: There is no point in calling set_dc_type_and_flags() before each
pam_auth login (when using kerberos).

Guenther
(This used to be commit 520777f794)
2007-10-10 11:18:55 -05:00
Günther Deschner
9f8adde941 r15983: Honour the krb5 principal name change (of the new ads join code) in the
kerberized winbind pam_auth.

Guenther
(This used to be commit 216125fe13)
2007-10-10 11:17:16 -05:00
Günther Deschner
bb09655e84 r15982: Fix confusing order of DEBUG statements in winbindds pam_auth.
Guenther
(This used to be commit 3f5a2e49c1)
2007-10-10 11:17:16 -05:00
Jeremy Allison
71465a6fbc r15539: Use portable wrapper functions instead of seteuid
directly in winbindd.
Jeremy.
(This used to be commit 2e65fcc9de)
2007-10-10 11:16:56 -05:00
Günther Deschner
f777697508 r15523: Honour the time_offset also when verifying kerberos tickets. This
prevents a nasty failure condition in winbindd's pam_auth where a tgt
and a service ticket could have been succefully retrieved, but just not
validated.

Guenther
(This used to be commit a75dd80c62)
2007-10-10 11:16:55 -05:00
Günther Deschner
af3490061b r15398: Attempt to send the correct warning when a password change was attempted
too early.

Guenther
(This used to be commit 7f64a66d25)
2007-10-10 11:16:40 -05:00
Günther Deschner
5b7ab95fc6 r15396: Cleanup credential caches from winbind's linked list.
Guenther
(This used to be commit 7420b09507)
2007-10-10 11:16:39 -05:00
Günther Deschner
351e749246 r15240: Correctly disallow unauthorized access when logging on with the
kerberized pam_winbind and workstation restrictions are in effect.

The krb5 AS-REQ needs to add the host netbios-name in the address-list.

We don't get the clear NT_STATUS_INVALID_WORKSTATION code back yet from
the edata of the KRB_ERROR but the login at least fails when the local
machine is not in the workstation list on the DC.

Guenther
(This used to be commit 8b2ba11508)
2007-10-10 11:16:29 -05:00
Günther Deschner
66fd215dc7 r15229: Save useless roundtrips in pam_auth (fallback to samlogon) when we know
that the DC is not available.

Guenther
(This used to be commit 77407c0219)
2007-10-10 11:16:29 -05:00
Gerald Carter
8c9eb7631e r15053: fix portabilities issues between 32-bit winbind clients and a 64-bit winbindd server
(This used to be commit a95d11345e)
2007-10-10 11:16:00 -05:00
Günther Deschner
c684ca9b1f r14753: Fix the kerberized pam_auth: As we could have created a new credential
cache with a valid TGT in it but we werent able to get or verify the
service ticket for this local host afterwards and therefor didn't get
the PAC, we need to remove that ccache entirely.

Also remove an ugly pair of (not needed) seteuid calls around the ticket
destroy wrapper.

Guenther
(This used to be commit 25a2fb3896)
2007-10-10 11:15:45 -05:00
Günther Deschner
18909a1dc7 r14674: Further cleanup for cached logins, only dump hashes with DEBUG_PASSWORD.
Guenther
(This used to be commit 24afdda2ae)
2007-10-10 11:15:43 -05:00
Günther Deschner
1d5ab8fd05 r14597: Merge DCERPC_FAULT constants from Samba 4.
Guenther
(This used to be commit 3f195f8248)
2007-10-10 11:15:38 -05:00
Günther Deschner
485a286a65 r14585: Tighten argument list of kerberos_kinit_password again,
kerberos_kinit_password_ext provides access to more options.

Guenther
(This used to be commit afc519530f)
2007-10-10 11:15:38 -05:00
Günther Deschner
85a44aafef r14514: Fixing last commit. Thanks Volker.
Guenther
(This used to be commit 345d2ab5d3)
2007-10-10 11:15:35 -05:00
Günther Deschner
a22d8d987c r14513: Fix winbindd_chauthtok: only fallback when the chgpasswd3 call is not
supported.

Is there a better way to check for the 0x1c010002 status code?

Guenther
(This used to be commit c7268dc9ac)
2007-10-10 11:15:35 -05:00
Günther Deschner
9e7e429c98 r14507: Re-disable accidentially re-enabled paranoia check. This should make
offline logons work again with NT4 and older Samba3 DCs.

Guenther
(This used to be commit 0892077fce)
2007-10-10 11:15:35 -05:00
Günther Deschner
3cbdb090b9 r14496: Add WBFLAG_PAM_GET_PWD_POLICY bit to only callout for domain password
policies when requested.

No panic, the flags is uint32 so we are not running out of WBFLAG bits.

Guenther
(This used to be commit 2155bb0535)
2007-10-10 11:15:34 -05:00
Günther Deschner
88ae0a25ba r14493: There is no point in falling back to a samlogon when a krb5login has
failed with a clear error indication. This prevents the bad logon count
beeing increased on the DC.

Guenther
(This used to be commit 5fdddffba5)
2007-10-10 11:15:34 -05:00
Gerald Carter
0ce53f8ba5 r14403: * modifies create_local_nt_token() to create a BUILTIN\Administrators
group IFF sid_to_gid(S-1-5-32-544) fails and 'winbind nested groups = yes'

* Add a SID domain to the group mapping enumeration passdb call
  to fix the checks for local and builtin groups.  The SID can be
  NULL if you want the old semantics for internal maintenance.
  I only updated the tdb group mapping code.

* remove any group mapping from the tdb that have a
  gid of -1 for better consistency with pdb_ldap.c.
  The fixes the problem with calling add_group_map() in
  the tdb code for unmapped groups which might have had
  a record present.

* Ensure that we distinguish between groups in the
  BUILTIN and local machine domains via getgrnam()
  Other wise BUILTIN\Administrators & SERVER\Administrators
  would resolve to the same gid.

* Doesn't strip the global_sam_name() from groups in the
  local machine's domain (this is required to work with
  'winbind default domain' code)

Still todo.

* Fix fallback Administrators membership for root and domain Admins
  if nested groups = no or winbindd is not running

* issues with "su - user -c 'groups'" command

* There are a few outstanding issues with BUILTIN\Users that
  Windows apparently tends to assume.  I worked around this
  presently with a manual group mapping but I do not think
  this is a good solution.  So I'll probably add some similar
  as I did for Administrators.
(This used to be commit 612979476a)
2007-10-10 11:15:28 -05:00
Günther Deschner
a8dd32649b r14392: Use KRB5_TGS_NAME.
Guenther
(This used to be commit 4cfd737cc1)
2007-10-10 11:15:28 -05:00
Jeremy Allison
478cd9dd53 r14275: Shut-up coverity false positive (bug #199) by making an assertion
explicit.
Jeremy.
(This used to be commit aeae20a8d9)
2007-10-10 11:15:22 -05:00