summaryrefslogtreecommitdiffstats
path: root/source/smbd/ipc.c
Commit message (Collapse)AuthorAgeFilesLines
* configure configure.in: Added tests for fseek64 and ftell64.Jeremy Allison1998-09-171-16/+8
| | | | | | | | | | | | | | | | | | | | | | | 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.
* added 0x10 to the frag length in the "bind ack".Luke Leighton1998-09-071-1/+1
|
* tridge the destroyer returns!Andrew Tridgell1998-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | prompted by the interpret_security() dead code that Jean-Francois pointed out I added a make target "finddead" that finds potentially dead (ie. unused) code. It spat out 304 function names ... I went through these are deleted many of them, making others static (finddead also reports functions that are used only in the local file). in doing this I have almost certainly deleted some useful code. I may have even prevented compilation with some compile options. I apologise. I decided it was better to get rid of this code now and add back the one or two functions that are needed than to keep all this baggage. So, if I have done a bit too much "destroying" then let me know. Keep the swearing to a minimum :) One bit I didn't do is the ubibt code. Chris, can you look at that? Heaps of unused functions there. Can they be made static?
* changed the SMBtrans reply code to align at the same alignment asAndrew Tridgell1998-09-031-13/+8
| | | | | | | | | observed from NT. We were aligning the data before but not the parameters. This aligns both. This change may break some other parts of ipc.c if we have relied on the alignment somewhere, so if you think this broke something then let me know.
* More abstraction of file system data types, to move to a 64Jeremy Allison1998-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | bit file interface for the NT SMB's. Created a new define, SMB_STRUCT_STAT that currently is defined to be struct stat - this wil change to a user defined type containing 64 bit info when the correct wrappers are written for 64 bit stat(), fstat() and lstat() calls. Also changed all sys_xxxx() calls that were previously just wrappers to the same call prefixed by a dos_to_unix() call into dos_xxxx() calls. This makes it explicit when a pathname translation is being done, and when it is not. Now, all sys_xxx() calls are meant to be wrappers to mask OS differences, and not silently converting filenames on the fly. Jeremy.
* bounds check next_token() to prevent possible buffer overflowsAndrew Tridgell1998-08-311-13/+13
|
* Changed ASSERT macros to SMB_ASSERT macros as some systems alreadyJeremy Allison1998-08-241-1/+1
| | | | | have an ASSERT macro defined. Jeremy.
* added ASSERT() and ASSERT_ARRAY() macros and sprinkled them liberallyAndrew Tridgell1998-08-221-7/+1
| | | | in the rpc code.
* added new smb.conf option "panic action". see my samba-technicalAndrew Tridgell1998-08-211-3/+1
| | | | explanation.
* some cleanups from the conversion of Pipes[] to a linked list. I alsoAndrew Tridgell1998-08-171-1/+1
| | | | | | | | 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.
* - some tidying up in files.cAndrew Tridgell1998-08-161-7/+6
| | | | | | | | - handle null fsp in DEBUG() at end of reply_ntcreate_and_X(). Jeremy, can you fix this properly? - get snum right in print queue code in ipc.c (it was broken by my connections_struct changes).
* this checkin gets rid of the global Files[] array and makes it localAndrew Tridgell1998-08-151-89/+85
| | | | | | | in files.c it should now be faily easy to expand the default MAX_OPEN_FILES to many thousands.
* configure: Changes for extra headers.Jeremy Allison1998-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configure.in: Source for header changes. client/clitar.c: Fixed isXXX macros & debugs for gcc pedantic compile. include/config.h.in: Added MEMSET, BZERO, MEMORY, RPCSVC_YPCLNT, STRINGS headers. include/includes.h: Headers for the above. include/smb.h: Made SIGNAL_CAST POSIX by default void (*)(int). lib/access.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/charset.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/debug.c: Fixed signal functs. lib/kanji.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/smbrun.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/util.c: Fixed isXXX macros & debugs for gcc pedantic compile. libsmb/namequery.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem_sysv.c: Fixed error messages in sysV stuff. nmbd/asyncdns.c: Fixed signal functs. nmbd/nmbd.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/passdb.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/smbpassfile.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/chgpasswd.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/ipc.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/nttrans.c: Fixed fsp code path. smbd/password.c: fixed HAVE_YP_GET_DEFAULT_DOMAIN problem. smbd/printing.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/reply.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/server.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/trans2.c: Fixed core dump bug. smbd/uid.c: Fixed isXXX macros & debugs for gcc pedantic compile. Jeremy.
* this is the bug change to using connection_struct* instead of cnum.Andrew Tridgell1998-08-141-234/+226
| | | | | | | | 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.
* this gets smbd compiling and linking correctly with the new layout.Andrew Tridgell1998-08-091-12/+12
|
* merge from the autoconf2 branch to the main branchAndrew Tridgell1998-07-291-2/+2
|
* Fixed bug found by Richard Sharpe. After increasing files_struct size byJeremy Allison1998-07-221-1/+1
| | | | | | | | | MAX_OPEN_DIRECTORIES for nttrans I forgot to update the code that enumerates the array. Created new MAX_FNUMS in local.h, changed all code that iterates through the files_struct array to use this. (sorry Richard). Jeremy.
* Makefile: Added CC=gcc to DGUX on Intel. Comment from ross@filmworks.com.Jeremy Allison1998-07-161-9/+26
| | | | | | | | | | | | ipc.c: loadparm.c: printing.c: Added code from <Dirk.DeWachter@rug.ac.be> to implement print queue pausing. New parameters are "queuepause command" and "queueresume command". util.c: Added fix for mount options in autmount map. lib/rpc/include/rpc_misc.h: Removed duplicate pipe names for Jean-Francois. Jeremy.
* ipc.c: map_username is now a BOOL function.Jeremy Allison1998-06-121-2/+2
| | | | | | | | | | | reply.c: map_username is now a BOOL function. server.c: Added capability to do map_username on service names when looking for a home directory. That's what the original code would do. lib/rpc/server/srv_util.c: Changed domain_ to builtin_ for BUILTIN aliases. username.c: Work in progress on groupname map parameter. Jeremy
* De-coupled the mapping of a Windows to UNIX username from the Get_PwnamJeremy Allison1998-06-101-0/+26
| | | | | | | | | | | | username case conversion wrapper. It is now (very) explicit where we are mapping between an incoming Windows username, and when we are doing a UNIX password entry lookup, which may change the case of the given username. This makes things *much* clearer (IMHO:-) and will ease the adding of the 'groupname map' parameter, and the addition of the special 'jeremy' mode for Samba where unix users will not be needed. (We must think of a better name for it :-). Jeremy.
* client.c: Allowed client to proceed even if it gets error 234 (more dataJeremy Allison1998-06-041-6/+5
| | | | | | | available) when scanning server/workgroup/share lists. ipc.c: Removed redundent definition of ERROR_MORE_DATA (234) we already have ERRmoredata in smb.h Jeremy.
* ipc.c: Fix bug where we don't return the correct error code when clientJeremy Allison1998-06-031-9/+12
| | | | | | | | | | gives a too-small buffer for share info. Fix from Gil Kloepfer <gil@arlut.utexas.edu> smb.h: server.c: Fix for a nastly little security problem with multi-user Windows NT servers and Samba where the contents of the open-file cache can end up being served out to users who shouldn't have access. This is some *seriously* ugly code. Jeremy.
* chgpasswd.c: Added comments to #ifdefsJeremy Allison1998-05-141-2/+3
| | | | | | | | | | | | | | | | | | | | | ipc.c: Caused samba password changing not to be done if UNIX password changing requested and not successful. util.c: Added string_to_sid() and sid_to_string() functions. lib/rpc/client/cli_samr.c: lib/rpc/include/rpc_misc.h: lib/rpc/parse/parse_lsa.c: lib/rpc/parse/parse_misc.c: lib/rpc/parse/parse_net.c: lib/rpc/parse/parse_samr.c: lib/rpc/server/srv_lsa.c: lib/rpc/server/srv_lsa_hnd.c: lib/rpc/server/srv_netlog.c: lib/rpc/server/srv_samr.c: lib/rpc/server/srv_util.c: Changes so that instead of passing SIDs around as char *, they are converted to DOM_SID at the earliest opportunity, and passed around as that. Also added dynamic memory allocation of group sids. Preparing to auto-generate machine sid. Jeremy.
* This is a security audit change of the main source.Jeremy Allison1998-05-121-30/+30
| | | | | | | | | | | | | | | | | | 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.
* This should (hopefully :-) be the final fix for the %U %G substitutionJeremy Allison1998-05-071-5/+5
| | | | | | | problem.... smbpass.c: Removed Luke's dire warning - as some of the functions in here *need* to be called externally :-). Jeremy.
* created "passdb.c" which is an interface point to (at present) eitherLuke Leighton1998-05-071-6/+6
| | | | | | | | | smbpasswd or ldap passwd, at compile-time (-DUSE_LDAP). _none_ of the functions in ldap.c or smbpass.c should be called directly: only those in passdb.c should be used. -DUSE_LDAP is unlikely to compile at the moment.
* Fixes for the %U and %G problems people have reported.Jeremy Allison1998-05-061-5/+5
| | | | | | | | | | | | | | | | | | Essentially, multiple session_setup_and_X's may be done to an smbd. As there is only one global variable containing the requested connection name (sessionsetup_user), then any subsequent sessionsetups overwrite this name (causing %U and %G to get the wrong name). This is particularly common when an NT client does a null session setup to get a browse list after the user has connected, but before a share has been mounted. These changes store the requested_name in the vuid structure (so this only really works for user level and above security) and copies this name back into the global variable before the standard_sub call. Jeremy.
* genrand.c: SGI compile warning fix.Jeremy Allison1998-05-051-0/+1
| | | | | | | | | | | | | | ipc.c: Fix for duplicate printer names being long. loadparm.c: Set bNetWkstaUserLogon to false by default - new code in password.c protects us. nmbd_logonnames.c: nmbd_namequery.c: nmbd_namerelease.c: Debug messages fix. password.c: SGI compile warning fix, fix for tcon() with bNetWkstaUserLogon call. reply.c: SGI compile warning fix. server.c Debug messages fix. smbpass.c: Fix for incorrect pointer. 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.
* This looks like a big change but really isn't.Jeremy Allison1998-04-251-7/+7
| | | | | | | | | | | 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.
* put server-side long dce/rpc code in main branch.Luke Leighton1998-04-211-6/+6
|
* ipc.c: Fix for printer queue spinning with Win95.Jeremy Allison1998-04-151-1/+2
| | | | | | | | | 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.
* Changes to allow Samba to be compiled with -Wstrict-prototypesJeremy Allison1998-04-131-29/+29
| | | | | | with gcc. (Not a big change although it looks like it :-). Jeremy.
* includes.h: Moved HPUX undefine of SEMMSL to where it actually does something.Jeremy Allison1998-04-101-0/+3
| | | | | | | | | | | | | | | ipc.c: Added Luke's debug statement. locking_slow.c: Added FTRUNCATE_NEEDS_ROOT code for broken systems that need it (not sure what these are yet). membuffer.c ntdomain.h proto.h lib/rpc/include/rpc_dce.h lib/rpc/include/rpc_srvsvc.h lib/rpc/parse/parse_prs.c lib/rpc/parse/parse_rpc.c lib/rpc/server/srv_pipe_hnd.c lib/rpc/server/srv_util.c: Re-merge of Luke's NTDOM changes 'cos he's a lazy git with carpel tunnel syndrome :-). Jeremy.
* Fix to stop Windows 95 spinning on print queue requests when itJeremy Allison1998-04-081-1/+1
| | | | | gets an error message it doesn't understand. Jeremy.
* chgpasswd.c, ipc.c, loadparm.c: Added boolean "unix password sync"Jeremy Allison1998-03-271-1/+4
| | | | | | | | parameter which allows the new change password code to change the unix password also. Defaults to OFF. includes.h: Added termios.h to FreeBSD to allow password changing. namequery.c: Fixed missing name parameters to debug statements. Jeremy.
* clientgen.c ipc.c smbpasswd.c: Fixes for warnings (from Herb).Jeremy Allison1998-03-241-1/+2
| | | | | | | | | | | quotas.c: Linux quota fix. util.c: Ensure smb_read_error is zero in all calls that can set it. lib/rpc/include/rpc_misc.h lib/rpc/include/rpc_netlogon.h lib/rpc/parse/parse_misc.c lib/rpc/parse/parse_net.c lib/rpc/server/srv_netlog.c : Modify Luke's code to call SamOEMhash(). Jeremy.
* Added SamOEMChangePassword functionality.Jeremy Allison1998-03-181-0/+60
| | | | Jeremy.
* "For I have laboured mightily on Luke's code, and hath brokenJeremy Allison1998-03-111-209/+460
| | | | | | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | This is merely updating the Copyright statements from 1997 to 1998. It's a once a year thing :-). NO OTHER CHANGES WERE MADE. Jeremy.
* charcnv.c: Added codepage 866 support onto the file system. PatchJeremy Allison1998-01-171-4/+26
| | | | | | | | | | | | | from Max Khon <max@iclub.nsu.ru>. chgpasswd.c: Allow old RAP change password to work with encrypted passwords. Samba can now allow Windows 95/NT clients to securely change the Lanman password ! (But not the NT hash - that gets lost). ipc.c: smbdes.c: smbpass.c: Support for the above. server.c: #ifdef'ed out fix for NT redirector bug. util.c: Fix NIS bug with server name. Jeremy.
* ipc.c: Fixed problem where we were not returning 'buffer too small'Jeremy Allison1998-01-101-2/+2
| | | | | when NT sends up a mdrcnt of zero. Jeremy.
* fix printer driver rpc to prevent core dumps.Herb Lewis1998-01-021-65/+73
|
* fixes to make_printerdef.c to generate a correct printers.def fileHerb Lewis1998-01-011-12/+37
| | | | changes to ipc.c to use new printers.def file
* use -1 not 0xffffffff in SIVALS() macrosAndrew Tridgell1997-11-291-4/+4
| | | | | use the same process_exists() code on all systems (it's probably faster anyway)
* ipc.c: Changed reply_trans to use receive_next_smb() to copeJeremy Allison1997-11-181-4/+12
| | | | | | | | with local message processing. reply.c: Added check to reply_lockingX for chain after oplock break. server.c: Added receive_next_smb(). trans2.c: Changed reply_trans2 to use receive_next_smb() to cope with local message processing.
* ipc.c :Luke Leighton1997-11-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | added a #define around the alignment thing: it's a way to stop NetMonitor from decoding your packets!!!! proto.h : usual. reply.c : added what i believe to be the correct error messages for getting correct domain joining. smb.h : some guesses at good names of the SAMR_XXXX functions. sorting out the SAMR_LOOKUP_RIDS function. this is *not* the same as the LSA_LOOKUP_RIDS function, unless paul accidentally put it on the ntlsa pipe by mistake, instead of the samr pipe :-) rpc_pipes/lsa_hnd.c rpc_pipes/pipe_hnd.c : moved creation and allocation of unique policy handles into this module. rpc_pipes/pipesamr.c rpc_pipes/samrparse.c rpc_pipes/smbparse.c : SAMR_LOOKUP_RIDS is beginning to look _suspiciously_ like the LSA_LOOKUP_RIDS function. but i know that there are subtle discrepancies.
* ipc.c: Changing back arbitrary alignment change until I know *why*Jeremy Allison1997-11-061-1/+1
| | | | | | | | luke changed it. proto.h: The usual. uid.c: Fix crash bug when attaching with smbclient -mCORE. A vuid pointer was being used when it was null. Jeremy.
* following a cvs error, i am rewriting this monster-commit. with bad grace.Luke Leighton1997-11-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-10/+14
| | | | pipes array.