summaryrefslogtreecommitdiffstats
path: root/source/utils/pdbedit.c
Commit message (Collapse)AuthorAgeFilesLines
* - Point users at the HOWTO Collection instead of 'README' in modules/mysql.cJelmer Vernooij2003-03-301-2/+0
| | | | - Make passdb work with absolute paths (passdb backend = /path/to/smbpasswd.so works now). vfs, rpc and charset will follow
* Revoke some of the popt patch from metze I applied earlier today. It addedJelmer Vernooij2003-03-241-1/+1
| | | | some double options and broke some parameters.
* Patch from metze to generalise POPT_COMMON_SAMBA, with some minor changesJelmer Vernooij2003-03-241-3/+1
|
* Implement abartlet's suggestion to add attribs to ldap if theyVolker Lendecke2003-03-231-6/+0
| | | | | | | | | are 'SET' when adding the account. I really don't like passing flags down to inner routines and complicated if/else conditions, but this time he might be right. ;-) Volker
* This does two things:Volker Lendecke2003-03-231-1/+37
| | | | | | | | | | | | | | | | | | | | | | * pdbedit -i -e sets all SAM_ACCOUNT elements to CHANGED to satisfy the new pdb_ldap.c handling * pdbedit -g transfers group mappings. I made this separate from the user database, as current installations have to live with a split backend. So, if you are running 3_0 alphas with LDAP as a backend and upgrade to the next 3_0 alpha, you should call pdbedit -i tdbsam -e ldapsam -g to transfer your group mapping database to LDAP. You certainly have to have all your groups as posixGroup objects in LDAP and adapt the LDAP schema before this call. Volker
* Move -V to -C to prevent conflict with -V for versionJelmer Vernooij2003-03-231-1/+2
|
* Truncate the machinename manually, so as not to generate level 0 debugs forAndrew Bartlett2003-03-151-10/+12
| | | | | | an expected situation. Andrew Bartlett
* - Rename 'modules = ' to 'preload modules = 'Jelmer Vernooij2003-02-271-2/+1
| | | | | | - Add smb_probe_module() - Add init_modules() - Call these functions
* Revert Flag testing upon abartlet's request ;-)Volker Lendecke2003-02-071-3/+5
| | | | Volker
* Make account flags editable with pdbedit.Volker Lendecke2003-02-061-4/+22
| | | | Volker
* Fix memory leak. Thanks, Herb!Volker Lendecke2003-01-071-0/+1
| | | | Volker
* Create a machine account correctly if the unix account exists.Volker Lendecke2003-01-071-4/+14
| | | | | | With this, my test for W2kSP3 join after pdbedit -a -m works fine. Volker
* BIG patch...Andrew Bartlett2003-01-021-12/+16
| | | | | | | | | | | | | | | | This patch makes Samba compile cleanly with -Wwrite-strings. - That is, all string literals are marked as 'const'. These strings are always read only, this just marks them as such for passing to other functions. What is most supprising is that I didn't need to change more than a few lines of code (all in 'net', which got a small cleanup of net.h and extern variables). The rest is just adding a lot of 'const'. As far as I can tell, I have not added any new warnings - apart from making all of tdbutil.c's function const (so they warn for adding that const string to struct). Andrew Bartlett
* Revert by Simo's request. HEAD and 3.0 should be in sync forJeremy Allison2002-12-281-10/+2
| | | | | this except for the modules load. Jeremy.
* Patch for coredump with missing arg from "Bradley W. Langhorst" ↵Jeremy Allison2002-12-281-1/+8
| | | | | | <brad@langhorst.com> Jeremy.
* Don't crash when there are no arguments specifiedJelmer Vernooij2002-11-131-1/+4
|
* Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison2002-11-121-13/+4
| | | | | | dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy.
* I was somewhat annoyed by 'pdbedit -a vl' spitting an error messageVolker Lendecke2002-10-211-1/+7
| | | | | | at me :-) Volker
* Nice *big* patch from metze.Andrew Bartlett2002-10-121-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actual design change is relitivly small however: It all goes back to jerry's 'BOOL store', added to many of the elements in a SAM_ACCOUNT. This ensured that smb.conf defaults did not get 'fixed' into ldap. This was a great win for admins, and this patch follows in the same way. This patch extends the concept - we don't store values back into LDAP unless they have been changed. So if we read a value, but don't update it, or we read a value, find it's not there and use a default, we will not update ldap with that value. This reduced clutter in our LDAP DB, and makes it easier to change defaults later on. Metze's particular problem was that when we 'write back' an unchanged value, we would clear any muliple values in that feild. Now he can still have his mulitivalued 'uid' feild, without Samba changing it for *every* other operation. This also applies to many other attributes, and helps to eliminate a nasty race condition. (Time between get and set) This patch is big, and needs more testing, but metze has tested usrmgr, and I've fixed some pdbedit bugs, and tested domain joins, so it isn't compleatly flawed ;-). The same system will be introduced into the SAM code shortly, but this fixes bugs that people were coming across in production uses of Samba 3.0/HEAD, hence it's inclusion here. Andrew Bartlett
* Add more common options to popt_common - and start usingJelmer Vernooij2002-10-051-19/+7
| | | | the ones for debuglevel and configuration file in pdbedit
* move all the passdb internal interface to NTSTATUSSimo Sorce2002-09-261-13/+13
| | | | | | | | | only the interface has been fully moved to NTSTATUS not all the plugins make full use of it, but have been all converted. My testings passed completely, however a bit of more testing is welcome Simo.
* pdbedit needs global_myname to be set in order to display theVolker Lendecke2002-08-211-1/+12
| | | | | | user SIDs correctly. Volker
* *** 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