summaryrefslogtreecommitdiffstats
path: root/source/utils/smbpasswd.c
Commit message (Collapse)AuthorAgeFilesLines
* nmbd/nmbd_incomingrequests.c: Split long debug message.Jeremy Allison1999-01-071-0/+2
| | | | | | utils/smbpasswd.c: Added load_interfaces() to allow name resolution to work correctly for multihomed smb.confs. Jeremy.
* Makefile.in configure configure.in include/config.h.in: Added -c -o fixes ↵Jeremy Allison1998-12-291-0/+4
| | | | | | | from Tim Rice. utils/smbpasswd.c web/swat.c: Added set_auth_parameters() call where needed for OSF1_ENC_SEC. Jeremy.
* Fixed bug in smbpasswd where adding a user and mis-typing the newJeremy Allison1998-12-121-2/+7
| | | | | | password a second time would add the user with a potentially random garbage password. Jeremy.
* Makefile.in: Implemented andrej's private and swat file changes.Jeremy Allison1998-12-011-3/+4
| | | | | | | | | configure.in: Implemented andrej's private and swat file changes and SINIX changes. client/smbmount.c: Head branch race condition fix. lib/system.c: Fix compile for OS's that don't have shared mmap. smbd/dfree.c: Fix compile for STAT_STATVFS64 as well as STAT_STATVFS. utils/smbpasswd.c: Tidied up error messages. Jeremy.
* Added some of the fixes needed for OSF1 (Digital UNIX).Jeremy Allison1998-11-181-12/+6
| | | | | | | HAVE_PUTPRPWNAM is defined in -lsecurity. <net/route.h> needed to stop compile complaints in <net/if.h> smbpasswd: Moved SunOS optind/optarg to global scope. Jeremy
* Added machine account fixes.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
* changed to use slprintf() instead of sprintf() just aboutAndrew Tridgell1998-05-111-1/+1
| | | | | | | everywhere. I've implemented slprintf() as a bounds checked sprintf() using mprotect() and a non-writeable page. This should prevent any sprintf based security holes.
* moving gethexpwd into util.c, because it's used in both smbpass.c and ldap.cLuke Leighton1998-05-071-10/+10
|
* Fixed changed calls to machine password locking code.Jeremy Allison1998-05-071-5/+4
| | | | Jeremy.
* Added patch from Bruce Tenison <btenison@dibbs.net> to allow encryptedJeremy Allison1998-04-301-1/+1
| | | | | | | | passwords to be stored over time, allowing a smbpasswd file migration. Adds new parameter "update encrypted". Will also add to 1.9.18 branch. Docs update to follow. Jeremy.
* Makefile: Added files to smbpasswd.c.Jeremy Allison1998-04-291-16/+266
| | | | | | | | | | loadparm.c: Patch from tim@quiknet.com for static string problems. server.c: Setup global_myname. smbpass.c: Fix up locking. Add machine_password_delete() call. smbpasswd.c: Added provisional code to add to a domain. lib/rpc/client/cli_login.c: Fixed incorrect cred_hash3 call when setting machine password. lib/rpc/server/srv_netlog.c: Fixed incorrect cred_hash3 call when setting machine password. Jeremy.
* This looks like a big change but really isn't.Jeremy Allison1998-04-251-3/+4
| | | | | | | | | | | It is changing the global variables "myname" and "myworkgroup" to "global_myname" and "global_myworkgroup" respectively. This is to make it very explicit when we are messing with a global (don't ask - it makes the domain client code much clearer :-). Jeremy.
* clientgen.c: Added rap error codes to cli_error, moved from smbpasswd.cJeremy Allison1998-04-231-60/+6
| | | | | | | password.c: Changed global cli -> pw_cli, removed strtok (bad strtok, bad :-) use in security=server, started to extend security=domain code. smbpasswd.c: Removed rap error code functions. Jeremy.
* includes.h: Added John's redhat fix for QSORT_CAST.Jeremy Allison1998-04-181-529/+56
| | | | | | | | | | | | | smbpass.c: Added lock depth code so calls to pw_file_lock() can be nested. Fixed codedump problems in add_smbpwd_entry(). smbpasswd.c: Removed all the code that manipulated the password file directly. Now *all* smbpasswd file changes are done through the interfaces defined in smbpass.c This should make the life of people adding alternate backend databases *much* easier. lib/rpc/server/srv_netlog.c: Removed debug messages used to debug machine password changing. Jeremy.
* Changing of machine passwords now works !!!!!!Jeremy Allison1998-04-171-11/+22
| | | | | | | | smbdes.c: Added cred_hash3. smbpasswd.c: Fixes for adding a machine account (needs more work). lib/rpc/server/srv_netlog.c: Turn on the machine password changing code by default (calls cred_hash3). Jeremy.
* ipc.c: Fix for printer queue spinning with Win95.Jeremy Allison1998-04-151-43/+46
| | | | | | | | | nmbd.c: Fix for always overwriting log despite append setting. smb.h: Addition of last time password changed entry to account info. smbpass.c: Changes to support last time changed field in smbpasswd file. smbpasswd.c: Changes to support last time changed field in smbpasswd file. util.c: Fix for always overwriting log despite append setting. Jeremy.
* Modified interfaces to getting smb password entries fromJeremy Allison1998-04-141-4/+4
| | | | | | | | | | | | | | | | | | | | get_smbpwd_entry (now an internal function to smbpass.c) to a more UNIX-like : getsmbpwnam() - get entry by name. getsmbpwuid() - get entry by uid. Changed the type returned by the smbpasswd enumeration functions to be a void * so that people don't come to depend on it being a FILE *. These abstractions should make it much easier to replace the smbpasswd file with a better backend in future. Other files changed are to match the above changes. Jeremy.
* Makefile, loadparm.c, server.c, smb.h, util.c: Patch fromJeremy Allison1998-04-091-1/+1
| | | | | | | stn@techfak.uni-kiel.de (Stefan Nehlsen) to get homes from the NIS+ map. smbpasswd.c: Tidy up of cli_state structure. Jeremy.
* Added check for getpwnam returning NULL.Jeremy Allison1998-04-071-3/+7
| | | | Jeremy.
* Added extra remote password changing error codes from lmerr.h on NT.Jeremy Allison1998-03-301-2/+5
| | | | Jeremy.
* client.c: Fixed problem where debug level on command line was overridden by ↵Jeremy Allison1998-03-261-34/+58
| | | | | | | | smb.conf. smbpasswd.c: Removed bugs I put in yesterday (thanks Luke :-) and added error message reporting for remote password changing. Jeremy.
* Added the ability to differentiate between workstation and serverJeremy Allison1998-03-261-10/+13
| | | | | accounts when adding machine account types. Jeremy.
* smbpass.c: Made unknown accounts ending in '$' server accounts, notJeremy Allison1998-03-261-5/+29
| | | | | | | workstation. smbpasswd.c: Added code to count down from last machine account to add correct uid when adding a machine account. Jeremy.