summaryrefslogtreecommitdiff
path: root/source3/utils/smbpasswd.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r16247: Fix Coverity ID 296Volker Lendecke1-1/+1
(This used to be commit b82c95cb438b57bb8910e26657f8ffb590fe02df)
2007-10-10r16241: Fix Klocwork #106 and others like it.Jeremy Allison1-8/+25
Make 2 important changes. pdb_get_methods() returning NULL is a *fatal* error. Don't try and cope with it just call smb_panic. This removes a *lot* of pointless "if (!pdb)" handling code. Secondly, ensure that if samu_init() fails we *always* back out of a function. That way we are never in a situation where the pdb_XXX() functions need to start with a "if (sampass)" test - this was just bad design, not defensive programming. Jeremy. (This used to be commit a0d368197d6ae6777b7c2c3c6e970ab8ae7ca2ae)
2007-10-10r15906: smbpasswd help text for -W option (patch from Aruna Prabakar ↵Gerald Carter1-0/+1
<aruna.prabakar@hp.com> (This used to be commit 0a81af4fef5b794fea257d9e3e11b16c3a4de12f)
2007-10-10r15311: look at the NT password (not lanman one) when determining if ↵Gerald Carter1-1/+1
smbpasswd -e should probably for a password (This used to be commit 3522b53aecb5293747b66250279417f9edf876f1)
2007-10-10r13590: * replace all pdb_init_sam[_talloc]() calls with samu_new()Gerald Carter1-2/+2
* replace all pdb_{init,fill}_sam_pw() calls with samu_set_unix() (This used to be commit 6f1afa4acc93a07d0ee9940822d7715acaae634f)
2007-10-10r13576: This is the beginnings of moving the SAM_ACCOUNT data structureGerald Carter1-4/+4
to make full use of the new talloc() interface. Discussed with Volker and Jeremy. * remove the internal mem_ctx and simply use the talloc() structure as the context. * replace the internal free_fn() with a talloc_destructor() function * remove the unnecessary private nested structure * rename SAM_ACCOUNT to 'struct samu' to indicate the current an upcoming changes. Groups will most likely be replaced with a 'struct samg' in the future. Note that there are now passbd API changes. And for the most part, the wrapper functions remain the same. While this code has been tested on tdb and ldap based Samba PDC's as well as Samba member servers, there are probably still some bugs. The code also needs more testing under valgrind to ensure it's not leaking memory. But it's a start...... (This used to be commit 19b7593972480540283c5bf02c02e5ecd8d2c3f0)
2007-10-10r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()Gerald Carter1-2/+2
macro which sets the freed pointer to NULL. (This used to be commit b65be8874a2efe5a4b167448960a4fcf6bd995e2)
2007-10-10r13524: Add -t|--password-from-stdin option to pdbedit as we had with Samba 2.2.Lars Müller1-42/+0
This fixes bug #1386. The initial changes had been made by Carsten Höger <choeger at open-xhange dot com> for Samba 2.2 while being at SuSE. *sigh* To not duplicate code from smbpasswd in pdbedit stdin_new_passwd() and get_pass() are moved from smbpasswd to utils/passwd_util.c. (This used to be commit dbdc5ba497c6010dbad47c9d77fc8bec5557a328)
2007-10-10r13316: Let the carnage begin....Gerald Carter1-10/+14
Sync with trunk as off r13315 (This used to be commit 17e63ac4ed8325c0d44fe62b2442449f3298559f)
2007-10-10r13212: r12414@cabra: derrell | 2006-01-28 17:52:17 -0500Derrell Lipman1-1/+1
lp_load() could not be called multiple times to modify parameter settings based on reading from multiple configuration settings. Each time, it initialized all of the settings back to their defaults before reading the specified configuration file. This patch adds a parameter to lp_load() specifying whether the settings should be initialized. It does, however, still force the settings to be initialized the first time, even if the request was to not initialize them. (Not doing so could wreak havoc due to uninitialized values.) (This used to be commit f2a24de769d1b2266e576597c57a8e3b1e2a2b51)
2007-10-10r13148: Fix bug: #3413Simo Sorce1-3/+9
Check that ldap admin dn is defined in smb.conf before setting the ldap password in secrets.tdb Based on patch by William Jojo <jojowil@hvcc.edu> Simo. (This used to be commit c2c004a620ecbd895786dc6f16fb6a616f354a0a)
2007-10-10r12840: Add -W to smbpasswd. Thanks to William Jojo <jojowil@hvcc.edu>.Volker Lendecke1-1/+9
Volker (This used to be commit 2942f3594ba39748dca0238f1e1a5c744a7afffb)
2007-10-10r12544: Fix segfaults in winbind, smbpasswd and netVolker Lendecke1-0/+2
(This used to be commit 9ca8edc26e66887d6333943bc6a9776352c657fc)
2007-10-10r6261: Tidyup message str printf. Ensure tvs struct is zeroed.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 6c9f227ef400f32def85268f411691b569d29889)
2007-10-10r6256: Fix fprintf errors in smbpasswd. Fix for bug #2585 Ulf Härnhammar ↵Jeremy Allison1-3/+3
<metaur@telia.com> Jeremy. (This used to be commit 3dfa6c40fc726ddf38d4cfc6e0604ceed0035d18)
2007-10-10r3882: Fix bug 2069 -- thanks to jason@ncac.gwu.eduVolker Lendecke1-1/+2
(This used to be commit 5c9fd4d8963130829684469be172e859b3799e27)
2007-10-10r1504: Remove insane use of "user password" on the COMMAND LINE !Jeremy Allison1-25/+6
in smbpasswd. Use -s if you want to script this. Jeremy. (This used to be commit a3589a18b6898e2b51570112c5acb2826ef6ba4a)
2004-02-25I *hate* global variables...Andrew Bartlett1-0/+6
OK, what was happening here was that we would invalidate global_sam_sid when we set the sid into secrets.tdb, to force a re-read. The problem was, we would do *two* writes into the TDB, and the second one (in the PDC/BDC case) would be of a NULL pointer. This caused smbd startups to fail, on a blank TDB. By using a local variable in the pdb_generate_sam_sid() code, we avoid this particular trap. I've also added better debugging for the case where this all matters, which is particularly for LDAP, where it finds out a domain SID from the sambaDomain object. Andrew Bartlett (This used to be commit 86ad04d26d3065a99b08afaaf2914968a9e701c5)
2004-02-23Fix "unable to initialize" bug when smbd hasn't been run withJeremy Allison1-2/+4
new system and a user is being added via pdbedit/smbpasswd. Found at Connectathon setup. Jeremy. (This used to be commit f9c7a42e895f50e15d2f5079bfb2cb389fdf2df4)
2004-02-04This should be the correct fix for the lack of a prototype forAndrew Bartlett1-6/+0
remote_password_change(). Sorry for the original bug. Andrew Bartlett (This used to be commit 955436a6f6d7c2f580b2c4e1edbb7ee2fe5df858)
2004-02-02fix problems with proto.hGerald Carter1-1/+1
(This used to be commit 5a32f9568f128374df98491b43e6f5b299cb656c)
2004-02-02remerge andrew's cracklib patch from HEAD and fix a compile warningsGerald Carter1-0/+7
(This used to be commit b60f6ec30d05e4e5bba9934a416ddc8bc089824f)
2003-09-15fix online helpSimo Sorce1-1/+1
-w option need the password on the command line (This used to be commit fa7dea1710bac38f5f68be2e56a24ef5cca09ff5)
2003-07-22Replace the eight (!) copies of dummy become/unbecome root with a single one.Tim Potter1-15/+0
(This used to be commit 8b818ce381595cdcb36631a2440d6aa0038805f1)
2003-07-15Jim, could you please look at this? smbpasswd -a <username> was brokenVolker Lendecke1-2/+2
for me without this patch. I'm not sure if I interpreted your patch to this code right. Thanks, Volker (This used to be commit 46ec022f873416d2258fc8d84430b17319dce70f)
2003-07-11Doesn't re-prompt for password when it is specified on the cmdlineJim McDonough1-2/+2
(This used to be commit 6ebe87d318658f28ad9b9f8169fc4400856d5812)
2003-07-09more compile fixes for become/unbecome_root()Gerald Carter1-0/+15
(This used to be commit f005f1cf12b839f3985ab00315da63c584ce803e)
2003-07-03Removed strupper/strlower macros that automatically map to ↵Jeremy Allison1-1/+1
strupper_m/strlower_m. I really want people to think about when they're using multibyte strings. Jeremy. (This used to be commit ff222716a08af65d26ad842ce4c2841cc6540959)
2003-05-10Reverse previous patch from Stefan and me after comments by Andrew BartlettJelmer Vernooij1-3/+0
(This used to be commit d817eaf0ecca2d878ab1ffcf7a747a02d71c811e)
2003-05-10Patch from metze and me that adds dummy smb_register_*() functions soJelmer Vernooij1-0/+3
that is now possible to, for example, load a module which contains an auth method into a binary without the auth/ subsystem built in. (This used to be commit 74d9ecfe2dd7364643d32acb62ade957bd71cd0d)
2003-01-03Merge from HEAD - make Samba compile with -Wwrite-strings without additionalAndrew Bartlett1-2/+2
warnings. (Adds a lot of const). Andrew Bartlett (This used to be commit 3a7458f9472432ef12c43008414925fd1ce8ea0c)
2002-12-12merge of smbpasswd segfault from SAMBA_2_2Gerald Carter1-7/+10
(This used to be commit b17af40b1c73ccf7eeb3d1d18937cb3ffe162b5d)
2002-11-12Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison1-8/+2
dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy. (This used to be commit f755711df8f74f9b8e8c1a2b0d07d02a931eeb89)
2002-11-08Merge from HEAD:Andrew Bartlett1-1/+1
- change auth_sam to use the initialisation flags to determine if the password attributes are set - add const to secrets.c, cliconnect.c - passdb: fix spelling in pdb_ldap, add group mapping back to smbpasswd - SAMR: add debugs to show what fails for group enum. Andrew Bartlett (This used to be commit 4e74d00b3634abf52aa24bfaa6dbe88202aa57a1)
2002-09-25sync'ing up for 3.0alpha20 releaseGerald Carter1-18/+18
(This used to be commit 65e7b5273bb58802bf0c389b77f7fcae0a1f6139)
2002-08-17sync 3.0 branch with HEADJelmer Vernooij1-2/+4
(This used to be commit 1b83b78e332b9d28914eff155530e81cf2073a58)
2002-07-15updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell1-58/+47
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
2002-04-03reorder useage message a little. -L is not a root-only or local mode option.Herb Lewis1-7/+8
(This used to be commit 020d6fa2f780099d662de1a456838ec0ac4d3ca7)
2002-04-02readd -c config file change from 2.2 - works with -L mode now as well.Herb Lewis1-180/+178
(This used to be commit af4c3734b5d617352597b1b964745f5b0d334b2d)
2002-04-01reverted Herbs smbpasswd commit as it completely broke setting aAndrew Tridgell1-178/+181
password (This used to be commit a5807d5784dc903f1ea38a9825240a505688b7be)
2002-03-30merge from 2.2 - allow -c option to specify smb.conf fileHerb Lewis1-181/+178
(This used to be commit fc15b56d29b4474032f4d9136313afee60e70cbf)
2002-03-27merge from 2.2 - don't check local passdb if -r option usedHerb Lewis1-1/+3
(This used to be commit 15df51e8def01009f2ec1e2d08c3129ac39dabdf)
2002-01-30Removed version number from file header.Tim Potter1-1/+1
Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2002-01-20This is another *BIG* change...Andrew Bartlett1-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. (This used to be commit ff354c99c585068af6dc1ff35a1f109a806b326b)
2002-01-07merge changes from 2.2 branch to prevent smb.conf from changing debug levelHerb Lewis1-0/+3
of commands when specified on command line. (This used to be commit 39d6b31e14144a3ff4b992d4286b706147e58566)
2002-01-07sync getopt() args with 2.2Gerald Carter1-1/+1
(This used to be commit 2fcdc520cee051631bbc2a0c06466d231390f8d5)
2001-12-14Rafal (mimir) patch for trusts r.Jean-François Micouleau1-1/+21
(This used to be commit c26623671e2b0b2e80c6d6383a99880c4f439f04)
2001-12-13update the ldap support code. it compiles.Jean-François Micouleau1-1/+41
Ignacio you can update your howto ;-) samsync: a small patch to try chaning challenges. J.F. (This used to be commit c99bc305599698f2291efbfe20024355cb2bcde0)
2001-12-05OK. Smbpasswd -j is DEAD.Andrew Bartlett1-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 (This used to be commit 575897e879fc175ba702adf245384033342c903d)
2001-12-04moved init_account_policy() to the right placeAndrew Tridgell1-2/+0
(This used to be commit e908f304a26b9f1100e301610151a9334bf117b0)