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

58 Commits

Author SHA1 Message Date
Volker Lendecke
4f65fa9c7b pam_winbind: Avoid a use of sprintf
pam_winbind depends on talloc, which depends on libreplace, so we have asprintf
available.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-31 20:30:11 +02:00
Andreas Schneider
94464ed82c pam_winbind: Create and use a wbclient context
PAM sessions are long running. If we create a pam session a connection
to winbind is established and only closed by the destructor of the
libwbclient library. If we create a wbcContext, we will free it in the
end of the PAM function being called and the socket will be closed. This
decreases the amount of allocated 'winbindd_cli_state' structures in
winbind for every logged in user.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Mar 25 17:45:24 CET 2016 on sn-devel-144
2016-03-25 17:45:24 +01:00
Andreas Schneider
4c139e23e9 pam_winbind: Use the correct type to check the pam_parse() return code
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2016-03-25 14:18:22 +01:00
Michael Adam
490a27b69b pam_winbind: check != PAM_SUCCESS and != NULL explicitly
...instead of using "if (ret)" or similar.
This is just a code cleanup, no changes in behaviour.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-01-13 10:57:09 +01:00
Andreas Schneider
7d84cd6e40 pam_winbind: Fix a segfault if initialization fails
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11502

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Sep  8 21:39:21 CEST 2015 on sn-devel-104
2015-09-08 21:39:21 +02:00
Volker Lendecke
6b898481af pam: Fix CID 1034871 Resource leak
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Mar  3 20:03:25 CET 2015 on sn-devel-104
2015-03-03 20:03:25 +01:00
Volker Lendecke
ad3e38f6bb pam: Fix CID 1034870 Resource leak
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-03-03 17:34:39 +01:00
Günther Deschner
78b7db1814 pam_winbind: fix warn_pwd_expire implementation.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9056

warn_pwd_expire parameter is not working as documented in pam_winbind manual
page. This patch adds missing bit and allows disabling warning message fully,
i.e. setting warn time to zero days.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Dec  3 21:36:49 CET 2014 on sn-devel-104
2014-12-03 21:36:49 +01:00
Stefan Metzmacher
d5326bca33 nsswitch: avoid some compiler warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-14 23:27:05 +01:00
Michael Adam
6bbfb09b07 pam_winbind: fix comment typos
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sat Oct 18 12:41:07 CEST 2014 on sn-devel-104
2014-10-18 12:41:07 +02:00
Jeremy Allison
8bbf901f93 Replace all uses of iniparser with tiniparser.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-08-14 21:27:13 +02:00
Andreas Schneider
751b2b2d2a Remove uid_wrapper related code.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:05 +02:00
Garming Sam
2c2f175b0d Revert "pam_winbind: fix segfault in pam_sm_authenticate()"
This reverts commit ec0f51b200.

A more generic fix is now in use.

Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jan 15 01:37:38 CET 2014 on sn-devel-104
2014-01-15 01:37:38 +01:00
Garming Sam
3a814e329b pam_winbind: Do not honour require_membership_of in the acct module parameters
This needs a password to work, and it confuses users for it to appear to be valid here.

Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-01-14 23:44:26 +01:00
Garming Sam
6f4ec0c041 pam_winbind: Fix segfault caused by invalid configuration options
This is a better fix for 8564 and will allow ec0f51b200 to be reverted.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=8564

Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-01-14 23:44:26 +01:00
Noel Power
f62683956a fail authentication for single group name which cannot be converted to sid
furthermore if more than one name is supplied and no sid is converted
then also fail.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=8598

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Nov 29 15:45:11 CET 2013 on sn-devel-104
2013-11-29 15:45:11 +01:00
Volker Lendecke
ffae8a13b6 pam_winbind: Use strlcat in safe_append_string
We have that available via libreplace, so use it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Thu Nov 28 14:33:32 CET 2013 on sn-devel-104
2013-11-28 14:33:32 +01:00
Noel Power
01cae099e0 handle later iniparser version assigning a zero length string value for 'key='
older iniparser versions ( like that used in upstream samba ) ignore 'key='
entries, the key is not entered into the dictionary at all. Later
versions of iniparse specifically handle the following special cases

* key=
* key=;
* key=#

by assigning a value of "" ( a zero length string ) to the key
in the dictionary.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Nov 20 16:12:13 CET 2013 on sn-devel-104
2013-11-20 16:12:13 +01:00
Andreas Schneider
9624ca4f88 BUG 9735: Fix winbind seperator in upn to username conversion.
Reviewed-by: Günther Deschner <gd@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Mar 22 16:18:06 CET 2013 on sn-devel-104
2013-03-22 16:18:06 +01:00
Andreas Schneider
1dc414e4d2 nsswitch: Fix pam_get_{item,data} build warnings.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12 15:00:02 +01:00
Andreas Schneider
de22df1419 nsswitch: Remove unused variable in _pam_winbind_change_pwd().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12 15:00:02 +01:00
David Disseldorp
ec0f51b200 pam_winbind: fix segfault in pam_sm_authenticate()
Ensure the potentially null winbind context is not dereferenced on
cleanup.

https://bugzilla.samba.org/show_bug.cgi?id=8564

Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Oct 26 22:40:57 CEST 2012 on sn-devel-104
2012-10-26 22:40:57 +02:00
Günther Deschner
98d90c02f0 pam_winbind: match more return codes when wbcGetPwnam has failed.
This is required to properly return PAM_USER_UNKNOWN in case winbind had a
problem.

Guenther

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Sep 19 15:06:10 CEST 2012 on sn-devel-104
2012-09-19 15:06:10 +02:00
Luca Lorenzetto
4e595f4bf0 nsswitch: fix crash on null pam change pw response
The function _pam_winbind_change_pwd crashes due to a null value passed
to the function strcasecmp and denies to login via graphical login
manager. Check for a null value before doing a strcasecmp.

Bug-Ubuntu: https://bugs.launchpad.net/bugs/1003296
Bug: https://bugzilla.samba.org/show_bug.cgi?id=9013

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Sep 12 00:07:28 CEST 2012 on sn-devel-104
2012-09-12 00:07:28 +02:00
Simo Sorce
adbace20a2 Fix pam_winbind build against newer iniparser library
iniparser_getstr is deprecated and has been removed in newer libraries
available in Fedora. Use iniparse_getstring instead.

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Tue Apr 24 02:56:10 CEST 2012 on sn-devel-104
2012-04-24 02:56:10 +02:00
Volker Lendecke
487c9d3b83 s3: No value change, just use the correct enum value
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Jan  6 16:33:42 CET 2012 on sn-devel-104
2012-01-06 16:33:42 +01:00
Andreas Schneider
8682c32c1a nsswitch: Disable uid_wrapper in libwbclient.
This way we don't have to link against it in the autoconf build.
2011-10-27 13:32:01 +02:00
Andrew Bartlett
ad0a07c531 s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Jeremy Allison
388bba05cf Remove a PATH_MAX. 2011-06-01 16:07:42 -07:00
Jeremy Allison
7d6ebe0de7 More const fixes. Remove CONST_DISCARD. 2011-05-06 01:44:07 +02:00
Jeremy Allison
e131c94ac1 More const fixes for compiler warnings from the waf build. 2011-05-05 23:56:07 +02:00
Volker Lendecke
e0fae3d494 pam_winbind: Use wbcSidToStringBuf 2011-03-05 14:29:32 +01:00
Volker Lendecke
181b23ceed nsswitch: wbcFreeMemory deals fine with NULL 2011-03-05 14:29:32 +01:00
Volker Lendecke
bd54969d9b pam_winbind: Fix shadowing a global on FreeBSD
FreeBSD defines a function pam_error()
2010-07-17 21:48:35 +02:00
Andreas Schneider
f324036e76 s3-winbind: Make sure we crash if domain is really not found.
Found by clang-analyzer.
2010-06-29 11:12:12 +02:00
Bo Yang
ef0b4e4687 s3: Add i18n/l10n strings in pam_winbind.c coming from winbindd.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-03-06 01:53:13 +08:00
Matthieu Patou
db6781833d nsswitch: libpam remove depedance on locale.h use directly LOCALEDIR
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-03-03 09:22:38 +01:00
Volker Lendecke
65710dae84 pam_winbind: Remove a nested if-statement. Bo, please check! 2010-02-06 12:57:32 +01:00
Volker Lendecke
8cb6f7ec1b pam_winbind: Use strchr instead of strstr for a single character 2010-02-06 12:57:32 +01:00
Bo Yang
913a9f4e42 s3: Fix malformed require_membership_of_sid.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-02-07 14:55:25 +08:00
Bo Yang
c7e3a2dc31 s3: check for PAM_RADIO_TYPE.
Signed-off-by: Bo Yang <boyang@samba.org>
2009-12-10 19:29:24 +08:00
Bo Yang
b386c3311d s3: Fix build on non-linux platform.
Signed-off-by: Bo Yang <boyang@samba.org>
2009-12-10 17:22:25 +08:00
Bo Yang
f7723293a0 s3: Give the user a chance to change password when password will expire soon.
Signed-off-by: Bo Yang <boyang@samba.org>
2009-12-10 14:38:28 +08:00
Björn Jacke
5377d5f894 pam_winbind: fix a printf type mismatch warning 2009-11-14 01:54:53 +01:00
Bo Yang
b9a3f1dd85 s3: Fix crash in pam_winbind, another reference to freed memory.
Signed-off-by: Bo Yang <boyang@samba.org>
2009-10-24 09:36:23 +08:00
Bo Yang
31f1a36901 s3: Don't fail authentication when one or some group of require-membership-of is invalid.
Signed-off-by: Bo Yang <boyang@samba.org>
2009-10-20 02:05:58 +08:00
Jeremy Allison
1c1a883bd0 Fix the build, missing ->.
Jeremy.
2009-10-14 12:36:02 -07:00
Bo Yang
8e91c40574 s3: Fix reference to freed memory in pam_winbind.
Signed-off-by: Bo Yang <boyang@samba.org>
2009-10-15 04:31:26 +08:00
Matthias Dieter Wallnöfer
1e2f455b4a winbind: adapt the new reject constants also there
Please note: in the past the value "0" was misinterpreted as other error. This
isn't true. "0" means no error.
Therefore a solution for this one has to found.
2009-10-08 11:01:22 +02:00
Bo Yang
89ed2af69d s3: Don't overwrite password in pam_winbind, subsequent pam modules
might use the old password and new password.

Signed-off-by: Bo Yang <boyang@samba.org>
2009-09-16 22:03:57 +08:00