summaryrefslogtreecommitdiff
path: root/source/smbd
Commit message (Collapse)AuthorAgeFilesLines
* interesting. had to add code to stop cascade's SMBtconX encrypted passwordLuke Leighton2000-03-061-3/+11
| | | | | from being used, i have a) no idea if it's valid b) no idea how to decode it!
* removed code that used to set trust acct passwd from smbd.Luke Leighton2000-02-191-24/+0
|
* - removed smbpassd "remote" commands relating to trust accounts, addedLuke Leighton2000-02-181-40/+13
| | | | | | | | | | | | references to use samedit instead. - removed global_machine_password_needs_changing and all code that uses this: replaced with lsa_query_secret ( pol, NULL, &last_updated_time). probably better off having this code in lsarpcd, not smbd. hmm... - fixing up _samr_lookup_names to the new sam tdb format, lots more work needed here.
* Merge from HEAD branch of missing calls to dos_do_unix() in VFSTim Potter2000-02-176-19/+26
| | | | functions.
* patch from michael breuer <mbreuer@siac.com> to fix compile-problems forLuke Leighton2000-02-174-17/+21
| | | | | the compiler he was using (thank you!). michael, i didn't include the packaging/ because i haven't got that subdir checked out.
* this weird-looking code uses the user_struct* that was obtained fromLuke Leighton2000-02-081-35/+61
| | | | | | | | | | | | | | | | | | | | an SMBsesssetupX to provide a response to api_WkstaUserLogon and api_NetUserGetInfo. IF my suspicions are correct, an api_NetUserGetInfo or api_WkstaUserLogon against an anonymous IPC$ connection will produce a failure, resulting in the Win9x client DROPPING the anonymous connection and re-establishing an authenticated SMBsesssetupX. this will cause the smbd server to get a NET_USER_INFO_3 structure from either the PDC or from itself (MSRPC remote or MSRPC loop-back, doesn't matter which, it's all the same to domain_client_validate()), thence the api_Net... or api_Wksta... call to follow will be provided with the correct user logon info. it also means that we can start filling in some of the "stub" fields, such as last_logon_time, with _real_ info. well, real, if netlogond bothered to fill it in, but you get the idea :)
* 1) made standard_sub_vuser take a const user_struct* instead of a constLuke Leighton2000-02-085-21/+3
| | | | | | | | vuser_key*. this stops stupid-amounts of linking to all sorts of crap in programs like make_codepage and testprns, which know _nothing_ of users. the original link was just a temporary hack to get binaries. 2) make vuid_free_user_struct() free the vuser malloc'd structure, too.
* first stage of making some sort of "thread" context ... er, thing :) inLuke Leighton2000-02-082-3/+9
| | | | | | | | | | | | | | the msrpc code. it's not really threads, it's just a thread context, so that if different thread-contexts are requested, then the msrpc daemon will at least be able to switch user-security-context. eventually, i will have to go so far as to be able to reconstruct PDUs depending on the user context, but that will require one socket per thread-context, and some means to set that up *inside* the Bind/Bind-Request processing code [argh!], because that's what triggers a "new" user-context, really. i hope.
* Port of rebind argument to lib/util_sock:open_socket_in() function.Tim Potter2000-02-082-2/+2
|
* HOORAY! password setting is back. this through fixing policy handleLuke Leighton2000-02-081-1/+0
| | | | | | | | | | | chain linking _and_ an odd bug where password_ok() was ZERO_STRUCTING the NET_USER_INFO_3 structure and it was being stored in the vuser.tdb table, blanking out the NT user info! i added code to authorise_login() to get and then store the vuser info after seeing it set vuser->guest = True. i'm not sure i like that code...
* missed one vuid to user_key conversion.Luke Leighton2000-02-071-1/+6
|
* Added *.lo to .cvsignore file.Tim Potter2000-02-071-0/+1
|
* new loop-back authentication mechanism.Luke Leighton2000-02-061-1/+8
|
* this is probably one of THE most reluctant commits i've ever made.Luke Leighton2000-02-068-193/+327
| | | | | | | | | | | | | | | it's far-reaching, and necessary. this adds a vuser_struct tdb database, with a key [smbd's pid, vuid]. smbd uses it in every instance of standard_sub() and standard_sub_vuser(). that's almost every single SMB call for any IPC$ access. the next stage is to remove sesssetup_user, probably sessetup_user_list too, and review all occurences of standard_sub_basic used by smbd because if they use standard_sub_basic() they might be expecting to read sesssetup_user, and if they do _that_, they should be using standard_sub_vuser() instead. all i wanted was a means to get vuids across to msrpc daemons.
* netlogontdbd now links. i had to disable net_login_general() fromLuke Leighton2000-02-051-107/+0
| | | | | | | using "update encrypted" because the method used (update_smbpasswordfile) is, as you can see, specific to the smbpasswd file! i need to create a "create SAM user" function for this to be done properly.
* completes the patch to create and use standard_sub_vuser(). in someLuke Leighton2000-02-042-2/+3
| | | | | instances i have added UID_FIELD_INVALID so that standard_sub_vuser defaults to the same functionality and standard_sub_basic().
* creating vuser-specific substitution function standard_sub_vuser().Luke Leighton2000-02-042-40/+44
|
* ok, this _is_ as big as it looks, conceptually, and i haven't evenLuke Leighton2000-02-046-200/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | done what i wanted to: this is only preparation!!!! i started off in smbd/lanman.c, and noticed that api_NetUserGetInfo takes all its info from user_struct *vuser. i thought, that's odd, that doesn't look right. then i realised that the info there is exactly what is contained in the NET_USER_INFO_3 structure: the return result from an NT Domain User Logon. various lights went on, and i realised that when an SMBsesssetupX is carried out, internally, NT must do an NT Domain User Logon with the SMB user's challenge/response password, and then store the return result associated with the SMB session. in this way, when an api_NetUserGetInfo call comes in, the CORRECT info can be returned, not some faked-up information. anyway, this commit is all the consequences of putting NET_USER_INFO_3 into user_struct, which feeds up through _several_ layers of function calls. i sort-of understood that i needed to do this, but not quite. the upshot of this is that user_struct now contains the REAL nt domain username (in NET_USER_INFO_3) so the confusion between nt user names and unix usernames now can be removed from samba code. if you want a unix user name, you use vuser->unix_name. if you want an NT user name, you use (UNISTR2*)vuser->usr.uni_user_name. p.s it's in UNICODE :) p.p.s if you want the RID of the user, it's vuser->usr.user_rid. p.p.p.s there's over 25 NT-specific other bits of info in NET_USER_INFO_3 too!
* patch from Elrond to include/exclude nterr.h as needed.Luke Leighton2000-01-302-0/+3
|
* - new lookup_sam_names had a useless parameter, removed.Luke Leighton2000-01-261-2/+2
| | | | | | | | | - Used it in rpcclient's "lookupnames" - Added lookup_sam_domainname(), which looks up the SID for a domain in SAM. - Used it to add "[-d <domain>]" to samlookupnames Elrond
* removed expand_one() unused function.Luke Leighton2000-01-251-18/+0
|
* significant number of password-change related "const" issues. namesLuke Leighton2000-01-251-12/+30
| | | | | | | | | getting overwritten, password buffers getting decoded, all of which is not acceptable: rule of least surprises, you don't just change the case of a username inside chgpasswd(), or do a Get_Pwnam(xxx, True) inside chat_with_program() which modifies the user name! you can tell i'm on samr_chgpasswd_user() in the samr api conversion, neh?
* substitution issues, didn't get anywhere.Luke Leighton2000-01-251-0/+1
|
* close all MSRPC connections during smbd idle time, otherwise it willLuke Leighton2000-01-221-0/+3
| | | | | | create and maintain loads of msrpc daemons! i've seen 10 msrpc daemons created and held by _one_ NT login, which is definitely too much.
* a fairly drastic code commit to add "process id" as an extra identificationLuke Leighton2000-01-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | method in the NETLOGON credential database. dammit, this is so wide-reaching, it had to percolate _right_ up through msrpc_use_add() and into the pipes setup, through the msrpc loop-back setup. grr! the idea is that an individual process (smbd, for example) can do NETLOGON logins independently of another smbd process, without there being any conflicts in the NETLOGON credential database. the creds database key is now <(uint32)pid_t><workstation_name>\0<domain_name>\0. previously, it was just wksta/domain, and of course if two smbd processes did simultaneous NETLOGON logins, one of them overwrote the other's credentials because the database key was the same! oops! *obscure*. BTW I STILL HAVEN'T COMMITTED THIS TO CVS MAIN, SO CVS MAIN / SAMBA_TNG WON'T WORK UNTIL I DO AN UPDATE!
* moved some functions only used by smbd/filename.c into filename.cLuke Leighton2000-01-201-0/+184
|
* this commit is NOT as large as it looks. sed is a wonderful thing.Luke Leighton2000-01-201-1/+0
| | | | | | | | | | | | | | | | 1) got fed up of calling init_policy_hnd(MAX_HANDLES), so tried to put policy handles behind bars. i failed, so went for an interim fix: all policy handle functions now take the return result from get_global_policy_hnd() as the first argument. 2) this is horrible. i can't believe microsoft would do this. they cache the NETLOGON credentials. you can tear down the SMB connection and reopen it and still validate a user. this is horrible for two reasons. a) it opens up the possibility of DOS attacks against the NETLOGON service b) old versions of samba (2.0.x) now have a problem, as they store the credential chain, which will disappear if the SMB connection is torn down.
* all sorts of weird stuff found by attempting to track down passwordLuke Leighton2000-01-172-14/+18
| | | | | | | | changing. also, debugging from yesterday's attempts to get rid of this: char *data = prs_data(&ps); prs_uint16(ps, ...); /* causes a realloc */ *data = something; /* accessing realloc'd memory */
* some patches from Elrond@Wunder-Nett.org. Some short notes:Luke Leighton2000-01-171-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefile.in: I got smbd >100k smaller, by just linking the needed rpc-code. netlogond.c: I also found the off-by-one, which Andrew found, so I removed that from my diff. smbd/service.c: I found the malloc(0) and got the code smaller lib/util_pwdb.c and rpc_server/srv_lookup.c: Functions in there did fill some sid_name_use without even being sure, that they will realy provide such a type of reply. rpc_server/srv_lookup.c: I made a whole lot of functions static and had to move some functions around for that rpc_server/srv_samr.c: sid_equal() shouldn't be called with a sid, that was returned by a failing function. (clean-up) SamrLookupRids didn't return any errors. (Also I don't know, whether this is the correct behaviour, I just looked at SamrLookupNames) rpcclient/cmd_lsarpc.c: Made lookupnames/sids show the sid_name_use (type). Elrond
* - disable port 445 in server, again, until i have time to work it outLuke Leighton2000-01-141-1/+4
| | | | | | | - credential database was being opened O_CREATE | O_TRUNC, so each time netlogond was run, it was trashed. oops. - more schannel debugging.
* [mixed commit. sorry!]Luke Leighton2000-01-141-6/+8
| | | | | | 1) sorting out NETLOGON schannel (debug fest) 2) patches from Long.
* possible bug to do with joining domains. supposed to return ERROR(0, status)Luke Leighton2000-01-141-1/+1
| | | | not status. *dur*.
* whee! got usrmgr working again. this was the "SMBtrans" long PDULuke Leighton2000-01-122-10/+16
| | | | | | | issue. NT expects the STATUS_BUFFER_OVERFLOW info-warning to be set, which i wasn't aware of, i just copied what NT did (for previous versions), without realising that the damn NT msrpc-smb code actually _relied_ on this status-warning!
* client_name() and client_addr() don't work on the other side of anLuke Leighton2000-01-125-16/+10
| | | | | | | | | | | msrpc unix socket as intended! have to move them about a bit. also had to set up local_machine and remote_machine properly. the whole standard_sub_basic() issue is... well, a bit of a mess, when it comes to doing the right thing, predictably. and that's _before_ the SAMBA_TNG daemon split.
* added client-side dce/rpc authentication API.Luke Leighton2000-01-081-3/+5
|
* elrond spotted that S-0-0 was being referred to in lsalookupsids S-0-0-1400Luke Leighton2000-01-061-6/+0
| | | | turns out that global_member_sid wasn't being initialised properly.
* more reshuffling, removed that damn user_sess_key, use a vuid instead :)Luke Leighton2000-01-061-52/+3
|
* more become_somefn() code splitting.Luke Leighton2000-01-061-81/+49
|
* compilation errors introduced by last couple of commits. *tired*.Luke Leighton2000-01-052-2/+2
|
* trying to split become_user(), become_vuser(), become_root(), become_guest()Luke Leighton2000-01-031-374/+5
| | | | into appropriate modules. hmmm....
* decided to add tridge's tdb code into SAMBA_TNG. i may (will) need it inLuke Leighton2000-01-037-201/+76
| | | | that branch.
* minor modifications / cleanups. moved loop-back dce/rpc socket intoLuke Leighton2000-01-031-2/+1
| | | | $(LOCKDIR)/.msrpc.
* added usage / compilation instructions. removed policy handle initialisationLuke Leighton2000-01-031-4/+0
| | | | from smbd, because... WE DON'T NEED IT! yippee!
* wow. apart from what looks like an (unrelated) off-by-one bug in theLuke Leighton2000-01-031-11/+7
| | | | | | | | | | | | calculation of a PDU, removing dce/rpc fragment reassembly from smbd actually worked! all that's happening is an SMBread does a read on the socket; SMBwrite does a write on the socket; SMBtrans does a write _and_ a read. the rest is handled by the msrpc daemon, on the other side of the socket. which of course, has this stupid off-by-one bug: i _just_ happened to get a list of shares with exactly the right length to cause the problem.
* amazing. incredible. cut msrpc _right_ out the loop from smbd.Luke Leighton2000-01-031-13/+11
| | | | | | | | | | | found two bugs: 1) msrpc sending (on unix socket) was waiting on a read select *dur* so added some write select code instead. 2) the second msrpc request to the same pipe fails. this is probably due to some stupid file offset stuff in smbd/ipc.c, i am going to track this down, now.
* more delineation between smbd and msrpc. thinking of attemptingLuke Leighton2000-01-031-1/+1
| | | | | to remove all msrpc-specific stuff from smbd, just to see what happens.
* attempting to delineate smbd / msrpc more.Luke Leighton2000-01-031-5/+1
|
* removed dependency of smbd on the smb password database api.Luke Leighton2000-01-035-270/+275
| | | | | | | | | the _only_ function smbd calls is pass_check(), and for some _weird_ reason, that is in the passdb/ directory. nasty debugging of an rpcclient incident. the "usr_creds" need to be told what they are dealing with (ptr_ntc = 1, for NT creds to be used). i forgot. wasted an hour.
* ok. the smb-fileserver-only saga continues.Luke Leighton2000-01-022-45/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | noticed that there is an "update encrypted" option, and assumed that this was a "migrate passwords" option. on this basis, i didn't want "encrypt passwords = no", "security = user/share" "update encrypted = no" to be dependent on dce/rpc NETLOGON services, but i ALSO didn't want "update encrypted = yes" to have to write to the smbp passwd interface, i'm trying very hard to get rid of that. so, under the circumstances where "update enc = yes", but "enc pwd = no", i decided to add a "General" Logon type info level (4) to NetrSamLogon, client and server side. this passes a CLEARTEXT password across the \PIPE\NETLOGON on loop-back (which still requires a trust account pasword, which i MAY change to use to encrypt the cleartext password anyway). i have no idea what a _real_ general Logon type actually looks like, and i couldn't care less at this stage because it's used on loop-back. whe "update enc = yes" and "enc pwd = no", nt clients are told to send cleartext passwords. these are sent over a General Logon on loop-back; the netlogon daemon receives them, does a *unix* password check, and *also* does an update encrypted password. this is a reasonable compromise. if you're not intending to migrate to smb passwords, you don't need to run "update encrypted". all it means is that you would have to run the netlogon daemon a little bit earlier. normally, you would have to start the netlogon daemon when switching to "enc pwd = yes", but instead you have tostart it on "update end = yes". big deal :) the only thing that bothers me is that i thought "update encrypted" was actually "migrate passwords", so unless the smbpasswd entry is already in there, the general login fails because there is still a requirement to have an smbpasswd entry in netlogon daemon. doesn't matter at the moment. next stage, password changing. replace all password changes in smbd/lanman.c and anywhere else i can find them with samr_change_user_passwd instead.
* clearing up - final removal of all "smb auth" code from smbd... and,Luke Leighton2000-01-022-62/+28
| | | | as it turns out, from uselessly linking with other dce/rpc daemons, too.