summaryrefslogtreecommitdiffstats
path: root/source/smbd/pipes.c
Commit message (Collapse)AuthorAgeFilesLines
* make sure we don't walk past the end of the current SMB buffer whenAndrew Tridgell2002-04-161-1/+1
| | | | | pulling a string this might explain a serious filename corruption bug that Quantum QA spotted
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* This is the current patch from Luke Leighton <lckl@samba-tng.org> to add aAndrew Bartlett2002-01-201-7/+9
| | | | | | | | | | | | | | | | | | degree of seperation betwen reading/writing the raw NamedPipe SMB packets and the matching operations inside smbd's RPC components. This patch is designed for no change in behaviour, and my tests hold that to be true. This patch does however allow for the future loadable modules interface to specify function pointers in replacement of the fixed state. The pipes_struct has been split into two peices, with smb_np_struct taking the information that should be generic to where the data ends up. Some other minor changes are made: we get another small helper function in util_sock.c and some of the original code has better failure debugs and variable use. (As per on-list comments). Andrew Bartlett
* Return NT_STATUS_OBJECT_NOT_FOUND or ERRbadpipe if pipe name not found.Jeremy Allison2001-12-181-1/+1
| | | | Jeremy.
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-2/+0
|
* converted smbd to use NTSTATUS by defaultAndrew Tridgell2001-08-271-8/+8
| | | | | | | | | | | | | | | | major changes include: - added NSTATUS type - added automatic mapping between dos and nt error codes - changed all ERROR() calls to ERROR_DOS() and many to ERROR_NT() these calls auto-translate to the client error code system - got rid of the cached error code and the writebmpx code We eventually will need to also: - get rid of BOOL, so we don't lose error info - replace all ERROR_DOS() calls with ERROR_NT() calls but that is too much for one night
* allow to use usrmgr/svrmgr tools in win95Jean-François Micouleau2001-07-041-5/+7
| | | | pretty cool
* a missing string conversion.Jean-François Micouleau2001-04-181-1/+1
| | | | J.F.
* Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison2001-03-111-3/+0
| | | | | | RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy.
* Fixing get/set of security descriptors.Jeremy Allison2000-06-071-0/+2
| | | | | | Removed ugly hack for NT printing. Fixed up tdb parse stuff memory leaks. Jeremy.
* more merging voodooAndrew Tridgell2000-05-101-0/+3
| | | | | | this adds "#define OLD_NTDOMAIN 1" in lots of places. Don't panic - this isn't permanent, it should go after another few merge steps have been done
* moved trans2.h and nterr.h into includes.h with all our other includesAndrew Tridgell2000-04-251-1/+0
|
* Fix stupid logic bug in detecting start-of-pdu in writeX on pipe.Jeremy Allison2000-03-111-1/+2
| | | | | Found by JF. Jeremy.
* Big update moving the multi-pdu support from 2.0.x into HEAD for JFJeremy Allison2000-03-091-22/+25
| | | | | | | | | | | | and the printer functions. Also tidied up some header includes and got the order right so you can now do a : make proto make clean make Jeremy.
* simple mods to add msrpc pipe redirection. default behaviour: fall backLuke Leighton2000-01-031-2/+18
| | | | to using internal msrpc code in smbd.
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-32/+32
|
* - added DCE/RPC "fault" PDU support.Luke Leighton1999-11-151-0/+41
| | | | | | | | | - disabled (AGAIN) the GETDC "if (MAILSLOT\NTLOGON)" code that will get NT5rc2 to work but WILL break win95 (AGAIN). this needs _not_ to be re-enabled but to be replaced with a better mechanism. - added SMBwrite support (note: SMBwriteX already existed) as NT5rc2 is sending DCE/RPC over SMBwrite not SMBwriteX.
* unused variable in pipe_smb_write_XLuke Leighton1998-10-141-1/+0
|
* dce/rpcLuke Leighton1998-10-091-1/+1
|
* - fixed a bunch of warnings and minor errorsAndrew Tridgell1998-10-081-1/+0
| | | | | | - got smbtorture to compile - removed %D from some of lukes code - Luke, what is %D? it ain't portable anyway
* dce/rpcLuke Leighton1998-10-071-1/+1
|
* dce/rpcLuke Leighton1998-10-071-1/+46
|
* configure configure.in: Added tests for fseek64 and ftell64.Jeremy Allison1998-09-171-3/+0
| | | | | | | | | | | | | | | | | | | | | | | config.h.in: Added fseek64 and ftell64. includes.h: Added definition of SMB_BIG_INTEGER. smb.h: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. access.c: Tidyup of dbug statement. system.c: Added sys_fseek and sys_ftell. Changed mode calls to use mode_t. asyncdns.c: Tidyup of comment. loadparm.c: Tidyup of set_default_server_announce_type() function definition. ldap.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. nispass.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. smbpass.c: Changed (*getsmbpwpos) and (*setsmbpwpos) to use SMB_BIG_INTEGER. smbpassfile.c: Use sys_fseek(). chgpasswd.c: Tidyup of debug statement. dosmode.c: Changed mode calls to use mode_t. ipc.c: Removal of dead code. nttrans.c: Changed mode calls to use mode_t. open.c: Changed mode calls to use mode_t. pipes.c: Removal of dead code. reply.c: Removal of dead code. trans2.c: Removal of dead code. Changed mode calls to use mode_t. Jeremy.
* check that a valid pipe is passed before doing a pipe close.Andrew Tridgell1998-09-011-0/+4
| | | | | | | | | | | I made this change after getting a segv in reply_pipe_close(). The funny thing was that pipes_open was 1 and Pipes was NULL. That "can't happen" and suggests that we have a wild pointer somewhere. I suspect the rpc code, as I was playing with long share names (a share called "averylongusername") at the time and the logs show lots of srvsvc operations. I bet there is a buffer in the rpc code somewhere that is overflowing and trashing bits of the data segment.
* much cleaner chain pointer handling for both files and pipes.Andrew Tridgell1998-08-171-2/+0
| | | | | | the chain pointer is now stored as a static and is set whenever a handle is created or extracted. This also makes the code less error prone.
* some cleanups from the conversion of Pipes[] to a linked list. I alsoAndrew Tridgell1998-08-171-100/+82
| | | | | | | | removed most cases where a pnum is used and substituted a pipes_struct*. in files.c I added a offset of 0x1000 to all file handles on the wire. This makes it much less likely that bad parsing will give us the wrong field.
* this checkin gets rid of the global Files[] array and makes it localAndrew Tridgell1998-08-151-9/+4
| | | | | | | in files.c it should now be faily easy to expand the default MAX_OPEN_FILES to many thousands.
* this is the bug change to using connection_struct* instead of cnum.Andrew Tridgell1998-08-141-12/+8
| | | | | | | | Connections[] is now a local array in server.c I might have broken something with this change. In particular the oplock code is suspect and some .dll files aren't being oplocked when I expected them to be. I'll look at it after I've got some sleep.
* As per a Andrew's message, I went through and removed the timestring()Christopher R. Hertel1998-07-311-3/+2
| | | | | | | | | timestamps from several DEBUG messages. The timestamps are redundant now that DEBUG() provides them automatically. There are still a few more files to do, but I've got to get home for dinner. Chris -)-----
* Makefile: Added nttrans.oJeremy Allison1998-07-161-1/+1
| | | | | | | | | includes.h: Added termios.h for AIX. nttrans.c: Working NT SMB calls ! pipes.c: Use strequal instead of strcmp. server.c: Use #defines rather than numbers. smb.h: Updated NT SMB #defines. Jeremy.
* This looks like a big change but really isn't.Jeremy Allison1998-04-251-1/+0
| | | | | | | | | | | 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.
* "For I have laboured mightily on Luke's code, and hath brokenJeremy Allison1998-03-111-188/+54
| | | | | | | | | | | | | | | | | | | | | | | | all I saw" - the book of Jeremy, chapter 1 :-). So here is the mega-merge of the NTDOM branch server code. It doesn't include the new client side pieces, we'll look at that later. This should give the same functionality, server wise, as the NTDOM branch does, only merged into the main branch. Any fixes to domain controler functionality should be added to the main branch, not the NTDOM branch. This code compiles without warnings on gcc2.8, but will need further testing before we are sure all the working functionality of the NTDOM server branch has been correctly carried over. I hereby declare the server side of the NTDOM branch dead (and all who sail in her :-). Jeremy.
* This is *not* a big change (although it looks like one).Jeremy Allison1998-01-221-3/+3
| | | | | | | This is merely updating the Copyright statements from 1997 to 1998. It's a once a year thing :-). NO OTHER CHANGES WERE MADE. Jeremy.
* following a cvs error, i am rewriting this monster-commit. with bad grace.Luke Leighton1997-11-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* storing pipe name state (from set named pipe handle state call) in theLuke Leighton1997-10-301-9/+6
| | | | pipes array.
* Makefile:Luke Leighton1997-10-301-77/+3
| | | | | | | | | | | | simply adding pipes.o to SMBDOBJ3. rpc_pipes/pipe_hnd.c : created pipe handles module. pipes.c server.c : use of pipe_hnd functions in SMBopenX and SMBclose, on the IPC$ pipe.
* removed mechanism that created actual files NETLOGON, lsarpc and the like,Luke Leighton1997-10-301-71/+100
| | | | | | | | which are pipes on the IPC$ connection. created mechanism to record pipe names in a separate pipes_struct. it is planned to expand this, to return sensible things like interface structures, and policy handles (RPC_IFACE and LSA_POL_HND). and the like.
* byteorder.h :Luke Leighton1997-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | added mode for printing debug array data as chars not uint8/16/32s. only really useful for (uint8) strings or (uint16) unicode strings lsaparse.c smbparse.c smb.h : rpc bind and rpc bind ack structures and parsing and creation functions. ipc.c pipes.c pipenetlog.c pipentlsa.c pipesrvsvc.c : using rpc bind / bind ack parsing routines instead of incorrect use of api_LsarpcTNP1 function. ntclient.c : creation of do_rpc_bind() function. THAT'S IT, FOLKS!
* pipes.c pipesrvsvc.c :Luke Leighton1997-10-191-80/+0
| | | | | moved stub srvsvc pipe function into separate file, in preparation for further work.
* ipc.c: Adding Andrews become_root code to the main branch.Jeremy Allison1997-10-151-2/+2
| | | | | | | | | | | locking.c: Adding Andrews become_root code to the main branch. pipes.c: Fixing the close_file issue. proto.h: The usual. reply.c: Move smb_pass into NTDOMAIN defined code. Fixing the close_file issue. server.c: Fixing the close_file issue. trans2.c: Fixing the close_file issue. uid.c: Adding Andrews become_root code to the main branch. Jeremy (jallison@whistle.com)
* added srvsvc basic pipe, straight from paul's code. does NETSHAREENUMLuke Leighton1997-10-151-0/+82
| | | | and NETSERVERGETINFO.
* split pipes.c down into util, netlog and ntlsa.Luke Leighton1997-10-131-1135/+1
|
* debugging... no idea what i'm doing.Luke Leighton1997-10-131-9/+10
|
* debug info addedLuke Leighton1997-10-131-0/+4
|
* checked in a file with a compile error. oops!Luke Leighton1997-10-131-1/+0
|
* byteorder.h :Luke Leighton1997-10-131-292/+54
| | | | | | | | | | | | debugging output wasn't (still isn't) perfect. credentials.c lsaparse.c smbparse.c : added DEBUG strings. pipes.c : lost some changes, to do with setup of RPC headers. arg.
* getting somewhere.Luke Leighton1997-10-121-48/+61
| | | | | | | | | | ipc.c : removed srvsvc pipe reference: have to do that. pipes.c lsaparse.c smbparse.c : more debugging info. looks a bit like netmon output.
* updated rpc header reply: callid wrong; alloc hint a uint32 not a uint16.Luke Leighton1997-10-121-21/+15
| | | | still doesn't get rid of the netlogon trans2 request with zero data.
* ipc.c:Luke Leighton1997-10-121-36/+33
| | | | | | | | | | | | debugging info. found that data = NULL because of short packet length indicated from the ntlsaRPC pipe _royally_ stuffs NT's packet handling. maybe this should go down as a service denial bug to the ntbugtraq list. pipes.c lsaparse.c smbparse.c : added more debug stuff. added length of header to data_len in MSRPC fragment_length field (0x18 bytes short) which caused the above bug from NT 4.0. oops.
* added debugging macros (suitable eventually for use in tcpdump, hopefully)Luke Leighton1997-10-121-20/+25
|