summaryrefslogtreecommitdiffstats
path: root/source/passdb
Commit message (Collapse)AuthorAgeFilesLines
...
* creating and using some pdb_init_(sam/smb) routines. putting ldap headersLuke Leighton1998-05-183-25/+10
| | | | | back in (they had been taken out of includes.h because they are only local to ldap.c.
* no include headers in ldap.c.Luke Leighton1998-05-182-0/+72
| | | | passdb.c sam_passwd <-> smb_passwd conversion routines
* resolving compilation errorsLuke Leighton1998-05-183-3/+6
|
* received update from jean francois for ldap.c: he is doing add / modLuke Leighton1998-05-181-71/+424
| | | | functions
* - renamed some of the passdb.c functions: they have a prefix pdb_ on themLuke Leighton1998-05-183-300/+319
| | | | | - split smbpass.c "password file lock" routines into smbpassfile.c: moved trust account routines into smbpassfile.c as well
* oops. pressed ctrl-z while editing the previous cvs message: this wasLuke Leighton1998-05-181-19/+105
| | | | taken to mean ":x".
* Makefile:Luke Leighton1998-05-184-145/+488
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - added nisppass.c and NISPLUS_FLAGS includes.h: - renamed USE_LDAP to USE_LDAP_DB. renamed NISPLUS to USE_NISPLUS_DB. added default define of USE_SMBPASS_DB. - removed ldap headers: they are local only to ldap.c ldap.c : - made all ldap-specific functions static. - added dummy sam21 functions loadparm.c : - renamed NISPLUS to NISPLUS_HOME mkproto.awk - commented out ldap-specific #ifdef generation code: it's not needed now that ldap-specific functions in ldap.c are static nisppass.c : - first attempt at an add function from
* some databases have search capabilities. acknowledging this in designLuke Leighton1998-05-151-19/+60
| | | | of passdb.c api.
* first non-compiling, unused, mostly stub version of NIS+ password database.Luke Leighton1998-05-151-0/+330
| | | | based on Benny Holmgren's samba patch (copyright acknowledged).
* passdb.cJeremy Allison1998-05-141-0/+192
| | | | | | | | | | server.c: Moved generate_machine_sid() into passdb.c for Jean-Francois (who might want an LDAP version). Changed locking to free exclusive lock as soon as possible to prevent contention. lib/rpc/parse/parse_samr.c lib/rpc/server/srv_samr.c: Changed last SID-as-string manipulation function to use DOM_SID structure. Jeremy.
* namequery.c: Fixed SGI IRIX 5.x compiler problem.Jeremy Allison1998-05-141-4/+4
| | | | | | server.c: Added MACHINE.SID file generation - use lp_domain_sid() be default. smbpass.c: Exposed do_file_lock() as I now use it in server.c Jeremy.
* initialise a variableAndrew Tridgell1998-05-131-1/+1
|
* - removed ldap_get_trust()Luke Leighton1998-05-121-101/+74
| | | | - #ifdef around putting 16 byte hashes instead of plaintext password.
* removed lp_domain_workstation() parameterLuke Leighton1998-05-121-1/+1
|
* This is a security audit change of the main source.Jeremy Allison1998-05-122-27/+28
| | | | | | | | | | | | | | | | | | It removed all ocurrences of the following functions : sprintf strcpy strcat The replacements are slprintf, safe_strcpy and safe_strcat. It should not be possible to use code in Samba that uses sprintf, strcpy or strcat, only the safe_equivalents. Once Andrew has fixed the slprintf implementation then this code will be moved back to the 1.9.18 code stream. Jeremy.
* password back-end database supportLuke Leighton1998-05-113-13/+140
| | | | | | | | | | | | | | | | | | | | | ldap.c : - added getldap21pwent() function passdb.c : - getsam21pwent() no longer a stub: calls ldap21 or smb21 smbpass.c : - added getsmb21pwent() function (he he :-) lib/rpc/server/srv_samr.c : - removed "specific" calls to ldap functions; replaced with call to get_sampwd_entries instead (which is unfinished). - rewrote get_user_info_21 function to call getsam21pwrid.
* ldap back-end database developmentLuke Leighton1998-05-113-401/+596
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefile: created PASSBD_OBJ group includes.h: added #ifdef USE_LDAP to #include <ldap> headers ldap.c: - renamed "_machine" to "_trust" everywhere. - added sam_passwd support routines - removed get_ldappwd_entry function: replaced with get_sampwd_entry - removed getldappwnam/uid: replaced with getsampwnam/uid - other messing about bits which are probably going to annoy the hell out of jean-francois (sorry!) mkproto.awk: - added stuff to wrap ldap.c protos with #ifdef USE_LDAP - added uid_t and gid_t return results to the prototype generation passdb.c: - created getsam21pwent, add_sam21pwd_entry, mod_sam21pwd_entry. - modified getsampwnam/uid and created getsam21pwnam/rid functions to replace the local get_smbpwd_entry() and get_ldappwd_entry() functions, which jeremy didn't like anyway because they were dual-purpose. - added utility routines which are or may be useful to all the password database routines. password.c: - renamed "machine_" to "trust_" everywhere. smbpass.c: - removed get_smbpwd_entry function: replaced it with get_sampwd_entry functions in passdb.c - moved code that decoded acct_ctrl into passdb.c - moved encode_acct_ctrl into passdb.c - removed getsmbpwnam/uid: replaced with getsampwnam/uid - renamed "machine_" to "trust_" everywhere. smbpasswd.c: - renamed "machine_" to "trust_" everywhere. util.c: - moved gethexpwd function into passdb.c lib/rpc/server/srv_util.c: - moved user_rid_to_uid, group_rid_to_rid etc etc into passdb.c
* changed to use slprintf() instead of sprintf() just aboutAndrew Tridgell1998-05-111-9/+11
| | | | | | | everywhere. I've implemented slprintf() as a bounds checked sprintf() using mprotect() and a non-writeable page. This should prevent any sprintf based security holes.
* renamed last_change_time to pass_must_change_time. removed "if (bool==True)"Luke Leighton1998-05-082-21/+20
| | | | | | and "if (bool==False)" code from ldap.c - a boolean test may not necessarily return exactly True or exactly False: True may be defined to be -1: you never know...
* added first pass at start/get/end-ldappwent functions. unfortunately, lotsLuke Leighton1998-05-071-10/+65
| | | | | of information will be lost as these functions currently return struct smb_passwd not SAM_USER_INFO_21 or any other type of structure...
* remove unused ldap functions: add stub start/get/endldappwent routines.Luke Leighton1998-05-072-146/+97
|
* moving gethexpwd into util.c, because it's used in both smbpass.c and ldap.cLuke Leighton1998-05-072-57/+0
|
* This should (hopefully :-) be the final fix for the %U %G substitutionJeremy Allison1998-05-071-11/+0
| | | | | | | problem.... smbpass.c: Removed Luke's dire warning - as some of the functions in here *need* to be called externally :-). Jeremy.
* created "passdb.c" which is an interface point to (at present) eitherLuke Leighton1998-05-073-33/+213
| | | | | | | | | smbpasswd or ldap passwd, at compile-time (-DUSE_LDAP). _none_ of the functions in ldap.c or smbpass.c should be called directly: only those in passdb.c should be used. -DUSE_LDAP is unlikely to compile at the moment.
* smbpass.c: Fixed machine_passwd_lock() problems.Jeremy Allison1998-05-061-25/+21
| | | | | | password.c: Fixed machine_passwd_lock() problems. lib/rpc/server/srv_ldap_helpers.c: Oops - broke proto.h with dummy function. Fixed now. Jeremy.
* loadparm.c: Added #ifdef USE_LDAP around ldap code.Jeremy Allison1998-05-061-8/+9
| | | | | | | | | | | | | server.c: Moved %U, %G and %N into standard_sub() from standard_sub_basic() as only smbd knows about usernames. Also fixes problem with calling standard_sub_basic() from loadparm.c. smbpass.c: Partial tidyup of machine_password_lock() code - not finished yet. util.c: Moved %U, %G and %N into standard_sub() from standard_sub_basic() as only smbd knows about usernames. Also fixes problem with calling standard_sub_basic() from loadparm.c. lib/rpc/server/srv_ldap_helpers.c: Added #ifdef USE_LDAP around ldap code. lib/rpc/server/srv_samr.c: Added #ifdef USE_LDAP around ldap code. Jeremy.
* jean-francois micouleau's well-alpha code for ldap password database stuff!Luke Leighton1998-05-062-0/+572
| | | | he's going to hate me for checking this in so early, but...
* genrand.c: SGI compile warning fix.Jeremy Allison1998-05-051-2/+2
| | | | | | | | | | | | | | ipc.c: Fix for duplicate printer names being long. loadparm.c: Set bNetWkstaUserLogon to false by default - new code in password.c protects us. nmbd_logonnames.c: nmbd_namequery.c: nmbd_namerelease.c: Debug messages fix. password.c: SGI compile warning fix, fix for tcon() with bNetWkstaUserLogon call. reply.c: SGI compile warning fix. server.c Debug messages fix. smbpass.c: Fix for incorrect pointer. Jeremy.
* Added patch from Bruce Tenison <btenison@dibbs.net> to allow encryptedJeremy Allison1998-04-301-4/+6
| | | | | | | | passwords to be stored over time, allowing a smbpasswd file migration. Adds new parameter "update encrypted". Will also add to 1.9.18 branch. Docs update to follow. Jeremy.
* Makefile: Added files to smbpasswd.c.Jeremy Allison1998-04-291-27/+54
| | | | | | | | | | loadparm.c: Patch from tim@quiknet.com for static string problems. server.c: Setup global_myname. smbpass.c: Fix up locking. Add machine_password_delete() call. smbpasswd.c: Added provisional code to add to a domain. lib/rpc/client/cli_login.c: Fixed incorrect cred_hash3 call when setting machine password. lib/rpc/server/srv_netlog.c: Fixed incorrect cred_hash3 call when setting machine password. Jeremy.
* password.c:Luke Leighton1998-04-291-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | added become_root / unbecome_root around the get machine account password. smbpass.c: cleaning up code. - turning if (BOOL_expr == False) into if (BOOL_expr) what if you test if (BOOL_expr == True) and someone defines True to be -1 on one system and 1 on another? or if you get inconsistent return results between developers - removed if ((FILE*) == 0) and made this if ((FILE*) == NULL) - cannot assume that NULL is zero integer. plus there are typecast issues to deal with - removed return (ret == 0) ? True : False and made this return ret == 0 rely on the compiler to return correct BOOL value: not all developers will return True or False #defines: stick with BOOL test (non-zero). - removed if (ret == False) replaced with if (!ret) - bug where instead of if (sizeof(pstring)-len-len-6 < 0) it had a boolean test if (pstring-len-len-6). - removed "." after debugging of filenames: the "." - a fullstop - looked like it was part of the filename, making things difficult to sort out. still to be resolved: the global_myname isn't set up, such that the machine account password file is named "TEST3..mac".
* This is the checkin that adds the security=domain functionality.Jeremy Allison1998-04-291-3/+0
| | | | | | | | | | | WARNING - so far this has only been tested against a Samba PDC (still waiting for IS to add me the machine accounts :-). Still missing is the code in smbpasswd that will add a machine account password and change it on the domain controller, but this is not hard, and I will check it in soon. Jeremy.
* genrand.c: Changed SMB_PASSWD_FILE to lp_smb_passwd_file().Jeremy Allison1998-04-231-33/+222
| | | | | | | | | | password.c: Started the initial code for domain_client_validate(). All bracketed with #ifdef DOMAIN_CLIENT for now. reply.c: Call to domain_client_validate(). All bracketed with #ifdef DOMAIN_CLIENT for now. smbpass.c: New code to get/set machine passwords. Tidied up nesting of lock calls. Jeremy.
* includes.h: Added John's redhat fix for QSORT_CAST.Jeremy Allison1998-04-181-26/+58
| | | | | | | | | | | | | smbpass.c: Added lock depth code so calls to pw_file_lock() can be nested. Fixed codedump problems in add_smbpwd_entry(). smbpasswd.c: Removed all the code that manipulated the password file directly. Now *all* smbpasswd file changes are done through the interfaces defined in smbpass.c This should make the life of people adding alternate backend databases *much* easier. lib/rpc/server/srv_netlog.c: Removed debug messages used to debug machine password changing. Jeremy.
* ipc.c: Fix for printer queue spinning with Win95.Jeremy Allison1998-04-151-6/+131
| | | | | | | | | nmbd.c: Fix for always overwriting log despite append setting. smb.h: Addition of last time password changed entry to account info. smbpass.c: Changes to support last time changed field in smbpasswd file. smbpasswd.c: Changes to support last time changed field in smbpasswd file. util.c: Fix for always overwriting log despite append setting. Jeremy.
* Modified interfaces to getting smb password entries fromJeremy Allison1998-04-141-8/+50
| | | | | | | | | | | | | | | | | | | | get_smbpwd_entry (now an internal function to smbpass.c) to a more UNIX-like : getsmbpwnam() - get entry by name. getsmbpwuid() - get entry by uid. Changed the type returned by the smbpasswd enumeration functions to be a void * so that people don't come to depend on it being a FILE *. These abstractions should make it much easier to replace the smbpasswd file with a better backend in future. Other files changed are to match the above changes. Jeremy.
* Changes to allow Samba to be compiled with -Wstrict-prototypesJeremy Allison1998-04-131-1/+1
| | | | | | with gcc. (Not a big change although it looks like it :-). Jeremy.
* the default for old style accounts should be workstation trustAndrew Tridgell1998-03-311-1/+1
| | | | account, not server trust account.
* smbpass.c: Made unknown accounts ending in '$' server accounts, notJeremy Allison1998-03-261-1/+1
| | | | | | | workstation. smbpasswd.c: Added code to count down from last machine account to add correct uid when adding a machine account. Jeremy.
* Added writing of '[XXX]' account control bits into gcosJeremy Allison1998-03-241-0/+7
| | | | | field when adding a user via smbpasswd. Jeremy.
* Updated smbpasswd to allow root to add machine accounts, and allowJeremy Allison1998-03-241-4/+6
| | | | | | | root to disable users and set them to "NO PASSWORD". Not quite finished with machine account stuff yet, but everything compiles. Jeremy.
* Adding the same changes to HEAD as were added to BRANCH_1_9_18.Jeremy Allison1998-03-191-6/+0
| | | | | | | | | | | | | Changed smbpasswd to be client-server for a normal user, rather than accessing the private/smbpasswd file directly (it still accesses this file directly when run as root, so root can add users/change a users password without knowing the old password). A shakeout of this change is that smbpasswd can now be used to change a users password on a remote NT machine (yep - you heard that one right - we can now change a NT password from UNIX !!!!!). Jeremy.
* "For I have laboured mightily on Luke's code, and hath brokenJeremy Allison1998-03-111-784/+774
| | | | | | | | | | | | | | | | | | | | | | | | all I saw" - the book of Jeremy, chapter 1 :-). So here is the mega-merge of the NTDOM branch server code. It doesn't include the new client side pieces, we'll look at that later. This should give the same functionality, server wise, as the NTDOM branch does, only merged into the main branch. Any fixes to domain controler functionality should be added to the main branch, not the NTDOM branch. This code compiles without warnings on gcc2.8, but will need further testing before we are sure all the working functionality of the NTDOM server branch has been correctly carried over. I hereby declare the server side of the NTDOM branch dead (and all who sail in her :-). Jeremy.
* nmbd_packets.c: nmbd_subnetdb.c: Patch from Andrey Alekseyev ↵Jeremy Allison1998-02-201-6/+2
| | | | | | | | | | | | | <fetch@muffin.arcadia.spb.ru> to fix the fact that retransmit_or_expire_response_records() wasn't looking at the WINS subnet. server.c: Patch from jkf@soton.ac.uk to add %p (NIS server path) substitution. smbpass.c: Fix to stop parsing failing on non-valid lines. trans2.c: Fix for volume serial number code. util.c: Patch from jkf@soton.ac.uk to add %p (NIS server path) substitution. Fix for warnings under RH5. gcc 2.8. Jeremy.
* This is *not* a big change (although it looks like one).Jeremy Allison1998-01-221-1/+1
| | | | | | | This is merely updating the Copyright statements from 1997 to 1998. It's a once a year thing :-). NO OTHER CHANGES WERE MADE. Jeremy.
* charcnv.c: Added codepage 866 support onto the file system. PatchJeremy Allison1998-01-171-4/+8
| | | | | | | | | | | | | from Max Khon <max@iclub.nsu.ru>. chgpasswd.c: Allow old RAP change password to work with encrypted passwords. Samba can now allow Windows 95/NT clients to securely change the Lanman password ! (But not the NT hash - that gets lost). ipc.c: smbdes.c: smbpass.c: Support for the above. server.c: #ifdef'ed out fix for NT redirector bug. util.c: Fix NIS bug with server name. Jeremy.
* fixed some typecasts of (char *) to (unsigned char *)Andrew Tridgell1997-11-221-4/+4
|
* Rolled back tree state to 11:59pm 8th November 1997 EST toJeremy Allison1997-11-101-1/+1
| | | | | remove problems. Jeremy
* attempting to mark up 32 bit error codes, needed for NT domains.Luke Leighton1997-11-091-1/+1
| | | | | | | | | | | | separated out smb server-mode password validation into a separate file. added called and calling netbios names to client gen state: referenced section in rfc1002.txt. created workstation trust account checking code in ntclient.c there might be a bug in reply_session_setup_andX. i indented and added { } around single-line if statements: the lm password checking code now doesn't look right (around the GUEST_SESSSETUP bits). *no code semantics have been changed by the indentation process*.
* mod_smbpasswd() was junking the smbpasswd file...Luke Leighton1997-11-081-97/+99
| | | | uninitialised variable warnings.