summaryrefslogtreecommitdiff
path: root/source3/passdb
AgeCommit message (Collapse)AuthorFilesLines
2001-11-11Minor updates. A small dose of const.Andrew Bartlett1-1/+1
(This used to be commit 80667cb0dd1a2cdef17711c8580af9f524971cea)
2001-11-11Remove built-in support for clear-text kerberos authentication.Andrew Bartlett1-123/+3
This should remove some confusion from the ./configure, but does not affect the 'real' kerberos support currently residing in smbd/sesssetup.c. This code is vunerable to a spoofed KDC, and is best replaced by --with-pam and the pam_krb5 module. This module includes measures to prevent such spoofing. Andrew Bartlett (This used to be commit 3235880b41ee5dd5ef171195489fb9254f5d89b0)
2001-11-09As pdb_ldap.c does not compile in HEAD anyway, a not-compiled mergeVolker Lendecke1-2/+6
from 2_2. Volker (This used to be commit 7d70b30dbdf06de126b78879fc89708ca335f91e)
2001-11-07Added debug in truncate, fixed warning with gcc3.Jeremy Allison1-2/+1
Jeremy. (This used to be commit 970ec14b4ba1ccf66820384ced8442e1878c09cd)
2001-11-07UGLY HACK to get machines to join tdbsam domains again.Andrew Bartlett1-2/+4
The problem is that we don't use the bitmap field, and so have to guess what feilds to change. NT4 sets the RID to NULL in its reply, (as a no-change value) and we were attempting to set that as a RID. jfm: Can you get me the info on that bitmap, so I can construct a proper fix to all this? Thanks! (This used to be commit 39f9c78d07d7af6abc71b33a6018ac0237608b6a)
2001-11-04Fixup for accounts without a local /etc/passwd entry.Andrew Bartlett1-9/+5
- Now perfectly valid. (This used to be commit be04aad90da341fb1b4ef472f2279aefab972258)
2001-11-01Various post AuthRewrite cleanups, fixups and tidyups.Andrew Bartlett3-12/+8
Zero out some of the plaintext passwords for paranoia Fix up some of the other passdb backends with the change to *uid_t rather than uid_t. Make some of the code in srv_netlog_nt.c clearer, is passing an array around, so pass its lenght in is definition, not as a seperate paramater. Use sizeof() rather than magic numbers, it makes things easier to read. Cope with a PAM authenticated user who is not in /etc/passwd - currently by saying NO_SUCH_USER, but this can change in future. Andrew Bartlett (This used to be commit 514c91b16baca639bb04638042bf9894d881172a)
2001-10-31This is a farily large patch (3300 lines) and reworks most of the AuthRewriteAndrew Bartlett2-16/+71
code. In particular this assists tpot in some of his work, becouse it provides the connection between the authenticaion and the vuid generation. Major Changes: - Fully malloc'ed structures. - Massive rework of the code so that all structures are made and destroyed using malloc and free, rather than hanging around on the stack. - SAM_ACCOUNT unix uids and gids are now pointers to the same, to allow them to be declared 'invalid' without the chance that people might get ROOT by default. - kill off some of the "DOMAIN\user" lookups. These can be readded at a more appropriate place (probably domain_client_validate.c) in the future. They don't belong in session setups. - Massive introduction of DATA_BLOB structures, particularly for passwords. - Use NTLMSSP flags to tell the backend what its getting, rather than magic lenghths. - Fix winbind back up again, but tpot is redoing this soon anyway. - Abstract much of the work in srv_netlog_nt back into auth helper functions. This is a LARGE change, and any assistance is testing it is appriciated. Domain logons are still broken (as far as I can tell) but other functionality seems intact. Needs testing with a wide variety of MS clients. Andrew Bartlett (This used to be commit f70fb819b2f57bd57232b51808345e2319d52f6c)
2001-10-31Small 'const' updates ahead of some AuthRewrite merging.Andrew Bartlett1-5/+5
(This used to be commit 3b5e72bda3263c6bdf81dfface4fae4f06b71032)
2001-10-30Fix up smbpasswd -e/-d so that it doesn't change the password under you anyAndrew Bartlett1-20/+1
more. (Previously it set them to 'XXXX' or similar when only the flags were being changed - a bug I must have introduced when I reworked the passdb end of things a few weeks back.) Adds a new local flag: LOCAL_SET_PASSWORD to specify that the password is actually to be changed. Andrew Bartlett (This used to be commit cea6b6cb228c7e1f0c2d45951590e0d8fb8b315c)
2001-10-29This commit is number 4 of 4.Andrew Bartlett8-185/+128
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 (This used to be commit c95f5aeb9327347674589ae313b75bee3bf8e317)
2001-10-29This commit is number 3 of 4.Andrew Bartlett1-1/+1
In particular this commit focuses on: Changing the Get_Pwnam code so that it can work in a const-enforced environment. While these changes have been mildly tested, and are pretty small, any assistance in this is appreciated. ---- These changes allow for 'const' in 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 used to be commit e7634f81c5116ff4addfb7e495f54b6bb78e8f77)
2001-10-29This commit is number 2 of 4.Andrew Bartlett3-65/+80
In particular this commit focuses on: The guts of the moving about inside passdb. While these changes have been mildly tested, and are pretty small, any assistance in this is appreciated. ---- These changes allow for the introduction of 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 passdb/ - Kill off disp_info stuff, it isn't used any more - Kill off support for writing to the old smbpasswd format, it isn't relevent to Samba 3.0 - Move around and modify the pdb_...() helper functions, adding one that sets the last changed time to 'now' and that sets the must change time appropriately. - Remove the ugly forced update of the LCT- value in pdb_smbpasswd. - Remove the implicit modification of the ACB flags when both NT and LM passwords are set. - Removed substation in pdb_getsampwnam output, as a single password change will render them inoperable in any case (they will be substituted and stored) - Added a default RID to the init_sam_from_pw() function, based on our rid algorithm. - Added checks that an smbpasswd stored user has a uid-based RID. - Fail to store tdb based users without a RID lib/ - Change the substituion code to use global_myname if there is no connection (and therefore no called name) at the present time. (This used to be commit 8f607810eb24ed1157bbd2e896c2c167bc34d986)
2001-10-29This commit is number 1 of 4.Andrew Bartlett1-23/+54
In particular this commit focusses on: Adding the new 'pass changed now' helper function. While these changes have been mildly tested, and are pretty small, any assistance in this is appreciated. (This used to be commit a8971a5448cf6d203b379c3ed01e331d5263c9ee)
2001-10-18Merge the become_XXX -> change_to_XXX fixes from 2.2.2 to HEAD.Jeremy Allison2-2/+2
Ensure make_conection() can only be called as root. Jeremy. (This used to be commit 8d23a7441b4687458ee021bfe8880558506eddba)
2001-10-10merge from 2.2Gerald Carter1-11/+32
(This used to be commit 96c9df577bcffeec1b7d516a5431e54e679bd6b4)
2001-10-09Fixes from John Trostel (modified somewhat by me) to ensure that all lookup_XXJeremy Allison1-0/+10
functions correctly deal with the SID_NAME_TYPE. One fix for connection user lookup in LSA. Jeremy. (This used to be commit 29730027d8118ec7d207c89d0fd7fb24ac173fde)
2001-10-03Added a comment about not changing the magic timestamp values withoutTim Potter2-0/+7
knowing what you are doing! (This used to be commit 5805cfef78a72ae6166206a2996423f89baf7580)
2001-10-03Ensure accessing NT member servers works with a Samba PDC. Don'tJeremy Allison3-7/+7
change these timestamp settings without good reason. Remove CLEAR_IF_FIRST flag is tdb is read-only. Jeremy. (This used to be commit a71d9d98b013a6c30fd85524b7cdc929bdbd9bcb)
2001-10-03set ACB_PWNOEXP by default on new accounts.Andrew Tridgell1-2/+2
(This used to be commit ead3d41f1a8293bcd2062af918b58022f4d9b10e)
2001-10-02Fixed up the change password bug when not using PAM.Jeremy Allison1-2/+2
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. (This used to be commit 9333bbeb7627c8b21a3eaeae1683c34e17d14bf0)
2001-10-02Fixed the bug with member servers in a Samba PDC hosted domain not allowingJeremy Allison3-25/+22
other access. Problem was max time was being set to 0xffffffff, instead of 0x7fffffff. Jeremy. (This used to be commit 94403d841710391ec26539e4b4157439d5778ff7)
2001-10-02Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter8-19/+0
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-10-01- fix handling of 0 last_change_time and must_change_timeAndrew Tridgell3-12/+10
- move the arbitrary 21 day timeout to local.h (This used to be commit 11075f543470c3283accce0246d0b2983420695a)
2001-09-29This is the passdb section of the previously mentioned commit.Andrew Bartlett2-65/+111
Of particular note is the change to pdb_free_sam() to take its sam argument by reference, allowing it to be NULLified by the SAFE_FREE() macro, and the changed to local_password_change() both to make it work and to remove the duplicate code that caused so much breakage over the last few days. - Small change in behaviour: when LOCAL_ADD_USER is set, the user doesn't actually exist locally but does exist in the passdb we don't attempt to do a GetPwnam(). (How the entry got there is another matter, and most passdbs won't allow this anyway). Andrew Bartlett (This used to be commit 6b45e342fd1ed82d7f5bd613048fe862a6a6f2a1)
2001-09-28How the heck I missed this I don't know, but somehow I got a copy-and-pasteAndrew Bartlett1-16/+12
error in here... Now you can change local passwords again. There is stil somthing broken about remote (via windows/sampasswd) password changing. I shall have to revise my testing, I honestly don't know how this slipped through the net. MERGE for 2.2.2. Sorry, Andrew Bartlett (This used to be commit 1f83184f881d0cabb698947660a12f729e625fae)
2001-09-27Merge HEAD and 2.2 - try frantically to keep in sync.Jeremy Allison1-13/+13
Jeremy. (This used to be commit 65bf4a36ef5967b0844ab985d7b3ea31138dd4c5)
2001-09-27Fix memory leak in get_sampwd_entries(), reindent for clarity.Andrew Bartlett1-35/+107
- call pdb_reset_sam() after each getent call. Fix bug in get_group_alias_entries(), were if num_entries was zero this caused talloc() to return NULL, failing a test below with NT_STATUS_NO_MEMORY. Fix pdb_reset_sam() to correctly initalise the sam structure. Move default value code into a single place, likewise for sam freeing code. - should make things easier if we decide to malloc other strings, or get more non-zero default values. Finally, add a function in init a sam struct from a getpwnam() return. Andrew Bartlett (This used to be commit a41fb44f5e90cf8734d57217e836e14f4a80bd47)
2001-09-27minor fixesSimo Sorce1-22/+10
(This used to be commit 57e639bbdd115b51362caf7e3db4ba34ccdeddc2)
2001-09-26merge from 2.2Gerald Carter2-3/+3
(This used to be commit 247b9c3eba78f0ddd26d836e5e18f6630bf302c7)
2001-09-26Fix the uninitialised variable, but more importantly fix the SEGFAULT.Andrew Bartlett1-2/+4
Merge for 2.2.2 Should TDB cope with TDB pointers itself? Andrew Bartlett (This used to be commit 27f0510a0b458792293d5ce2957f61383569f62f)
2001-09-26Fix up TDB_SAM with repect to case sensitvity. (need to use unix_strlower)Andrew Bartlett1-7/+9
Also attempt to make some of the syntax clearer, its confusing enought for the compiler... (it thinks that there is use of an unitilaised variable) In fact there is, see next patch... (This used to be commit 540abc8125f1b821bd362dc0d8c19a107382479f)
2001-09-26Add a new interface pdb_set_plaintext_passwd() to the passdb. This simplyAndrew Bartlett1-11/+26
interfaces to the existing set NT and LM functions, but ensures we always do it in the same way. This also allows for the possibility for the unix password sync code to be hidden behind the passdb interface as some stage. (This used to be commit 33e3591b2db377e720ec484872e2cbe7343350b1)
2001-09-26We don't use a modified 'user' in any case, so don't modifiy it.Andrew Bartlett1-1/+1
(This used to be commit e0e05cb5a51e0e46162febd0a45ea4f59b6f6573)
2001-09-25Fixup passdb stuff to add new nisplus and ldap backends.Jeremy Allison5-296/+2824
Jeremy. (This used to be commit 611bf806d569b70edabbc04a2f5408142370a550)
2001-09-25Don't segfault when deleting accounts not in /etc/passwd. The RID we want isAndrew Bartlett1-5/+2
the one in the sampass anyway. Andrew Bartlett (This used to be commit 29b7434293d7778376486b241f9458a71fa843a6)
2001-09-25memory leak fixes ..Simo Sorce1-7/+21
(This used to be commit 7f07004571ad1b8d1ce787f6788b4c4d8685db37)
2001-09-20Move pass_check.c over to NTSTATUS, allowing full NTSTATUS from PAM to wire!Andrew Bartlett1-80/+118
Add the ability for swat to run in non-root-mode (ie non-root from inetd). - we still need some of the am_root() calls fixed however. (This used to be commit 2c2317c56ee13abdbdbc866363c3b52dab826e3c)
2001-09-19Use lp_private_dir() not magic on the lp_smb_passwd_file() output.Andrew Bartlett1-7/+2
(This used to be commit 65ae05ce638f0d12e6f1e2a6f337c53c5c0a4f3a)
2001-09-19Remove the ugly hacks to get around the Get_Pwnam() calls in pass_check.c byAndrew Bartlett1-5/+6
simply not doing Get_Pwnam() calls in pass_check.c We now make *one* sys_getpnam() call in cgi.c and we always call PAM no matter what it returns. We also no longer run the password cracker for these logins. The truly parinod will note the slight difference in call paths, in that we only call crypt for valid password structs (if not --with-pam). The truly parinoid don't run SWAT either, so I don't think this is an issue. Andrew Bartlett (This used to be commit 9020d884935243f28c19cedc88f076f0709e12cb)
2001-09-17move to SAFE_FREE()Simo Sorce5-34/+22
(This used to be commit 64d35e94fe6f7e56353b286162f670c8595a90e6)
2001-09-14merges from 2.2Gerald Carter1-2/+2
(This used to be commit b619458dde158c37a4420a28a7e1e1f70e7a18d1)
2001-09-12String length fix from Toomas Soome <tsoome@ut.ee>Tim Potter1-1/+1
(This used to be commit 42417a425b524bc74360fdf6f1a16bfad38b9818)
2001-09-10passdb/smbpassfile ain't needed any more - it only provided migration from ↵Andrew Tridgell1-297/+0
an ancient file format, not relevant for Samba 3.0 (This used to be commit 954adb630d7c41a45de3a0d656d03499e20727b6)
2001-09-06got rid of USE_TDB_MMAP_FLAG as its not needed any moreAndrew Tridgell2-8/+8
(This used to be commit c26e0d3f27a05ecc8bd2390f9aab7f9451524e47)
2001-09-06Started a cleanup of smbpasswd related stuff. I've created a new fileTim Potter5-143/+14
lib/smbpasswd.c which will contain routines related to manipulating smbpasswd entries. - renamed and moved pdb_{get,set}hexpwd() functions - renamed and moved pdb_{decode,encode}acct_ctrl() functions - started hiding references to the cruftalicious NEW_PW_FORMAT_SPACE_PADDED_LEN constant - started gradual rename of references to acct_ctrl to acb_info which is the nomenclature used in MSDN and header files There's still more work to be done. Currently there are several places where smbpasswd entries are iterated etc. Ideally this should all happen through the passdb system. (This used to be commit 4a01e240305fb6fead973beef4937a016b15d744)
2001-09-05fixed some compilation errors in cli_netlogon.c - tim, you need to rerun ↵Andrew Tridgell1-3/+2
configure to get the new NTSTATUS stuff right (This used to be commit 9bae57cfe30825174536d11983bb3434498e3f03)
2001-09-05more warning fixes on solarisAndrew Tridgell1-1/+3
(This used to be commit c04c67fec85b1c81ef0b3cebacde304a1de0d854)
2001-09-04cope with pam being offAndrew Tridgell1-1/+1
(This used to be commit 5f6e7bbce76c85571ee10a3f8b5bbbd0beadb632)
2001-09-04the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but ↵Andrew Tridgell2-18/+19
the client code still needs some work (This used to be commit dcd6e735f709a9231860ceb9682db40ff26c9a66)