summaryrefslogtreecommitdiff
path: root/source3/smbd/password.c
AgeCommit message (Collapse)AuthorFilesLines
1998-03-04Adding Korean and Traditional Chinese codepage support.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 2df47cf1bb3428fbaa8dcf45ec114ec3aaafae57)
1998-02-26Makefile, password.c, includes.h: Added KRB4 patches from Johan Hedin ↵Jeremy Allison1-0/+30
<johanh@fusion.kth.se> nmbd_packets.c: Patch for aliased interfaces from Daniel Haun <dhaun@ecf2.puc.edu>. Jeremy. (This used to be commit 60f6302b1972e49159bf6e1a838e691268e4399c)
1998-02-07A small raft of changes, I will sync up with 1.9.18 also.Jeremy Allison1-22/+39
chgpasswd.c: Fixed typo in debug message. includes.h: Fix include for aix. kanji.c: Added cap_to_sj as inverse of sj_to_cap. loadparm.c: local.h: password.c: Added code for "networkstation user login" parameter. - patch from Rob Nielsen <ran@adc.com>. printing.c: Added further aix printing fixes. reply.c: Changed access time fetch to a function. trans2.c: Changed access time fetch to a function. time.c: Changed access time fetch to a function. server.c: Made NT redirector workaround final. util.c: Added debug for write_socket failing. Jeremy. (This used to be commit a031404623c22d62f8de035be2239f609af08112)
1998-01-23Changed code that truncates salt after 2 characters so that it becomesJeremy Allison1-0/+3
HPUX specific. This fixes a bug with FreeBSD md5 crypt implementation that needs all of the password characters. It seems better to make this an HPUX specific thing. Jeremy. (This used to be commit 91a2b746d3fac261d4be3bd7afa3d5bb601b3d27)
1998-01-22This is *not* a big change (although it looks like one).Jeremy Allison1-1/+1
This is merely updating the Copyright statements from 1997 to 1998. It's a once a year thing :-). NO OTHER CHANGES WERE MADE. Jeremy. (This used to be commit b9c16977231efb274e08856f7f3f4408dad6d96c)
1998-01-10Following discussions with Cristian Gafton (Red Hat) we have decided to makeJohn Terpstra1-2/+8
PAM silent about it's actions. This reduced error logging for EVERY password validation request. Refer to password.c PAM section for further info. Fiels Affected: password.c (This used to be commit 7a1a8042dd005e26e610a16eaaa693f119b874c7)
1997-12-03allow users to disable the NetWkstaUserLogon call in server levelAndrew Tridgell1-0/+2
security by changing a setting in local.h or adding it to their Makefile. See comment in local.h (This used to be commit cc10fdf7583ec644850445ad96afd8b22b71e86f)
1997-12-02HPUX trusted systems need to use bigcrypt() not crypt()Andrew Tridgell1-0/+4
(This used to be commit 979eaf9e9c4dd58f1371597585d4cd64841febd0)
1997-11-10Rolled back tree state to 11:59pm 8th November 1997 EST toJeremy Allison1-1/+139
remove problems. Jeremy (This used to be commit 4a36ac236c2ad634f05efcd0179875d09988614a)
1997-11-09attempting to mark up 32 bit error codes, needed for NT domains.Luke Leighton1-139/+1
separated out smb server-mode password validation into a separate file. added called and calling netbios names to client gen state: referenced section in rfc1002.txt. created workstation trust account checking code in ntclient.c there might be a bug in reply_session_setup_andX. i indented and added { } around single-line if statements: the lm password checking code now doesn't look right (around the GUEST_SESSSETUP bits). *no code semantics have been changed by the indentation process*. (This used to be commit f27966957fa7f16d337a4a58719239d036deab4c)
1997-11-06following a cvs error, i am rewriting this monster-commit. with bad grace.Luke Leighton1-1/+2
Modified Files: --------------- Makefile: adding extra files ipc.c : send_trans_reply() - alignment issue. this makes the alignment the same as that in NT. this should be looked at by people who understand the SMB stuff better than i. api_fd_commands[] - added samr and wkssvc pipes. loadparm.c : lp_domain_controller() changed to mean "samba is a domain controller". it's a "yes/no" parameter, now. no, it isn't used _anywhere_. namedbwork.c nameelect.c : if "domain controller = yes" then add SV_TYPE_DOMAIN_CTRL to the host _and_ workgroup announcements. yes, you must do both: nt does. namelogon.c : important NETLOGON bug in SAMLOGON request parsing, which may be the source of some people's problems with logging on to the Samba PDC. password.c : get_smbpwnam() renamed to get_smbpwd_entry(). pipes.c : added samr and wkssvc pipes. proto.h : usual. can we actually _remove_ proto.h from the cvs tree, and have it as one of the Makefile dependencies, or something? reply.c : get_smbpwnam() renamed to get_smbpwd_entry() - also changed response error code when logging in from a WORKSTATION$ account. yes, paul is right: we need to know when to return the right error code, and why. server.c : added call to reset_chain_pnum(). #ifdef NTDOMAIN added call to init_lsa_policy_hnd() #endif. jeremy, you'd be proud: i did a compile without NTDOMAIN, and caught a link error for this function. smb.h : defines and structures for samr and wkssvc pipes. smbpass.c : modified get_smbpwnam() to get_smbpwd_entry() and it now takes two arguments. one for the name; if this is null, it looks up by smb_userid instead. oh, by the way, smb_userids are actually domain relative ids (RIDs). concatenate a RID with the domain SID, and you have an internet globally unique way of identifying a user. we're using RIDs in the wrong way.... added mod_smbpwnam() function. this was based on code in smbpasswd.c rpc_pipes/lsaparse.c : added enum trusted domain parsing. this is incomplete: i need a packet trace to write it properly. rpc_pipes/pipe_hnd.c : added reset_chain_pnum() function. rpc_pipes/pipenetlog.c : get_smbpwnam() function renamed to get_smbpwd_entry(). arcfour() issues. removed capability of get_md4pw() function to automatically add workstation accounts. this should either be done using smbpasswd -add MACHINE$, or by using \PIPE\samr. rpc_pipes/pipe_util.c : create_pol_hnd() - creates a unique LSA Policy Handle. overkill function: uses a 64 bit sequence number; current unix time and the smbd pid. rpc_pipes/smbparse.c : arcfour() issues. smb_io_unistr2() should advance by uni_str_len not uni_max_len. smb_io_smb_hdr_rb() - request bind uses uint16 for the context id, and uint8 for the num_syntaxes. oops, i put these both as uint32s. Added Files: ------------ rpc_pipes/lsa_hnd.c : on the samr pipe, allocate and associate an LSA Policy Handle with a SID. you receive queries with the LSA Policy Handle, and have to turn this back into a SID in order to answer the query... rpc_pipes/pipesamr.c rpc_pipes/samrparse.c \PIPE\samr processing. samr i presume is the SAM Replication pipe. rpc_pipes/pipewkssvc.c rpc_pipes/wksparse.c \PIPE\wkssvc processing. the Workstation Service pipe? holy cow. (This used to be commit 1bd084b3e690eb26a1006d616075e53d711ecd2f)
1997-11-01a simple SMB torture tester. This will allow us to evaluate lockingAndrew Tridgell1-4/+1
techniques more accurately. (This used to be commit 054e3b2ae3a8cfb98fde72becef9b05de34d2ba7)
1997-10-21rewrote the password server code using the new clientgen.c clientAndrew Tridgell1-169/+106
interface The new code uses a source netbios name equal to the Samba servers name, not the client name. It also uses NetWkstaUserLogon to do a full network logon. This means it will honour the servers logon restrictions (such as login times etc). (This used to be commit 11de90f972f6d83974425e80014f54e15d495413)
1997-10-20util.c password.c :Luke Leighton1-35/+0
added automount_server() function which, if -DAUTOMOUNT is in use, returns the server name of the NIS auto.map entry. otherwise, it returns local_server. added use of automount_server() for a new substitution %N for NIS home server. this defaults, via automount_server(), to the same functionality as %L if -DAUTOMOUNT is not used. removed vuser->home_share. moved code that grabbed the servername into the separate function automount_server(). loadparm.c : created "logon drive" (default of "") created "logon home" (default of "\\%N\%U") changed default of "logon path" from NULL to "\\%N\%U\profile". ipc.c pipenetlog.c : use lp_logon_drive(), lp_logon_home() and lp_logon_path() in their now easier-to-use form (don't have to check if *lp_logon_path() and manually substitute a default of \\%L\%U and do a standard_sub_basic() on the result, because the default automatically does this. (This used to be commit c6c28a4c3c9010ff9d5eac4bad091189a786d5a0)
1997-10-20casting cleanupsAndrew Tridgell1-1/+1
(This used to be commit ab849a97821c9e1f199eea8ea2ec477687bed947)
1997-10-16Added Michael Johnsons' PAM modifications <johnsonm@redhat.com>John Terpstra1-12/+12
This patch has been checked over. JHT (This used to be commit c84a043f89ccba001597962cd03e2f2a634c4b08)
1997-10-15force the salt to be a maximum of 2 characters long in callsAndrew Tridgell1-0/+1
to crypt() This might solve some password problems, particulary on HPUX (This used to be commit 45f4ae4327a8836cad22bbf64f1effba6a6eb7f5)
1997-10-10Makefile:Luke Leighton1-45/+52
added credentials.c to smbd credentials.c: using credential structures instead of char* password.c uid.c server.c: added sid and attr to user_struct. smbdes.c: smbhash and str_to_key make public instead of private. pipes.c smb.h: lsa structures, sub-functions. proto.h: usual. (This used to be commit 87a0a944855a673d693d934e446bdc231b1c7f02)
1997-09-30dir.c: more pstrcpys.Jeremy Allison1-14/+31
local.h: Add OPLOCK_BREAK_TIMEOUT. password.c: Fix for paranoia password server security bug. proto.h: Updated. reply.c: Oplock changes. server.c: Massive oplock changes - nearly there.... smb.h: oplock definitions. util.c: Add local message processing queues for oplocks. Jeremy (jallison@whistle.com) (This used to be commit 92f1553db2cdf6f32881eb984a87050cf3e4760b)
1997-09-16add a castAndrew Tridgell1-1/+1
(This used to be commit e712c6ed61abeae5ec2acf99f109ad81e7a19978)
1997-09-16- change generate_challenge() to use md4 instead of desAndrew Tridgell1-11/+18
- move routines about a bit between smbencrypt.c and smbdes.c. Ensure that there is no entry point for normal DES operation - add the following comment: This code is NOT a complete DES implementation. It implements only the minimum necessary for SMB authentication, as used by all SMB products (including every copy of Microsoft Windows95 ever sold) In particular, it can only do a unchained forward DES pass. This means it is not possible to use this code for encryption/decryption of data, instead it is only useful as a "hash" algorithm. There is no entry point into this code that allows normal DES operation. I believe this means that this code does not come under ITAR regulations but this is NOT a legal opinion. If you are concerned about the applicability of ITAR regulations to this code then you should confirm it for yourself (and maybe let me know if you come up with a different answer to the one above) (This used to be commit 35b92e725f351c9a9f2846a6b55f71c234f187c7)
1997-09-14This commit does 3 main things:Andrew Tridgell1-22/+9
1) put the encryption code in by default, with no #ifdef. It is still disabled by default so you need to add "encrypt passwords = yes" in smb.conf but at least all binaries will have it. 2) cleanup the kanji code so it compiles with no warnings 3) get rid of lots of uses of ugly non-portable C code. The main offender being things like "register" but also remove uses of the "const" keyword as there are compilers out there that don't support it and even those that do often complain about its usage. Users don't like warnings :-( There is still some work to do. We need to replace the md4 code with our own implementation. The current code (from rfc1186) is PD but is not very portable. The new RFC (rfc1320) is more portable but adds copyright restrictions. I'll do a from-scratch MD4 soon. We also need to test that what I've implemented is portable. It should be, but I'm too tired right now to test it on anything other than intel linux. (This used to be commit db917c62c14315afe6f0745a8097c1bca25cbf07)
1997-09-04Fix from Frank Varnavas <varnavas@ny.ubs.com>.Jeremy Allison1-3/+17
We cannot use the same name as the client to the NT password server, as NT will drop client connections if the same client name connects twice. Instead, synthesize a name from our pid. and the remote machine name. Jeremy (jallison@whistle.com) (This used to be commit ebf9487a9a68c4d786449490627ee919622e6dbf)
1997-08-11spelling.Samba Release Account1-1/+1
lkcl (This used to be commit 7e326450cf5aeee704df9fb5e298b0fc353dfb8b)
1997-08-05Makefile: Added IRIX 6 target.Samba Release Account1-3/+3
loadparm.c: Fixed stupid static warnings with set_default_server_announce_type. password.c: Fixed char -> uchar cast warnings. nameservreply.c: Fixed group fade out code. Jeremy (jallison@whistle.com) (This used to be commit a2dd5c5a551547e83c707e63c0696c7724035501)
1997-07-28client.c: Added amanda fixes.Samba Release Account1-7/+9
clitar.c: Added amanda fixes. nameannounce.c: Removed redundent code. nameelect.c: Removed redundent code. nameserv.h: Removed redundent code. nameservresp.c: Removed redundent code. namework.c: Removed redundent code. password.c: Prevented crash if getpwnam fails. Jeremy (jallison@whistle.com) (This used to be commit 760fe30353de66e8e6571f8ff4ec1064261b5428)
1997-07-22charset.c: Fixed signed/unsigned issues.Samba Release Account1-0/+14
password.c: Fixed problem with MS-Exchange services. Jeremy (jallison@whistle.com) (This used to be commit e723dd3deec00a91568c5aa546374409ce7ba379)
1997-07-17Makefile: Added krb5 option from Nathan Neulinger <nneul@umr.edu>Samba Release Account1-1/+86
includes.h: Added krb5 option from Nathan Neulinger <nneul@umr.edu>, added SGI5 fix. password.c: Added krb5 option from Nathan Neulinger <nneul@umr.edu> quotas.c: Added inode quote fix. reply.c: removed redundent code. server.c: Changed error debug to 0, removed redundent check. util.c: Added close_low_fd() to become_daemon - fix for rsh from Johnathan Knight. Jeremy (jallison@whistle.com) (This used to be commit 256afb764828b0a6dad5529d62501bc9ea2807ee)
1997-07-03Fixes for UnixWare 2.x with shadow passwords fromSamba Release Account1-0/+9
Warren Young <tkennedy@cyberport.com>. (This used to be commit 885b42b44752249c85bb924c9ceefa5b710225da)
1997-06-18Fixed *really* stupid bug in register_vuid - only a problemSamba Release Account1-1/+1
on multi-user NT systems. Jeremy (jallison@whistle.com) (This used to be commit 6ca5c8ca3294cde56e28558bcb02c144225903d8)
1997-05-08'The mother of all checkins' :-). Jeremy Allison (jallison@whistle.com)Samba Release Account1-1/+1
Wed May 7 1997: Update for 1.9.17alpha1 release - 'browsefix release' designed to make browsing across subnets work. byteorder.h: Updated copyright to 1997. charcnv.c: Updated copyright to 1997. charset.c Updated copyright to 1997. charset.h Updated copyright to 1997. client.c Updated copyright to 1997. clientutil.c Updated copyright to 1997. dir.c Updated copyright to 1997. fault.c Updated copyright to 1997. includes.h Updated copyright to 1997. interface.c Updated copyright to 1997. ipc.c Updated copyright to 1997. kanji.c Updated copyright to 1997. kanji.h Updated copyright to 1997. loadparm.c Updated copyright to 1997. locking.c Updated copyright to 1997. mangle.c Updated copyright to 1997. message.c Updated copyright to 1997. nameannounce.c Made use of WINS subnet explicit. Added reset_announce_timer() so announcement can be made immediately when we become a master. Expanded code to do sync with dmb. namebrowse.c Removed redundent checks for AM_MASTER in sync code. Made use of WINS subnet explicit. namedbname.c Made use of WINS subnet explicit. namedbresp.c Made use of WINS subnet explicit. namedbserver.c Made use of WINS subnet explicit. namedbsubnet.c Explicitly add workgroup to WINS subnet when we become a dmb. Made use of WINS subnet explicit. namedbwork.c Made use of WINS subnet explicit. Removed redundent check_work_servertype() function. nameelect.c Explicitly add workgroup to WINS subnet when we become a master browser. Made use of WINS subnet explicit. namelogon.c Updated copyright to 1997. namepacket.c Updated copyright to 1997. namequery.c Updated copyright to 1997. nameresp.c Made use of WINS subnet explicit. Made nmbd fail if configured as master browser and one exists already. nameserv.c Made use of WINS subnet explicit. Remove redundent logon server and domain master code. nameserv.h Add emumerate subnet macros. nameservreply.c Made use of WINS subnet explicit. nameservresp.c Updated copyright to 1997. namework.c Made use of WINS subnet explicit. Updated code to add sync browser entries to add subnet parameter. nmbd.c Added sanity check for misconfigured nmbd. nmblib.c Updated copyright to 1997. nmblookup.c Updated copyright to 1997. nmbsync.c Removed redundent AM_ANY_MASTER check. params.c Updated copyright to 1997. password.c Updated copyright to 1997. pipes.c Updated copyright to 1997. predict.c Updated copyright to 1997. printing.c Updated copyright to 1997. proto.h Changed protos for new nmbd code. quotas.c Updated copyright to 1997. replace.c Updated copyright to 1997. reply.c Updated copyright to 1997. server.c Updated copyright to 1997. shmem.c Updated copyright to 1997. smb.h Updated copyright to 1997. smbencrypt.c Updated copyright to 1997. smbpasswd.c Updated copyright to 1997. smbrun.c Updated copyright to 1997. status.c Updated copyright to 1997. system.c Updated copyright to 1997. testparm.c Updated copyright to 1997. testprns.c Updated copyright to 1997. time.c Updated copyright to 1997. trans2.c Updated copyright to 1997. trans2.h Updated copyright to 1997. uid.c Updated copyright to 1997. username.c Updated copyright to 1997. util.c Updated copyright to 1997. version.h Changed to 1.9.17alpha1. (This used to be commit cf23a155a1315f50d488794a2caf88402bf3e3e6)
1997-05-07added automount home directory support. contributed by simeon@bangor.co.ukSamba Release Account1-0/+55
and a mini bug-fix by rob.nacarrato@sheridanc.on.ca reads in an entry from the auto.home file for the user when they log in, and mounts their home directory as the default path for the [homes] service. i might add this as to the %substitution system, so that you can specify subdirectories for the user profiles, mainly. lkcl (This used to be commit 0bb6acc358243c49e19de9d5cc95f5124ac11b7c)
1997-02-04JHT ===> Fixed potential PAM Security hole and second chance syndromeSamba Release Account1-0/+9
spurious warning message "Warning - no crypt available" (This used to be commit dc559428b85474ff4d80f37f421365a3910a8861)
1997-01-02JHT ==> Added extensions for PAM (Pluggable Authentication Module) supportSamba Release Account1-0/+102
for Linux and other little beasties that use PAM. Source: ftp.redhat.com/pub/Incoming/samba-1.9.16p9.src.rpm Originally from RedHat modifications to samba-1.9.15p8 (This used to be commit 79145bad569c71a7485b40a74e91eb93b52d6392)
1996-11-09Set num_validated_users to zero if Realloc fails.Samba Release Account1-0/+1
(This used to be commit 57121e609e927d16389793c7969f5fb944c7669d)
1996-10-25Core of the changes for returning smb_uid's. smb_uid's are nowSamba Release Account1-60/+57
returned as an index plus offset into the valudated_users table. The offset (100) is added so that an smb_uid of zero becomes an invalid value. All access into the validated_users table are done by removing the offset and indexing into the table. Out of ranges return NULL. Causes accesses into the validated_users table to be more consistant and controlled. This change made due to the fact that the uid field is only 16 bits in the smb header and we need for this not to be a unix user id (which can ge 32 bits). jra@cygnus.com (This used to be commit ac265eff85a043e139b259e400fbbc444a94c97c)
1996-10-05I have fixed quite a few important bugs in this commit.Andrew Tridgell1-7/+2
Luke, can you take special note of the bug fixes to nmbd so you can propogate them to your new code. - rewrote the code that used to use fromhost(). We now call gethostbyaddr() only if necessary and a maximum of once per connection. Calling gethostbyaddr() causes problems on some systems so avoiding it if possible is a good thing :-) - added the "fake oplocks" option. See the docs in smb.conf(5) and Speed.txt - fixed a serious bug in nmbd where it would try a DNS lookup on FIND_SELF queries. This caused a lot of unnecessary (and incorrect) DNS lookups to happen. FIND_SELF queries should only go to the internal name tables. - don't set FIND_SELF for name queries if we are a wins proxy, as we are supposed to be answering queries for other hosts. - fixed a bug in nmbd which had "if (search | FIND_LOCAL)" instead of "if (search & FIND_LOCAL)". Luke, this was in nameservreply.c - the above 3 bugs together meant that DNS queries were being cached, but the cache wasn't being used, so every query was going to DNS, no wonder nmbd has been chewing so much CPU time! Another side effect was that queries on names in lmhosts weren't being answered for bcast queries with "wins proxy" set. - ignore the maxxmit for seconday session setups (see CIFS spec) - close user opened files in a uLogoffX for user level security (see CIFS spec) - added uid into the files struct to support the above change (This used to be commit ea472b7217b7693627a13a7b1e428a0a6a3d8755)
1996-10-02- accept either NT or lanman passwords in tconXAndrew Tridgell1-10/+9
(This used to be commit b6c1c60d72e1625ca172b8f8eb07078413611468)
1996-08-22- add timeouts to connect() for password server connections. ThisAndrew Tridgell1-1/+1
makes multiple password servers practical. (This used to be commit 5c3e8326cc45d3cbd076475e445ce461a2bf7560)
1996-06-10a cleanup of the receive_smb() usage, adding timeouts in some placesAndrew Tridgell1-2/+3
also added paranoid code in the main process() loop of smbd to detect when smbd is looping uselessly. This should stop the "smbd is chewing lots of cpu" reports (This used to be commit 8e9dce34d50d673cb50531f0c4c7672ce2522cef)
1996-06-10got rid of a lot of redundent header files as we now globally generateAndrew Tridgell1-1/+0
prototypes automatically using "make proto". This is much less prone to error than the old method of manually adding prototypes (This used to be commit b551dc98f7cc194a5fc2e67a4ebae7fd67a01bbc)
1996-06-06- added interface.c and removed all the references to myip, bcast_ipAndrew Tridgell1-3/+1
and Netmask, instead replacing them with calls to routines in interface.c - got rid of old MAXINT define - added code to ensure we only return one entry for each name in the ipc enum routines - added new_only option to add_netbios_entry() to prevent overwriting of important names - minor time handling fixup (This used to be commit 7ed71b73ae745da099072eee36fc2700d1d91407)
1996-06-04a huge pile of changes :-)Andrew Tridgell1-1/+1
The biggest thing is the integration of Lukes new nmbd. Its still largely untested, so we will really need some feedback I've also added auto prototype generation and cleaned up a lot of minor things as a result (This used to be commit 0d8dcfa13c527ec2c8aca39ba49c09e4e694b26c)
1996-05-31Lots of changes!Andrew Tridgell1-4/+2
- add faq info on NT printer handling - add "delete readonly" option to help rcs users - add stuff to man pages on new printer options - add "proxy name resolution" option - add "command string" -c option to smbclient (thanks Ken) - split time functions into time.c - rearrange the quotas stuff a bit and fix some bugs - complete rehash of the time handling code thanks to Paul Eggert - fix nmblookup output a bit - add plp print queue parsing from Bertrand Wallrich (This used to be commit 635b56f19c817527c52e9bbde31faa6a8a47777b)
1996-05-29cleanups to make thinsg compile cleanlyAndrew Tridgell1-7/+10
(This used to be commit 39fbeb04ae938594c380d97ebe67c012fa0dd51a)
1996-05-05turn on KEEP_PASSWORD_SERVER_OPEN by defaultAndrew Tridgell1-2/+2
(This used to be commit d2676cdd0b44fc4fc825118e510bac2c3f1e40d9)
1996-05-04fix a netgroup bug (innetgr() was being called with the args in theAndrew Tridgell1-2/+1
wrong order!) (This used to be commit 4419093d336bad30b194b959231fed04cbc8a1cf)
1996-05-04Initial version imported to CVS Samba Release Account1-0/+1416
(This used to be commit 291551d80711daab7b7581720bcd9a08d6096517)