summaryrefslogtreecommitdiffstats
path: root/source/utils/smbpasswd.c
Commit message (Collapse)AuthorAgeFilesLines
* Removed version number from file header.Tim Potter2002-01-301-1/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* This is another *BIG* change...Andrew Bartlett2002-01-201-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* merge changes from 2.2 branch to prevent smb.conf from changing debug levelHerb Lewis2002-01-071-0/+3
| | | | of commands when specified on command line.
* sync getopt() args with 2.2Gerald Carter2002-01-071-1/+1
|
* Rafal (mimir) patch for trusts r.Jean-François Micouleau2001-12-141-1/+21
|
* update the ldap support code. it compiles.Jean-François Micouleau2001-12-131-1/+41
| | | | | | | | Ignacio you can update your howto ;-) samsync: a small patch to try chaning challenges. J.F.
* OK. Smbpasswd -j is DEAD.Andrew Bartlett2001-12-051-139/+40
| | | | | | | | | | | | | | | | | | | This moves the rest of the functionality into the 'net rpc join' code. Futhermore, this moves that entire area over to the libsmb codebase, rather than the crufty old rpc_client stuff. I have also fixed up the smbpasswd -a -m bug in the process. We also have a new 'net rpc changetrustpw' that can be called from a cron-job to regularly change the trust account password, for sites that run winbind but not smbd. With a little more work, we can kill rpc_client from smbd entirly! (It is mostly the domain auth stuff - which I can rework - and the spoolss stuff that sombody else will need to look over). Andrew Bartlett
* moved init_account_policy() to the right placeAndrew Tridgell2001-12-041-2/+0
|
* smbpasswd is *ugly*!Andrew Bartlett2001-12-041-0/+2
| | | | | | | | However this looks like the best spot to init the account policy db... (fix segfaults on all local smbpasswd ops) Andrew Bartlett
* Add 'net rpc join' to match the ADS equiv.Andrew Bartlett2001-12-041-294/+3
| | | | | | | | | | | | | | | | This kills off the offending code in smbpasswd -j -Uab%c In the process we have changed from unsing compelatly random passwords to random, 15 char ascii strings. While this does produce a decrese in entropy, it is still vastly greater than we need, considering the application. In the meantime this allows us to actually *type* the machine account password duruign debugging. This code also adds a 'check' step to the join, confirming that the stored password does indeed do somthing of value :-) Andrew Bartlett
* 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.
* Rename xmalloc, xmemdup, xstrdup to smb_$1 to avoid conflicts with theMartin Pool2001-11-201-8/+8
| | | | versions defined by libreadline on SCO (!).
* Make the smbpasswd options/usage message a little less bizarre: it nowMartin Pool2001-11-191-22/+20
| | | | | shows all the available options, but explains that you must be root to use them. Surely this is less confusing?
* Store some path names in global variables initialized to configureMartin Pool2001-11-191-4/+2
| | | | default, rather than in preprocessor macros.
* Parionia to ensure people don't install libsmb based programs setuid root.Andrew Bartlett2001-10-311-1/+1
| | | | | | | libsmb has not been written to be setuid, with things like LIBSMB_PROG allowing all sort of fun and games. Andrew Bartlett
* Fix up smbpasswd -e/-d so that it doesn't change the password under you anyAndrew Bartlett2001-10-301-11/+13
| | | | | | | | | | | | | 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
* Added xstrdup, removed static version from smbpasswd.cJeremy Allison2001-10-221-14/+0
| | | | Jeremy.
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-1/+0
|
* Fix up a number of intertwined issues:Andrew Bartlett2001-09-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* move to SAFE_FREE()Simo Sorce2001-09-171-6/+6
|
* Fixed problems with arg parsing as root with smbpasswd.Jeremy Allison2001-09-121-8/+11
| | | | Jeremy.
* the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but ↵Andrew Tridgell2001-09-041-5/+5
| | | | the client code still needs some work
* Set acb_info to ACB_SVRTRUST if we are joining the domain as a BDC withoutTim Potter2001-08-311-2/+6
| | | | going through the server manager.
* merge from 2.2Gerald Carter2001-08-301-0/+3
|
* Fix uninitialised variables. Spotted by "Esh, Andrew" <AEsh@tricord.com>Tim Potter2001-08-291-0/+3
|
* converted another bunch of stuff to NTSTATUSAndrew Tridgell2001-08-271-3/+3
|
* get rid of compiler warningsHerb Lewis2001-08-241-3/+3
|
* Allow smbpasswd to join a W2K hosted AD domain.Jeremy Allison2001-08-021-3/+10
| | | | Jeremy.
* Held a shoot-out between NT_STATUS_NO_PROBLEMO and NT_STATUS_NOPROBLEMO.Tim Potter2001-07-251-2/+2
| | | | | | According to the incorruptible judges find and grep, the latter won. Mmm - procrastination. (-:
* Don't try and open tdb secrets file in non-root/local mode.Jeremy Allison2001-07-061-2/+1
| | | | Jeremy.
* strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell2001-07-041-3/+3
| | | | can't redefine them. damn.
* The big character set handling changeover!Andrew Tridgell2001-07-041-4/+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.
* Experimental support for joining a domain without creating an account inTim Potter2001-06-291-23/+344
| | | | | | | | | | server manager first. Just use the -U parameter to smbpasswd when joining the domain: smbpasswd -r PDC -j DOMAIN -U administrator%password Should also work with domain users with the 'add workstation to domain' user right.
* added a -L option to smbpasswd to force it to run locally so we can test ↵Andrew Tridgell2001-06-251-3/+17
| | | | smbpasswd as non-root
* Patch from Simo:Gerald Carter2001-05-071-2/+2
| | | | | | o sed 's/pdb_clear_sam/pdb_free_sam/g' o add pdb_reset_sam() o password changing should be ok now as well.
* Big cleanup of passdb and backends.Jean-François Micouleau2001-05-041-5/+16
| | | | | | | I did some basic tests but I have probably broken something. Notably the password changing. So don't cry ;-) J.F.
* fix typoHerb Lewis2001-04-241-1/+1
|
* don't allow both add and delete user to be set at the same timeHerb Lewis2001-04-241-1/+4
|
* Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison2001-03-111-12/+7
| | | | | | RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy.
* fixed a crash bug in smbpasswdAndrew Tridgell2001-02-211-1/+0
| | | | (the user can come from optarg, so we can't free it)
* Changes from APPLIANCE_HEAD:David O'Neill2001-01-111-2/+9
| | | | | | | | source/lib/smbpasswd.c - Only call load_interfaces() when doing a network related operation. This means you can add, remove, enable or disable smbpasswd entries without a network. Changing passwords always requires a network.
* Large commit which restructures the local password storage API.Gerald Carter2000-11-131-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the only backend which works is smbpasswd (tdb, LDAP, and NIS+) are broken, but they were somewhat broken before. :) The following functions implement the storage manipulation interface /*The following definitions come from passdb/pdb_smbpasswd.c */ BOOL pdb_setsampwent (BOOL update); void pdb_endsampwent (void); SAM_ACCOUNT* pdb_getsampwent (void); SAM_ACCOUNT* pdb_getsampwnam (char *username); SAM_ACCOUNT* pdb_getsampwuid (uid_t uid); SAM_ACCOUNT* pdb_getsampwrid (uint32 rid); BOOL pdb_add_sam_account (SAM_ACCOUNT *sampass); BOOL pdb_update_sam_account (SAM_ACCOUNT *sampass, BOOL override); BOOL pdb_delete_sam_account (char* username); There is also a host of pdb_set..() and pdb_get..() functions for manipulating SAM_ACCOUNT struct members. Note that the struct passdb_ops {} has gone away. Also notice that struct smb_passwd (formally in smb.h) has been moved to passdb/pdb_smbpasswd.c and is not accessed outisde of static internal functions in this file. All local password searches should make use of the the SAM_ACCOUNT struct and the previously mentioned functions. I'll write some documentation for this later. The next step is to fix the TDB passdb backend, then work on spliting the backends out into share libraries, and finally get the LDAP backend going. What works and may not: o domain logons from Win9x works o domain logons from WinNT 4 works o user and group enumeration as implemented by Tim works o file and print access works o changing password from Win9x & NT ummm...i'll fix this tonight :) If I broke anything else, just yell and I'll fix it. I think it should be fairly quite. -- jerry
* Fix for safe_free freeing static strings. From Robert August Vincent, II.Jeremy Allison2000-08-211-5/+6
| | | | Jeremy.
* Fixed memory leaks in root and non-root password changing.Tim Potter2000-07-261-7/+20
|
* moved secrets fns into secrets.cAndrew Tridgell2000-06-031-1/+1
|
* added secrets.tdb and changed storage of trust account password to useAndrew Tridgell2000-05-081-14/+3
| | | | it
* Fixed smbpasswd crash bugs found by Giulio.Jeremy Allison2000-03-011-3/+2
| | | | Jeremy.
* client/client.c:Jeremy Allison2000-02-251-53/+43
| | | | | | | libsmb/clientgen.c: Fixes for Win2k smbclient browsing. Other fixes implement smbpasswd -x user to delete users. Also allows swat to do the same. Jeremy.
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-365/+156
|
* final part of "first" phase converting over to msrpc daemon architecture.Luke Leighton1999-12-121-2/+0
| | | | | | | | | | | | done a minimal amout of clean-up in the Makefile, removing unnecessary modules from the link stage. this is not complete, yet, and will involve some changes, for example to smbd, to remove dependencies on the password database API that shouldn't be there. for example, smbd should not ever call getsmbpwXXX() it should call the Samr or Lsa API. this first implementation has minor problems with not reinstantiating the same services as the caller. the "homes" service is a good example.