summaryrefslogtreecommitdiffstats
path: root/source/utils/smbpasswd.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* OK. This code works on a RedHat 6.0 system. However smbpasswdGerald Carter1999-12-091-0/+2
| | | | | | | | | | | | | | | | | time out of sending the session setup on Solaris 2.6. No idea. I'll work on it some tomorrow. This is to fix the "Unable to setup password vectors" thingy. Also changed an inet_aton() to inet_addr() as the former is not very portable :-) Luke, I set the redir flag to false because the connection to the smb-agent was failing and smbpasswd bombed. Double check me on this one. -jc
* fixing joining to domain plus something weird going down with nt logins...Luke Leighton1999-12-011-33/+0
|
* attempting to establish inter-domain trust relationships. modifiedLuke Leighton1999-11-201-28/+115
| | | | smbpasswd so it can be used to set up inter-domain trust account.
* BDC support.Matthew Chapman1999-07-221-32/+38
| | | | Added -S (Synchronise) option to smbpasswd, which calls synchronise_passdb.
* BDC support.Luke Leighton1999-07-211-5/+21
|
* Mainly BDC-related changes.Matthew Chapman1999-04-081-10/+26
| | | | | | | | * Added SEC_CHAN_BDC * Added -b switch to smbpasswd (for a BDC (server) trust account). * Propagate sec_chan into the various functions which change trust account passwords, so they can be used for domain control and inter-domain trusts.
* Beau Kuiper: provided patch so that passwords could only be changed byLuke Leighton1999-03-191-3/+29
| | | | | | root if the ACB_PWLOCK bit is set (on a per-user basis). he also added an extra smbpasswd option so that this bit can be modified from command-line.
* mods to allow inter-domain trust accounts to be added to SAM databaseLuke Leighton1999-03-091-77/+177
| | | | using smbpasswd command.
* Added load_interfaces in smbpasswd to allow name resolution by broadcast andMatthew Chapman1999-01-181-0/+2
| | | | multiple interfaces. (Jeremy already committed this in SAMBA_2_0).
* rpc_samr.h parse_samr.c srv_samr.c :Luke Leighton1998-12-011-1/+1
| | | | | | | | | | samr_query_aliasmembers (cool!) util_pwdb.c sids.c nmbd.c server.c smbpasswd.c swat.c : pwdb_initialise(BOOL is_server) now creates / reads DOMAIN_NAME.SID if is_server is True, and does LsaQueryInfoPolicy(levels 3 and 5) to obtain member and pdc sids.
* pwdb_initialise() in the wrong place: must load smb.conf first. thanks phil.Luke Leighton1998-11-301-6/+6
|
* weekend work. user / group database API.Luke Leighton1998-11-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - split sam_passwd and smb_passwd into separate higher-order function tables - renamed struct smb_passwd's "smb_user" to "unix_user". added "nt_user" plus user_rid, and added a "wrap" function in both sam_passwd and smb_passwd password databases to fill in the blank entries that are not obtained from whatever password database API instance is being used. NOTE: whenever a struct smb_passwd or struct sam_passwd is used, it MUST be initialised with pwdb_sam_init() or pwd_smb_init(), see chgpasswd.c for the only example outside of the password database APIs i could find. - added query_useraliases code to rpcclient. - dealt with some nasty interdependencies involving non-smbd programs and the password database API. this is still not satisfactorily resolved completelely, but it's the best i can do for now. - #ifdef'd out some password database options so that people don't mistakenly set them unless they recompile to _use_ those options. lots of debugging done, it's still not finished. the unix/NT uid/gid and user-rid/group-rid issues are better, but not perfect. the "BUILTIN" domain is still missing: users cannot be added to "BUILTIN" groups yet, as we only have an "alias" db API and a "group" db API but not "builtin-alias" db API...
* Added OSF1 changes to HEAD (-lsecurity etc.)Jeremy Allison1998-11-181-12/+6
| | | | | | groupdb/groupdb.c: Fixed compile error caught by IRIX compiler. utils/smbpasswd.c: Fixed SunOS optind, optarg problem. Jeremy.
* - group database API. oops and oh dear, the threat has been carried out:Luke Leighton1998-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the pre-alpha "domain group" etc parameters have disappeared. - interactive debug detection - re-added mem_man (andrew's memory management, detects memory corruption) - american spellings of "initialise" replaced with english spelling of "initialise". - started on "lookup_name()" and "lookup_sid()" functions. proper ones. - moved lots of functions around. created some modules of commonly used code. e.g the password file locking code, which is used in groupfile.c and aliasfile.c and smbpass.c - moved RID_TYPE_MASK up another bit. this is really unfortunate, but there is no other "fast" way to identify users from groups from aliases. i do not believe that this code saves us anything (the multipliers) and puts us at a disadvantage (reduces the useable rid space). the designers of NT aren't silly: if they can get away with a user- interface-speed LsaLookupNames / LsaLookupSids, then so can we. i spoke with isaac at the cifs conference, the only time for example that they do a security context check is on file create. certainly not on individual file reads / writes, which would drastically hit their performance and ours, too. - renamed myworkgroup to global_sam_name, amongst other things, when used in the rpc code. there is also a global_member_name, as we are always responsible for a SAM database, the scope of which is limited by the role of the machine (e.g if a member of a workgroup, your SAM is for _local_ logins only, and its name is the name of your server. you even still have a SID. see LsaQueryInfoPolicy, levels 3 and 5). - updated functionality of groupname.c to be able to cope with names like DOMAIN\group and SERVER\alias. used this code to be able to do aliases as well as groups. this code may actually be better off being used in username mapping, too. - created a connect to serverlist function in clientgen.c and used it in password.c - initialisation in server.c depends on the role of the server. well, it does now. - rpctorture. smbtorture. EXERCISE EXTREME CAUTION.
* Added fixes for machine accounts.Jeremy Allison1998-11-161-10/+32
| | | | Jeremy.
* fixes for OSF1 compilationAndrew Tridgell1998-11-131-2/+2
|
* Removed code that used printf/fprintf in password changin libraries.Herb Lewis1998-11-121-3/+19
| | | | Now passes strings instead.
* Fixed smbpasswd so that enabling a user who already has a passwordJeremy Allison1998-11-121-2/+20
| | | | | | doesn't require a new password entry. Sets the 'enable/disable' code back to being symmetrical. Jeremy.
* extracted the password change code from smbpasswd and used it in swatAndrew Tridgell1998-11-121-218/+0
| | | | instead of opening pipes and other horrible stuff.
* char -> uchar fixAndrew Tridgell1998-11-121-1/+1
|
* largely rewrote smbpasswd so that the code is understandable. ThisAndrew Tridgell1998-11-121-637/+679
| | | | | | | | | | | | | should allow us to call a function in swat rather than piping to smbpasswd. while doing this I also fixed quite a few "const char *" versus "char *" issues that cropped up while using const to track down bugs in the code. This led to changes in several generic functions. The smbpasswd changes should be correct but they have not been extensively tested. At least if I have introduced bugs then we should be able to fix them more easily than before.
* converted smbclient to use clientgen.c rather than clientutil.cAndrew Tridgell1998-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | I did this when I saw yet another bug report complaining about smbclient intermittently missing files. Rather than applying more patches to smbclient it was better to move to the more robust clientgen.c code. The conversion wasn't perfect, I probably lost some features of smbclient while doing it, but at least smbclient should be consistent now. It if fails it should _always_ fail rather than giving people the false impression of a reliable utility. the tar stuff seems to work, but hasn't had much testing as I never use it myself. I'm sure someone will find bugs in my conversion of smbtar.c. It was quite tricky as it did a lot of its own SMB calls. It now uses clientgen.c exclusively. smbclient is still quite messy, but at least it doesn't build its own SMB packets. I haven't touched smbmount as I never use it. Mike, do you want to convert smbmount to use clientgen.c?
* codepages/codepage_def.936: Updated comment.Jeremy Allison1998-11-071-3/+3
| | | | | | | | | param/loadparm.c: Removed "networkstation user login", "domain controller", and "domain sid" parameters. passdb/passdb.c: Removed "networkstation user login" code and changed bug test code to only check once for a bad password server. This will stop the complaints of many "bad login" audit records in NT PDC logs. utils/smbpasswd.c: Removed check for "domain controller". Jeremy.
* lib/charcnv.c: Improved debug comment.Jeremy Allison1998-11-061-8/+10
| | | | | | | | | | | libsmb/namequery.c: Fix to remove 2 second wait is we are doing a unicast and got a reply. smbd/dfree.c: smbd/noquotas.c: smbd/quotas.c: Fixes from Dejan Ilic <svedja@lysator.liu.se> for the quota code. utils/smbpasswd.c: Fixes to allow smbpasswd to be called from swat. Jeremy.
* Added scripting option (-s) to smbpasswd.Jeremy Allison1998-11-041-10/+73
| | | | Jeremy.
* Fix suggested by Nicholas.S.Jenkins@cdc.com - connect to theJeremy Allison1998-10-301-2/+7
| | | | | | | password change server as anonymous - you don't need to have logged on as the user to do the password change. Doh ! (Why didn't *I* think of that one.... :-). Jeremy.
* - modified resolve_name() to take a name_typeAndrew Tridgell1998-10-041-1/+1
| | | | | | - cleaned up resolve_name() (split into separate functions for each resolver) - if can't find local master then use #1B name - support listing of foreign workgroups in /smb/
* - static function "create_new_hashes" was identical to "nt_lm_owf_gen".Luke Leighton1998-10-021-23/+2
| | | | | | | | | | create_new_hashes didn't zero the buffer for the md4hash: nt_lm_owf_gen did, because jeremy sorted this out a couple of days ago. call nt_lm_owf_gen instead. - call SMBOWFencrypt from SMBencrypt and SMBNTencrypt. - added #ifdef DEBUG_PASSWORD debug password calls.
* Fixed up more possibly uninitialized variables.Richard Sharpe1998-09-271-1/+1
| | | | | | Now only two compilation warnings seem to be left. Luke may want to check the changes I made.
* Makefile.in: Fixed bug with continuation line causing proto to fail.Jeremy Allison1998-09-251-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added $(PROGS) $(SPROGS) as targets for make clean. acconfig.h: Added HAVE_IRIX_SPECIFIC_CAPABILITIES. configure.in: Added sys/capability.h header check. Added function checks for srandom random srand rand. Added HAVE_IRIX_SPECIFIC_CAPABILITIES test. includes.h: Added #include <sys/capability.h>. ntdomain.h: Moved struct acct_info into here from smb.h smb.h: Added KERNEL_OPLOCK_CAPABILITY define. Moved enum action_type into rpcclient.h Moved struct cli_state into client.h Moved struct nt_client_info, struct tar_client_info, struct client_info into rpcclient.h lib/genrand.c: Changed to use sys_random() & friends. lib/smbrun.c: Lose capabilities after fork. lib/system.c: Added set_process_capability(), set_inherited_process_capability() sys_random(), sys_srandom(). lib/util.c: Added Ander's EFBIG lock check to fcntl_lock for 64 bit access to an 32 bit mounted NFS filesystem. nmbd/nmbd.c: Changed to use sys_random() & friends. nmbd/nmbd_browsesync.c: Changed to use sys_random() & friends. passdb/ldap.c: Missed one pdb_encode_acct_ctrl call. passdb/passdb.c: Changed to Ander's code for ' ' characters. passdb/smbpass.c: Added Ander's code to reset ACB_PWNOTREQ. script/mkproto.awk: Added 'long' to prototypes. smbd/chgpasswd.c: Lose capabilities after fork. smbd/open.c: Do the mmap *after* the kernel oplock. smbd/oplock.c: Removed stub code from kernel oplock path. Added set_process_capability(), set_inherited_process_capability() calls. smbd/reply.c: Initialize count = 0, offset = 0. smbd/server.c: Added set_process_capability(), set_inherited_process_capability() calls. tests/summary.c: Ensure we have RANDOM or RAND. utils/smbpasswd.c: Added Ander's code to reset ACB_PWNOTREQ. utils/torture.c: Changed to use sys_random() & friends. Jeremy.
* added wksinfo command to rpcclient, which don't work too good.Luke Leighton1998-09-251-0/+1
|
* added rpcclient programLuke Leighton1998-09-251-1/+7
|
* Integration of Anders Blomdell <anders.blomdell@control.lth.se>'sJeremy Allison1998-09-241-48/+90
| | | | | | smbpasswd changes. Not exactly the same as his code - several changes. Jeremy.
* some cleanups to use ZERO_STRUCT() and friendsAndrew Tridgell1998-09-051-1/+1
|
* loadparm.c:Jeremy Allison1998-07-141-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | With apologies to Charlton Heston and Pierre Boule. "You damn fools, you finally did it". Changed default security mode to be security=user. Yes this is a big (although small in code) change. It's something we've been discussing for a while, to finally wean people off the legacy security=share mode which is *never* what you want. Jeremy. nmbd_incomingrequests.c: Bug fix for nmbd core dumps caused by overrun. Found by <samuel@public.szonline.net>. nttrans.c: More NT smb stuff. reply.c: Unlink will overwrite an existing file. Well you learn something new about POSIX every day. :-). server.c: Tidyup unreadable code. smbpasswd.c: Code to allow -U remote_username to allow ordinary users to change remote passwords if their NT username is different from their UNIX username. Patch from <torbjorn.lindh@allgon.se>. Jeremy.
* loadparm.c: Added machine password timeout parameter - set to 7 days be default.Jeremy Allison1998-05-271-165/+27
| | | | | | | | | password.c: Added code to tell server.c when machine password needs changing. server.c: Change machine password in idle cycles if it needs it. smbpassfile.c: Fixed up length calculations for machine password file. smbpasswd.c: Moved domain joining code/machine password changing code. lib/rpc/client/cli_netlogon.c: And this is where it now lives. Jeremy.
* Abstracted all the crappy password interfaces through an indirectJeremy Allison1998-05-181-0/+6
| | | | | | | | function table, selectable at compile time. This should make the code that implements all the password functions much cleaner, as it's now very clear exactly what a particular password database needs to provide to Samba. Jeremy.
* chgpasswd.c: Changed back to getsmb... from getsam...Jeremy Allison1998-05-181-10/+10
| | | | | | | | | | | | | | | | | | | | ldap.c: Stoped dummy_function being prototyped. loadparm.c: Fixed slprintf sizes. nisppass.c: Fixed safe_strcpy sizes. nmbd_processlogon.c: Changed back to getsmb... from getsam... nttrans.c: Just a dump of new code. passdb.c: Moved stuff around a lot - stopped any lookups by rid. This needs to be indirected through a function table (soon). password.c: Changed back to getsmb... from getsam... reply.c: Changed back to getsmb... from getsam... slprintf.c: Fixed prototype problems. smb.h: Fixed prototype problems. smbpass.c: Changed to getsmbfile.... smbpasswd.c: Changed back to getsmb... from getsam... lib/rpc/server/srv_netlog.c: Changed back to getsmb... from getsam... lib/rpc/server/srv_samr.c: Fixed rid lookup - use uid or gid lookup. lib/rpc/server/srv_util.c: Changed back to getsmb... from getsam... Jeremy.
* Change getpwnam to Get_Pwnam(xx , True) to allow lazy matchingJeremy Allison1998-05-151-1/+1
| | | | | in /etc/passwd. Fix from "Mike Black" <mblack@csihq.com>. Jeremy.
* This is a security audit change of the main source.Jeremy Allison1998-05-121-2/+2
| | | | | | | | | | | | | | | | | | 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.
* reply.c: Added code to not overwrite sesssetup_user when in share level securityJeremy Allison1998-05-111-1/+1
| | | | | | | and null session setup done. smbpasswd.c: Fix from Gerald Carter <cartegw@Eng.Auburn.EDU> to fix incorrect use of pointer. Jeremy.
* ldap back-end database developmentLuke Leighton1998-05-111-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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