1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

123 Commits

Author SHA1 Message Date
Günther Deschner
3020cd44ad Use pwb_context in pam_winbind.
Guenther
(This used to be commit bf960f57e7)
2008-04-03 16:27:18 +02:00
Günther Deschner
a654ed6089 Add _pam_winbind_init/free_context.
Guenther
(This used to be commit d62676cf88)
2008-04-03 16:27:18 +02:00
Günther Deschner
b592abf1ac Make more functions in pam_winbind static.
Guenther
(This used to be commit ea2175ee0e)
2008-04-03 16:27:18 +02:00
Gerald W. Carter
0a4f742f0a Only add WBFLAG_PAM_CONTACT_TRUSTDOM when performing a krb5 auth request.
NTLM logons must go against our DC.
(This used to be commit 2e24f7c024)
2008-03-27 11:57:26 -05:00
Stefan Metzmacher
76de025c72 winbind: use a struct element for WBFLAG_PAM_UNIX_NAME
To not conflict with WBFLAG_PAM_INFO3_TEXT.

This should fix pam_winbind.

metze
(This used to be commit 1b8ed6c0ff)
2008-02-28 23:00:42 +01:00
Günther Deschner
a92eb76688 Finally enable pidl generated SAMR & NETLOGON headers and clients.
Guenther
(This used to be commit f7100156a7)
2008-01-17 16:54:46 +01:00
Michael Adam
e3bb148b94 Only retrieve password policies in pam_auth when WBFLAG_PAM_GET_PWD_POLICY is set.
This essentially re-establishes r14496 (2155bb0535)
which was undone in r17723 (43bd8c00ab) for
reasons that are unclear to me. Maybe I am being too naive.

Now we do again only retrieve the password policy when called from
the pam_winbind module. This fixes logons delegated to AD trusted
domain controllers: We need to connect to the sam to retrieve the
password policy. But auhtenticated session setup is not possible
when contacting the trusted domain dc and afterwards, SamrConnect
also fails with whatever credentials and method used.

Michael
(This used to be commit 6d765e0de5)
2007-12-20 02:05:55 +01:00
Michael Adam
6765a8acfd r25426: Fix another implicit cast warning.
Michael
(This used to be commit 4a053d5bf9)
2007-10-10 12:31:04 -05:00
Günther Deschner
6005c4e657 r25148: Adapt to coding conventions.
Guenther
(This used to be commit c3b423c52a)
2007-10-10 12:30:45 -05:00
Stefan Metzmacher
28d076d20f r25143: rename public functions from winbind_client.h
init_request	=> winbindd_init_request
free_response	=> winbindd_free_response
read_reply	=> winbindd_read_reply

write_sock	=> winbind_write_sock
read_sock	=> winbind_read_sock
close_sock	=> winbind_close_sock(void)

metze
(This used to be commit 8a95d7a7ed)
2007-10-10 12:30:45 -05:00
Stefan Metzmacher
52936b1c86 r25130: make use only of base types which are provided by libreplace
in winbind client and nss/pam stuff

metze
(This used to be commit 2e13e05fa9)
2007-10-10 12:30:43 -05:00
Günther Deschner
8499943338 r24786: Fix another build warning.
Guenther
(This used to be commit 29a56dcc78)
2007-10-10 12:30:21 -05:00
Gerald Carter
40102ad546 r24722: Squashed commit of the following:
commit fb52f971986dd298abbcd9745ddf702820ce0184
Author: Gerald Carter <coffeedude@plainjoe.org>
Date:   Mon Aug 27 13:50:26 2007 -0500

    Check correct return type for pam_winbind_request_log() wnibind_upn_to_username

    which is an int and not NSS_STATUS.

commit 7382edf6fc0fe555df89d5b2a94d12b35049b279
Author: Gerald Carter <coffeedude@plainjoe.org>
Date:   Mon Aug 27 13:30:26 2007 -0500

    Allow wbinfo -n to convert a UPN to a SID

commit 8266c0fe1ccf2141e5a983f3213356419e626dda
Author: Gerald Carter <coffeedude@plainjoe.org>
Date:   Fri Aug 3 09:53:16 2007 -0500

    Merge some of Guenther UPN work for pam_winbind.c (check the winbind separator

    and better pam logging when converting a upn to a username).

commit 15156c17bc81dbcadf32757015c4e5158823bf3f
Author: Gerald Carter <coffeedude@plainjoe.org>
Date:   Fri Aug 3 08:52:50 2007 -0500

    Include Universal groups from the cached PAC/SamLogon info when

    generating the list of domain group SIDs for a user's token.

commit 979053c0307b051954261d539445102c55f309c7
Author: Gerald Carter <coffeedude@plainjoe.org>
Date:   Thu Aug 2 17:35:41 2007 -0500

    merge upnlogon patch from my tree
(This used to be commit 98fb5bcd57)
2007-10-10 12:30:15 -05:00
Lars Müller
b824a665bb r23708: - Add define for WINBIND_WARN_PWD_EXPIRE.
- Add parameter config_flag to get_config_item_int() and do the same
  check as in get_conf_item_string.
(This used to be commit d1d1baa264)
2007-10-10 12:23:47 -05:00
Lars Müller
2f6b9c1ec4 r23707: - Move the asprintf() call to create the key even in
get_conf_item_string() to the later if statement.
- Also move the key definition to the later if statement in
  get_conf_item_string() and get_conf_item_int().
(This used to be commit 3a82ec943a)
2007-10-10 12:23:47 -05:00
Lars Müller
a3de7e9b9d r23704: Add pam_pwd_expire feature as discussed on samba-technical.
This is a slightly modified version to set warn_pwd_expire to the
default value if 0, no, or a broken value is set.

This version also has one if statement less in get_config_item_int().

Thanks a lot to Andreas 'GlaDiaC' Schneider for this feature!
(This used to be commit d26914c978)
2007-10-10 12:23:46 -05:00
Günther Deschner
67a45aa26b r22794: Add "debug_state" and "silent" to pam_winbind.conf template. Honor the silent
argument when parsing pam configuration file options.

Guenther
(This used to be commit 5b4a4df26f)
2007-10-10 12:21:57 -05:00
Gerald Carter
fd5ff711b6 r22712: Inform the user when logging in via pam_winbind
and the krb5 tkt cache could not be created due to clock skew.
(This used to be commit 24616f7d6b)
2007-10-10 12:21:49 -05:00
Günther Deschner
04a70aaf1c r22402: Fix build warning.
Guenther
(This used to be commit bf9131fed3)
2007-10-10 12:19:32 -05:00
Simo Sorce
2d8fbef151 r22393: fix cut&paste error
(This used to be commit 70878d6985)
2007-10-10 12:19:31 -05:00
Simo Sorce
20086f66cc r22388: clearer message, thanks David
(This used to be commit 7961476784)
2007-10-10 12:19:29 -05:00
Simo Sorce
d7c8710a1d r22348: 3_0 as well
(This used to be commit ad57434faf)
2007-10-10 12:19:28 -05:00
Gerald Carter
e68ea1283d r21933: Change the write_sock() call in pam_winbind_request()
to not request a privileged pipe operation for everything
as this cannot be done from a process running under the
context of a user (e.g. screensaver).

Thanks to Danilo Almeida <dalmeida@centeris.com> for the help
in pointing out the change to write_sock().
(This used to be commit 80790f935a)
2007-10-10 12:18:50 -05:00
Volker Lendecke
3fdef9433a r21878: Fix a bug with smbd serving a windows terminal server: If winbind decides smbd
to be idle it might happen that smbd needs to do a winbind operation (for
example sid2name) as non-root. This then fails to get the privileged
pipe. When later on on the same connection another authentication request
comes in, we try to do the CRAP auth via the non-privileged pipe.

This adds a winbindd_priv_request_response() request that kills the existing
winbind pipe connection if it's not privileged.

Volker
(This used to be commit e5741e27c4)
2007-10-10 12:18:42 -05:00
Gerald Carter
5f24668961 r21632: Remove ununsed variable
(This used to be commit 82dc19f844)
2007-10-10 12:18:18 -05:00
Gerald Carter
2c51e492f9 r21612: Make pam_winbind do the same username fixup on AIX as the WINBINDD
LAM module does to work around a system that does not support
>8 character usernames.  Without the change, pam_winbind tries
to authenticate _#uid in the domain.
(This used to be commit 7f0ba72e05)
2007-10-10 12:18:17 -05:00
Günther Deschner
9684e353a1 r21500: Fix inappropriate creation of a krb5 ticket refreshing event when a user
changed a password via pam_chauthtok. Only do this if

a) a user logs on using an expired password (or a password that needs to
be changed immediately) or

b) the user itself changes his password.

Also make sure to delete the in-memory krb5 credential cache (when a
user did not request a FILE based cred cache).

Finally honor the krb5 settings in the first pam authentication in the
chauthtok block (PAM_PRELIM_CHECK). This circumvents confusion when
NTLM samlogon authentication is still possible with the old password after
the password has been already changed (on w2k3 sp1 dcs).

Guenther
(This used to be commit c3005c48cd)
2007-10-10 12:18:08 -05:00
Günther Deschner
3a46604800 r21318: Fix Bug #4225.
Cached logon with pam_winbind should work now also for NT4 and samba3
domains.

Guenther
(This used to be commit b2f9115482)
2007-10-10 12:17:56 -05:00
Günther Deschner
6dd654c381 r21310: Fix invalid printfs in pam_winbind.
Guenther
(This used to be commit 5a7b2fccb3)
2007-10-10 12:17:55 -05:00
Günther Deschner
826aa64c45 r21309: Add PRINTF_ATTRIBUTE checks for log statements.
Guenther
(This used to be commit 968dfcc821)
2007-10-10 12:17:55 -05:00
Günther Deschner
317d005142 r21161: Another fix for pam_winbind: Move the entire pwd expiry handling into
the PAM_SUCCESS block.

Guenther
(This used to be commit f4a704745c)
2007-10-10 12:17:44 -05:00
Günther Deschner
7440e4255c r21160: Some more pam_winbind fixes:
* Consolidate all pam_winbind password expiry warnings in the one
_pam_send_password_expiry_message() call.
* Also convert some more NTSTATUS codes to error messages.
* Add paranoia check to only do all the post-processing after PAM_SUCCESS.

Guenther
(This used to be commit 02713f314b)
2007-10-10 12:17:44 -05:00
Günther Deschner
902a6e1da1 r21159: Cleanup pam_sm_chauthtok() in pam_winbind:
Set info3 strings, krb5ccname and returned username after we changed a
password and sucessfully re-authenticated afterwards. In that case we
ended up without this information.

Guenther
(This used to be commit 034d42ba72)
2007-10-10 12:17:44 -05:00
Günther Deschner
dbb9450312 r21158: Add _pam_setup_krb5_env() and _pam_warn_logon_type() functions for
pam_winbind.

Guenther
(This used to be commit 1feb961577)
2007-10-10 12:17:44 -05:00
Günther Deschner
462893a7be r21155: Forgot one _PAM_LOG_STATE_DATA_STRING call (only in 3_0).
Guenther
(This used to be commit 86b34cd5d6)
2007-10-10 12:17:44 -05:00
Günther Deschner
0cf5662363 r21154: Add PAM_WINBIND_LOGONSERVER, also merge the various pam_set_data calls.
Guenther
(This used to be commit 97a0b1b794)
2007-10-10 12:17:43 -05:00
Günther Deschner
44512030b1 r21152: Correctly omit pam conversations when PAM_SILENT has been set by the
calling application.

Guenther
(This used to be commit ebfae9a671)
2007-10-10 12:17:43 -05:00
Günther Deschner
c622130a7d r21145: Convert some int to BOOL in pam_winbind (only in 3_0).
Guenther
(This used to be commit 1b82c5fa0e)
2007-10-10 12:17:42 -05:00
Günther Deschner
0b2bbb2704 r21144: Create more accurate warning message when the pam_winbind chauthtok has
received NT_STATUS_PASSWORD_RESTRICTION.

Guenther
(This used to be commit 2ac9cb3bbd)
2007-10-10 12:17:42 -05:00
Günther Deschner
4aa7205c3d r21143: Fix wrong check for pam error codes for getpwnam and lookup winbind
requests in pam_winbind (Bug #4094).

Inspired by fix from Lars Heete.

Guenther
(This used to be commit 88e2185d29)
2007-10-10 12:17:42 -05:00
Günther Deschner
48191ddec6 r21122: Simplify code in pam_winbind a bit.
Guenther
(This used to be commit 08ca5ea6f1)
2007-10-10 12:17:40 -05:00
Günther Deschner
b979bf5686 r21020: Some pam_winbind fixes:
* make debug_state also configurable from the config file
* minor code cleanup

Guenther
(This used to be commit c562095953)
2007-10-10 12:17:28 -05:00
Günther Deschner
74f38589b3 r21019: Fix typo.
Guenther
(This used to be commit adb40884e0)
2007-10-10 12:17:28 -05:00
Günther Deschner
3f9585018d r21016: Fix pam_sm_setcred again.
Jerry, the switch statement must ignore the PAM_SILENT flag.

Guenther
(This used to be commit 46d23c72bf)
2007-10-10 12:17:27 -05:00
Gerald Carter
05ec639127 r21015: fix typo that breaks the build
(This used to be commit f82a517530)
2007-10-10 12:17:27 -05:00
Gerald Carter
45aa381a77 r21013: * Remove "inline" keyword
* Remove anpther check for PAM_SILENT that prevents logging to syslog
* Add missing check for TRY_FIRST_PASS when using authtok (missed
  from previous merge)
(This used to be commit ed794f0872)
2007-10-10 12:17:27 -05:00
Gerald Carter
7e8a068a5e r21012: Patch from Danilo Almeida @ Centeris (via me):
Details: Improve PAM logging
- The improved logging is far tracking down PAM-related bugs
- PAM_SILENT was being mis-used to suppress syslog output instead of
  suppressing user output.  This lets PAM_SILENT still log to syslog.
- Allow logging of item & data state via debug_state config file option.
- Logging tracks the pam handle used.
(This used to be commit cc1a13a9f0)
2007-10-10 12:17:27 -05:00
Gerald Carter
76fd8f8e1d r21011: Another patch from Danilo Almeida @ Centeris (via me):
Details: Reset the "new password prompt required" state whenever
we do a new auth.  In more detail, in pam_sm_authenticate, if not
settting PAM_WINBIND_NEW_AUTHTOK_REQD, then clean any potentially
present PAM_WINBIND_NEW_AUTHTOK_REQD.
(This used to be commit 402e859475)
2007-10-10 12:17:26 -05:00
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
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