1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-31 01:48:16 +03:00

39 Commits

Author SHA1 Message Date
Jeremy Allison
17cae0d683 Address the string_sub problem by changing len = 0 to mean "no expand".
Went through and checked all string_subs I could to ensure they're being
used correctly.
Jeremy.
-
Andrew Bartlett
302dad4990 Cleanups!
Make some code static, add some const to the PAM code, and make the plaintext
password code actually function - particulary without the requirement to
modify the 'struct passwd' (which it assumed was made up of fstrings)

This kills some particularly ugly code in lib/util_pw.c

Andrew Bartlett
-
Simo Sorce
d222bc8c4b typo, sorry -
Simo Sorce
ae5d24873a debug classized -
Andrew Bartlett
6c08c233e6 Fix use of uninitialsed variable in PAM code -
Andrew Bartlett
dc1a72f896 Drastic impromvents to pam_winbind.
This adds code to do generic PAM -> NTSTATUS and NTSTATUS -> PAM error
conversions, and uses them to make the error handling in pam_winbind sane.

In particular, pam_winbind now uses PAM error codes, not silly '-1, -2 ...'
stuff, and logs the NTSTATUS error that winbind now sends over the pipe.

Added code to wbinfo to display these - makes a big difference in debugging
winbindd.

The main change here is the code to allow pam_winbind password changing to
correctly stack - This code ripped from pam_unix, and the copyright attached.
(Same as for all pam modules, including pam_winbind)

Andrew Bartlett
-
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Andrew Bartlett
3b5e72bda3 Small 'const' updates ahead of some AuthRewrite merging. -
Andrew Bartlett
c95f5aeb93 This commit is number 4 of 4.
In particular this commit focuses on:

Actually adding the 'const' to the passdb interface, and the flow-on changes.

Also kill off the 'disp_info' stuff, as its no longer used.

While these changes have been mildly tested, and are pretty small, any
assistance in this is appreciated.

----

These changes introduces a large dose of 'const' to the Samba tree.
There are a number of good reasons to do this:

	- I want to allow the SAM_ACCOUNT structure to move from wasteful
	pstrings and fstrings to  allocated strings.  We can't do that if
	people are modifying these outputs, as they may well make
	assumptions about getting pstrings and fstrings

	- I want --with-pam_smbpass to compile with a slightly sane
	volume of warnings, currently its  pretty bad, even in 2.2
	where is compiles at all.

	- Tridge assures me that he no longer opposes 'const religion'
	based on the ability to  #define const the problem away.

	- Changed Get_Pwnam(x,y) into two variants (so that the const
	parameter can work correctly): - Get_Pwnam(const x) and
	Get_Pwnam_Modify(x).

	- Reworked smbd/chgpasswd.c to work with these mods, passing
	around a 'struct passwd' rather  than the modified username

---

This finishes this line of commits off, your tree should now compile again :-)

Andrew Bartlett
-
Jeremy Allison
9333bbeb76 Fixed up the change password bug when not using PAM.
The problem is we were trying to use mask_match as a generic
wildcard matcher for UNIX strings (like the password prompts).
We can't do that - we need a unix_wild_match (re-added into lib/util.c)
as the ms_fnmatch semantics for empty strings are completely wrong.
This caused partial reads to be accepted as correct passwd change
responses when they were not....
Also added paranioa test to stop passwd change being done as root
with no %u in the passwd program string.
Jeremy.
-
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. -
Simo Sorce
64d35e94fe move to SAFE_FREE() -
Andrew Tridgell
5f6e7bbce7 cope with pam being off -
Andrew Tridgell
dcd6e735f7 the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work -
Andrew Tridgell
1d36250e33 converted another bunch of stuff to NTSTATUS -
Jeremy Allison
eea1c30df2 Fix case insensitive password change code.
Fixed crash bug with un-zeroed talloced memory.
Jeremy.
-
Jeremy Allison
79574c07ed Password changing via PAM works now. DONT CHANGE THIS UNLESS YOU RE-TEST !!!!!!
Jeremy.
-
Jeremy Allison
e94957d548 Added Andrew's pam password change stuff. Needs some testing but looks good !
Jeremy.
-
Jeremy Allison
70bdf8e761 Fixed up the oldpw prompts. Made the matching case insensitive.
Jeremy.
-
Jeremy Allison
47b4d82536 Had to add a "pam password change" parameter (defaults to "off") and inlined
the pam password change code to ensure that existing and working password
chat scripts don't break with 2.2.1. PAM password changing has to be explicitly
requested.
Allowed wildcards in pam password change matching (matches password chat
script matching). Had to add const (sorry Tim :-) to ms_fnmatch() to
stop warnings. Don't worry - the const changes are isolated and don't
cause any other warnings :-).
Jeremy.
-
Jeremy Allison
52a9226a5a Runtime check for broken PAM systems with no appdata_ptr support. This
should eventually be an autoconf test with a #ifdef workaround. I *HATE* pam :-).
Jeremy.
-
Jeremy Allison
d9b960b4a5 Stop coredump on pam password change with pam_pwdb.so module on error.
Jeremy.
-
Jeremy Allison
acc3e7a057 Added Andrew Bartlett's fixes to my changes to his original patch (at the
court of king caractacus, was just passing by... :-).
Jeremy.
-
Jeremy Allison
6b2dd14205 Allow pam code to compile on Solaris (which doesn't have PAM_AUTHTOK_RECOVER_ERR).
Jeremy.
-
Jeremy Allison
c4d3df4f14 Fixing consts in pam code.
Jeremy.
-
Jeremy Allison
1648ac64a7 Based on an original PAM patch by Andrew Bartlett, re-written by me to
remove global static PAM variables, and to tidy up the PAM internals code.
Now looks like the rest of Samba.
Still needs testing.
Jeremy.
-
Jeremy Allison
59aa99f390 Added "obey pam restrictions" parameter - default to "off".
Only set this to "on" if you know you have your PAM set up correctly.....
NB. Doesn't apply to plaintext password authentication, which must use
pam when compiled in.
Jeremy.
-
Jeremy Allison
4db22afeed Fix more free twice bugs.
Jeremy.
-
Jeremy Allison
c4048fcdb6 Fix for bug in code for pam_session failure - pam_end called twice.
Jeremy.
-
Jeremy Allison
d4b1c0be2e Added smb_ prefix to all Samba wrapper pam functions.
Fixed off by one bug using StrnCpy instead of strdup().
Jeremy.
-
Jeremy Allison
071c799f47 Commit of a modified version of Andrew Bartlett's patch that removes the
horrid utmp hostname parameter - now uses the client name instead.
Also tidies up some of the unencrypted password checking when PAM
is compiled in.
FIXME ! An pam_accountcheck() is being called even when smb encrypted
passwords are negotiated. Is this the correct thing to do when winbindd
is running ! This needs *SEVERE* testing....
Jeremy.
-
John Terpstra
44f96771c3 Oops. Typos. -
John Terpstra
72812e4cf1 Added error reporting to pam_session code. -
Andrew Tridgell
f52a5014ee merge from 2.2 -
Jeremy Allison
89589895e3 patch from Steve Langasek <vorlon@netexpress.net> to make sure we
don't use pam_setcred() if we haven't called pam_authenticate()
Merge from 2.2
Jeremy.
-
John Terpstra
02e84267f7 Updated with Andrew Bartlett patch. -
Jeremy Allison
add847778b Merged John's changes.
Jeremy.
-
John Terpstra
88b6043b4e Updating pampass from Samba-2.2 code tree. ===> JHT -
Jeremy Allison
ecd00e258c Added JohnT and Andrew Bartlett's PAM changes.
Jeremy.
-