summaryrefslogtreecommitdiffstats
path: root/source/utils/pdbedit.c
Commit message (Collapse)AuthorAgeFilesLines
* *** empty log message ***Simo Sorce2002-08-151-87/+175
|
* passwords where not checked (you cannot check if the same buffer differs ↵Simo Sorce2002-08-041-6/+18
| | | | | | | | from itself). they where alo not clean after use! Simo.
* Add the ability to set account policies too.Andrew Bartlett2002-07-281-7/+25
| | | | Andrew Bartlett
* Make it possible to query account policy values from pdbedit (set to come soon).Andrew Bartlett2002-07-241-11/+29
| | | | | | | | | | | Update account_pol.c to use just uint32, rather then uint32 for paramaters, int32 for storage. (The int32 functions didn't have seperate return/status values, uint32 functions use a pointer-paramater). Move the #define -> string from a swtich to a table, so we can look it up both ways. Andrew Bartlett
* Fix up dir drive call.Tim Potter2002-07-211-1/+1
|
* Another smattering of static and constAndrew Bartlett2002-07-211-1/+1
|
* Show the account flags in the 'verbose' listing of pdbedit.Andrew Bartlett2002-07-141-0/+2
| | | | Andrew Bartlett
* Kill useless castAndrew Bartlett2002-06-141-2/+2
|
* Patch from ctrlsoft to make the pluggable passdb subsystem use an lp_listAndrew Bartlett2002-06-141-10/+12
| | | | | | | | | | | | | rather than a string when configuring mulitple backends. Also adjust some of the users of get_global_sam_sid() to cope with the fact that it just might not exist (uninitialised, can't access secrets.tdb). More places need conversion. Add some const and remove silly casts. Andrew Bartlett
* Latest patch from metze <metze@metzemix.de> to move most of samba acrossAndrew Bartlett2002-06-131-4/+6
| | | | | | | | | | | to using SIDs instead of RIDs. The new funciton sid_peek_check_rid() takes an 'expected domain sid' argument. The idea here is to prevent mistakes where the SID is implict, but isn't the same one that we have in the struct. Andrew Bartlett
* Some of the updates from ctrlsoft's 'Various' patch:Andrew Bartlett2002-05-241-12/+12
| | | | | | | | | | | - convert net to popt - convert status to popt - adapt examples/pdb/ to multiple passdb system - add dynamic debug class example to examples/pdb/ and some reformatting to better match the samba coding style. Andrew Bartlett
* so here it is the code to introduce seriously debugggging classes.Simo Sorce2002-05-181-1/+2
| | | | | | | | | | | | | | | | | | this is a first step only passdb stuff has beein "classized". - so what can you do? set debug level to: 1 poasdb:10 that will make all the code run at debug level 1 except the code in passdb/* files that will run at level 10 TODO: fix the man page - also smbcontrol has this nice feature so smbcontrol smbd debug 3 passdb:5 will set every smbd to have a default log level of 3 while passdb stuff will be at level 5 and so no.. minor cosmetic fix to pdbedit is there too
* Allow -c to specify the location of the config file, and fix up some handlingAndrew Bartlett2002-05-101-13/+15
| | | | of non-existant passdb cases.
* fix compile errorHerb Lewis2002-04-261-1/+6
|
* Another patch from jelmer:Andrew Bartlett2002-04-151-31/+37
| | | | | | | Doco for pdbedit and (ugly, but the best we could come up with) fix for compiling pdbedit on some non-gcc compilers. Andrew Bartlett
* More updates from ctrlsoft. (Jelmer Vernooij <jelmer@nl.linux.org>)Andrew Bartlett2002-04-131-8/+32
| | | | Andrew Bartlett
* This is the 'multiple pdb backends' patch from ctrlsoft, aka Jelmer VernooijAndrew Bartlett2002-04-131-318/+110
| | | | | | | | | | | | | <jelmer@nl.linux.org>. This patch also includes major rework of pdbedit to use popt, and the addition of -i paramter (allowing the user to specify which PDBs is being operated on) and -e to export a pdb - useful for backup and testing etc. Use of -i and -e gets us pdb2pdb functionality for transition between backends, much like the sam2sam in TNG. Andrew Bartlett
* second step to gain free uid<->rid mappingSimo Sorce2002-03-191-0/+2
| | | | we still need to free gid<->rid mapping and few other stuff
* more verbose checking in talloc and util_pwSimo Sorce2002-03-181-9/+10
| | | | | fixed tdbsam memory corruption (and segfault) reducing calls to pdb_uid_to_user_rid and countrary to 0 to move to a non alghoritmic rid allocation with some passdb modules.
* Initialise some SAM_ACCOUNT structs to NULL, and add some more error checking.Andrew Bartlett2002-01-311-6/+14
| | | | Andrew Bartlett
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Give pdbedit a -D paramater for setting the DEBUGLEVEL (makes debugging passdbAndrew Bartlett2002-01-271-5/+10
| | | | | | | | | much saner :-). Change to pdb_init_sam()/pdb_free_sam() loop rather than reset based due to the talloc basis. Andrew Bartlett
* Try to get the compiler not to complain about assignments and truth values...Andrew Bartlett2002-01-261-2/+1
| | | | Andrew Bartlett
* getpwnam -> getpwnam_alloc.Andrew Bartlett2002-01-231-6/+10
| | | | idra has promised not to revert these this time :-)
* This is another *BIG* change...Andrew Bartlett2002-01-201-35/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Samba now features a pluggable passdb interface, along the same lines as the one in use in the auth subsystem. In this case, only one backend may be active at a time by the 'normal' interface, and only one backend per passdb_context is permitted outside that. This pluggable interface is designed to allow any number of passdb backends to be compiled in, with the selection at runtime. The 'passdb backend' paramater has been created (and documented!) to support this. As such, configure has been modfied to allow (for example) --with-ldap and the old smbpasswd to be selected at the same time. This patch also introduces two new backends: smbpasswd_nua and tdbsam_nua. These two backends accept 'non unix accounts', where the user does *not* exist in /etc/passwd. These accounts' don't have UIDs in the unix sense, but to avoid conflicts in the algroitmic mapping of RIDs, they use the values specified in the 'non unix account range' paramter - in the same way as the winbind ranges are specifed. While I was at it, I cleaned up some of the code in pdb_tdb (code copied directly from smbpasswd and not really considered properly). Most of this was to do with % macro expansion on stored data. It isn't easy to get the macros into the tdb, and the first password change will 'expand' them. tdbsam needs to use a similar system to pdb_ldap in this regard. This patch only makes minor adjustments to pdb_nisplus and pdb_ldap, becouse I don't have the test facilities for these. I plan to incoroprate at least pdb_ldap into this scheme after consultation with Jerry. Each (converted) passdb module now no longer has any 'static' variables, and only exports 1 init function outside its .c file. The non-unix-account support in this patch has been proven! It is now possible to join a win2k machine to a Samba PDC without an account in /etc/passwd! Other changes: Minor interface adjustments: pdb_delete_sam_account() now takes a SAM_ACCOUNT, not a char*. pdb_update_sam_account() no longer takes the 'override' argument that was being ignored so often (every other passdb backend). Extra checks have been added in some places. Minor code changes: smbpasswd no longer attempts to initialise the passdb at startup, this is now done on first use. pdbedit has lost some of its 'machine account' logic, as this behaviour is now controlled by the passdb subsystem directly. The samr subsystem no longer calls 'local password change', but does the pdb interactions directly. This allow the ACB_ flags specifed to be transferred direct to the backend, without interference. Doco: I've updated the doco to reflect some of the changes, and removed some paramters no longer applicable to HEAD.
* Change the passdb interface to use allocated strings.Andrew Bartlett2002-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | These strings are allocated using talloc(), either using its own memory context stored on the SAM_ACCOUNT or one supplied by the caller. The pdb_init_sam() and pdb_free_sam() function have been modifed so that a call to pdb_free_sam() will either clean up (remove hashes from memory) and destroy the TALLOC_CTX or just clean up depending on who supplied it. The pdb_init_sam and pdb_free_sam functions now also return an NTSTATUS, and I have modified the 3 places that actually checked these returns. The only nasty thing about this patch is the small measure needed to maintin interface compatability - strings set to NULL are actually set to "". This is becouse there are too many places in Samba that do strlen() on these strings without checking if they are NULL pointers. A supp patch will follow to set all strings to "" in pdb_default_sam(). Andrew Bartlett
* merge changes from 2.2 branch to prevent smb.conf from changing debug levelHerb Lewis2002-01-071-0/+4
| | | | of commands when specified on command line.
* Actually enforce the passdb API.Andrew Bartlett2002-01-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Thou shalt not reference SAM_ACCOUNT members directly - always use pdb_get/pdb_set. This is achived by making the whole of SAM_ACCOUNT have a .private member, where the real members live. This caught a pile of examples, and these have beeen fixed. The pdb_get..() functions are 'const' (have been for some time) and this required a few small changes to constify other functions. I've also added some debugs to the pdb get and set, they can be removed if requested. I've rewritten the copy_id2x_to_sam_pass() functions to use the new passdb interface, but I need the flags info to do it properly. The pdb_free_sam() funciton now blanks out the LM and NT hashes, and as such I have removed many extra 'samr_clear_sam_passwd(smbpass)' calls as a result. Finally, any and all testing is always appriciated - but the basics seem to work. Andrew Bartlett
* reverted to 1.24 and manually merged in changes from 2.2Gerald Carter2001-12-311-194/+71
|
* fix compile errorGerald Carter2001-12-311-1/+3
|
* some merges from 2.2. Still need to merge in changes from pdb_tdb.cGerald Carter2001-12-311-74/+199
| | | | | but it will take more time as I don't want to loose any fixes that are only in HEAD.
* moving SAM_ACCOUNT to include a bit field for initializedGerald Carter2001-12-271-9/+9
| | | | | | | | | | | | | | | | | | | | members (such as uid and gid). This way we will be able to keep ourselves from writing out default smb.conf settings when the admin doesn't want to, That part is not done yet. Tested compiles with ldap/tdb/smbpasswd. Tested connection with smbpasswd backend. oh...and smbpasswd doesn'y automatically expire accounts after 21 days from the last password change either now. Just ifdef'd out that code in build_sam_account(). Will merge updates into 2.2 as they are necessary. jerry
* Minor typosVolker Lendecke2001-11-251-2/+2
|
* Removed TimeInit() call from every client program (except for one placeTim Potter2001-11-231-2/+0
| | | | | in smbd/process.c where the timezone is reinitialised. Was replaced with check for a static is_initialised boolean.
* Store some path names in global variables initialized to configureMartin Pool2001-11-191-3/+2
| | | | default, rather than in preprocessor macros.
* Fix up pdbedit so that it at least compiles without warnings.Andrew Bartlett2001-11-041-92/+61
| | | | | | - Basic functionality intact - Now adds machine accounts without a uid. (using the machine uid range to avoid conflict with real uid based accounts)
* Added NT_USER_TOKEN into server_info to fix extra groups problem.Jeremy Allison2001-11-031-4/+4
| | | | | Got "medieval on our ass" about const warnings (as many as I could :-). Jeremy.
* clear errno before a call, tdbsam will not update it.Simo Sorce2001-10-291-1/+1
| | | | just a hack to make things work.
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-1/+0
|
* Don't try to write the LM password in the NT password feild.Andrew Bartlett2001-09-301-1/+0
|
* Fix up a number of intertwined issues:Andrew Bartlett2001-09-291-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The big one is a global change to allow us to NULLify the free'ed pointer to a former passdb object. This was done to allow idra's SAFE_FREE() macro to do its magic, and to satisfy the input test in pdb_init_sam() for a NULL pointer to start with. This NULL pointer test was what was breaking the adding of accounts up until now, and this code has been reworked to avoid duplicating work - I hope this will avoid a similar mess-up in future. Finally, I fixed a few nasty bugs where the pdb_ fuctions's return codes were being ignored. Some of these functions malloc() and are permitted to fail. Also, this caught a nasty bug where pdb_set_lanman_password(sam, NULL) acheived precisely didilly-squat, just returning False. Now that we check the returns this bug was spotted. This could allow different LM and NT passwords. - the pdbedit code needs to start checking these too, but I havn't had a chance to fix it. I have also fixed up where some of the password changing code was using the pdb_set functions to store *internal* data. I assume this is from a previous lot of mass conversion work... Most likally (and going on past experience) I have missed somthing, probably in the LanMan password change code which I havn't yet been able to test, but this lot is in much better shape than it was before. If all this is too much to swallow (particularly for 2.2.2) then just adding a sam_pass = NULL to the particular line of passdb.c should do the trick for the ovbious bug. Andrew Bartlett
* Removed smbpasswd_XX call (how did this get re-added, I removed allJeremy Allison2001-09-271-1/+1
| | | | | these yesterday ?). Jeremy.
* Sync 2.2.2 and HEAD (I will keep these the same if it kills me :-).Jeremy Allison2001-09-271-127/+103
| | | | Jeremy.
* Major update to pdbedit's import and export code, in line with reqests for itAndrew Bartlett2001-09-271-81/+83
| | | | | | | | | to use the pdb_ formatting functions. Similarly, it now uses pdb_set...() rather than accessing passdb members directly. Andrew Bartlett
* Fix up pdbedit to initialise its structures with the standard functions,Andrew Bartlett2001-09-261-40/+52
| | | | | | | | | | therfore ensuring sensible defaults for some values, notably account expriries which mean 'locked out' if == 0. This NEEDS to be merged into 2.2.2 or people can get wrongly initilaised TDB records. (which will only fail on future versions of samba). Andrew Bartlett
* Started a cleanup of smbpasswd related stuff. I've created a new fileTim Potter2001-09-061-12/+16
| | | | | | | | | | | | | | | | 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.
* Fixed typo in comment.Tim Potter2001-08-281-3/+1
|
* Changed instances of TRUE, FALSE to True, False as some compilers don'tTim Potter2001-07-121-23/+23
| | | | have the first set of symbols.
* strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell2001-07-041-2/+2
| | | | can't redefine them. damn.
* The big character set handling changeover!Andrew Tridgell2001-07-041-2/+0
| | | | | | | This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation.