summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
AgeCommit message (Collapse)AuthorFilesLines
2000-04-30fixed dptr_wcard handling (need to use strdup)Andrew Tridgell1-1/+1
(This used to be commit 0bab0300748a22b4b861fa443be2014bcd7b348c)
2000-04-30removed more cruft from our old wildcard matching codeAndrew Tridgell1-37/+0
(This used to be commit 4a15924ffe36ed37ec193a0ef5a0487238edc311)
2000-04-30fixed our smbsearch code. We now store the mask with the dptr, thisAndrew Tridgell1-22/+8
turns out to be essential for a correct implementation (there ins't enough room to store all possible masks in the status return structure!) (This used to be commit 38f5e133670ada6e5799a16cf1a0e2e3ee1d9afd)
2000-04-30- removed all our old wildcard matching code and replaced it with aAndrew Tridgell1-9/+6
call to ms_fnmatch(). This also removes all the Win9X semantics stuff and a bunch of other associated cruft. - moved the stat cache code into statcache.c - fixed the uint16 alignment requirements of ascii_to_unistr() and unistr_to_ascii() - trans2 SMB_FIND_FILE_BOTH_DIRECTORY_INFO returns the short name as unicode always (at least thats what NT4 does) - fixed some errors in the in-memory tdb code. Still ugly, but doesn't crash as much (This used to be commit 03e9cea004bbba72161a5323cf3b4556c94aed8e)
2000-04-27Fixed range check on writeX.Jeremy Allison1-1/+4
Jeremy. (This used to be commit 9cde198108439358e99128fa9a1b3000e33f5414)
2000-04-27Tidyup of smbecho.Jeremy Allison1-2/+4
Jeremy. (This used to be commit 4a4b7a994bbe327216f736133edc51cf9a351716)
2000-04-25moved trans2.h and nterr.h into includes.h with all our other includesAndrew Tridgell1-2/+0
(This used to be commit d7cd7c88fdabb01d9e40ae8a657737907a21ac37)
2000-04-24Now that fsp's are created on successful file open, the structure memberJeremy Allison1-1/+1
fsp->open is no longer needed (if an fsp pointer is valid, then it's open :-). NB for Luke, this patch also did not apply to TNG. TNG is not yet identical w.r.t file serving with HEAD. This makes it impossible for me to help maintain TNG. Please fix asap. lib/substitute.c: Removed unused variable (pidstr). Jeremy. (This used to be commit 389b700a26e8a308a0dff6fc038c38068aa0119a)
2000-04-22fixed overlapping strcpy() found by insureAndrew Tridgell1-9/+6
(This used to be commit 1106fa7f24d229c3877263b7a7dde359556435e6)
2000-04-22This is a *big* checkin that may break some things, but implements theJeremy Allison1-50/+14
new open mechanism Andrew & I discussed. config.sub: configure: Included the QNX patch. include/vfs.h: smbd/vfs-wrap.c: smbd/vfs.c: Added ftruncate vfs call (needed). Note that we will also need locking calls in the vfs (to be added). lib/util_unistr.c: nmbd/nmbd_processlogon.c: Fix for NT domain logons causing nmbd to core dump. Also fix for sidsize DOS bug. locking/locking.c: Check value of ret before using it for memdup. printing/printing.c: Convert print_fsp_open to return an allocated fsp. rpc_server/srv_lsa.c: Fix for NT domain logons. I have removed all use of lp_share_modes() from the code (although I left the parameter in the table for backwards compatibility). It no longer makes sense for this to exist. smbd/close.c: Removed lp_share_modes(). smbd/fileio.c: Fixed parameters to unlock_share_entry call in panic code. smbd/files.c: Correctly set the unix_ERR_code to ERRnofids on fsp allocation fail. smbd/nttrans.c: smbd/reply.c: smbd/trans2.c: Changed all occurrences of open_file_shared/open_directory/ open_file_stat to return an fsp from the call. smbd/open.c: Changed all occurrences of open_file_shared/open_directory/ open_file_stat to return an fsp from the call. In addition I have fixed a long standing race condition in the deny mode processing w.r.t. two smbd's creating a file. Andrew, please note that your original idea of using open with O_EXCL in this case would not work (I went over the races very carefully) and so we must re-check deny modes *after* the open() call returns. This is because there is a race between the open with O_EXCL and the lock of the share mode entry. Imagine the case where the first smbd does the open with O_EXCL and a deny mode of DENY_ALL, but is pre-empted before it locks the share modes and creates the deny mode entry for DENY_ALL. A second smbd could then come in with O_RDONLY and a deny mode of DENY_NONE and the two opens would be allowed. The *only* way to fix this race is to lock the share modes after the open and then do the deny mode checks *after* this lock in the case where the file did not originally exist. This code will need extensive testing but seems to initially work. Jeremy. (This used to be commit ab0ecc39d688f16b9692fe90b991f0b89287070a)
2000-04-16the changes to the main smb codeAndrew Tridgell1-6/+6
------------ The following series of commits are for the new tdb based printing backend. This completely replaces our old printing backend. Major changes include: - all print ops are now done in printing/*.c rather than scattered all over the place - system job ids are decoupled from SMB job ids - the lpq parsers don't need to be nearly so smart, they only need to parse the filename, the status and system job id - we can store lots more info about a job, including the full job name - the queue cache control is much better I also added a new utility routine file_lines_load() that loads a text file and parses it into lines. This is used in out lpq parsing and I also want to use it to replace all of our fgets() based code in other places. (This used to be commit d870542c2884510bd45fd5b54ff2157434d53f4c)
2000-04-12Implmented mapping of lock offset/count from 64 bit MS rangesJeremy Allison1-1/+1
to either 63 or 31 bit POSIX ranges. Code to get these locks not yet added. Jeremy. (This used to be commit 9c3b9146a3baff4b2e403ae8fac6c48df1b7e642)
2000-04-11include/byteorder.h: ALIGN4/ALIGN2 macros.Jeremy Allison1-105/+53
include/includes.h: Added SMB_BIG_UINT_BITS. lib/util.c: Removed align2/align4 - use macros. libsmb/namequery.c: Use ALIGN2. locking/locking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. Needed to move to hiding POSIX locks at a lower layer. nmbd/nmbd_processlogon.c: Use ALIGN2/ALIGN4 macros. smbd/blocking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. smbd/reply.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. Jeremy. (This used to be commit 491eea8a20bf80d426625479326211dc975857a6)
2000-04-11finally got sick of the "extern int Client" code and the stupidAndrew Tridgell1-13/+12
assumption that we have one socket everywhere while doing so I discovered a few bugs! 1) the clientgen session retarget code if used from smbd or nmbd would cause a crash as it called close_sockets() which closed our main socket! fixed by removing close_sockets() completely - it is unnecessary 2) the caching in client_addr() and client_name() was bogus - it could easily get fooled and give the wrong result. fixed. 3) the retarget could could recurse, allowing an easy denial of service attack on nmbd. fixed. (This used to be commit 5937ab14d222696e40a3fc6f0e6a536f2d7305d3)
2000-04-10the bulk of the changes to get rid of fd_ptr and move print openAndrew Tridgell1-103/+28
handling to printing/printing.c most of this was just replacing things like fsp->fd_ptr->fd with fsp->fd the changes in open.c are quite dramatic. Most of it is removing all the functions that handled the fd multiplexing (This used to be commit d1827a3648009fd0a0d165055015d9aeda7a1037)
2000-03-29More Japanese filename fixes wrt VFS code fromTim Potter1-6/+9
Tomoki AONO <aono@cc.osaka-kyoiku.ac.jp> (This used to be commit a9b628ebaa90e464366d0284226753f31439af9f)
2000-03-13include/smb.h:Jeremy Allison1-5/+5
smbd/negprot.c: smbd/reply.c: Fixes to recognise Win2k. param/loadparm.c: Put debug timestamp parameter back to correct default. smbd/nttrans.c: Fix to detect Win2k unicode bug with transact create. Jeremy. (This used to be commit bb100352ab2f98fab3978008d269920e03efcf6d)
2000-03-08dded Microsoft Dfs services.Shirish Kalele1-1/+34
* added a new msdfs/ directory under source/ * added msdfs sources under this directory. * modified configure setup to add a --with-msdfs configure time option Modified Files: Makefile.in acconfig.h configure configure.in include/config.h.in include/includes.h include/proto.h include/smb.h include/smb_macros.h param/loadparm.c smbd/negprot.c smbd/nttrans.c smbd/process.c smbd/reply.c smbd/server.c smbd/trans2.c Added Files: include/msdfs.h msdfs/README msdfs/msdfs.c msdfs/msdfs_tdb.c msdfs/parse_dfs_map.c ---------------------------------------------------------------------- (This used to be commit 4684b4a188b54493dbe7f0de2909a8d3c5c3ebf9)
2000-02-03Put back lots of missing calls to dos_to_unix(). Thanks toTim Potter1-19/+22
aono@cc.osaka-kyoiku.ac.jp (Tomoki AONO) (This used to be commit 176c405d2702a4245561ff56c8eac3c754a0dea3)
2000-02-03Mega-VFS merge. Yeah baby!Tim Potter1-58/+62
Synopsis: change every disk access function to work through a vfs_ops structure contained in the connection_struct. (This used to be commit 3aad500c0fb61232ed3431ff4b743b5d18ec852f)
2000-01-26Second set of inline optimisation fixes from Ying Chen <ying@almaden.ibm.com>.Jeremy Allison1-1/+1
Stop makeing function calls for every use of skip_multibyte_char. This function is called several *million* times during a NetBench run :-). Jeremy. (This used to be commit e5a3deba46ea2d4cb49a6c4b73edd766fe8b5a5c)
2000-01-14Added "inherit permissions" patch.Jeremy Allison1-7/+12
Fixed locking bug found by Andrew. Jeremy. (This used to be commit 38dffd360dc2e44bfc9e751f017e24f81ff0f2fa)
2000-01-13changes to reflect the new syntax of the locking calls.Andrew Tridgell1-15/+14
(This used to be commit 44117df2c908d473b3e1a1020b22af6d584809ef)
1999-12-21first cut at using the tdb code for the connections structure, theAndrew Tridgell1-1/+1
SWAT status page and smbstatus. It made the code _much_ simpler, I wish we'd done a database module a long time ago! (This used to be commit 4951755413c11d4c5b9af4699a6e622056d52433)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-718/+1111
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-12-12changed function name of get_home_dir() to get_unixhome_dir(), to stopLuke Leighton1-1/+1
clash with gnu readline library. fixed issue with [homes] service not being there - call lp_add_home() just before starting the msrpc processing. (This used to be commit 054195df9b6187c663ede5cf4489499abbdc29fc)
1999-12-12final part of "first" phase converting over to msrpc daemon architecture.Luke Leighton1-35/+3
done a minimal amout of clean-up in the Makefile, removing unnecessary modules from the link stage. this is not complete, yet, and will involve some changes, for example to smbd, to remove dependencies on the password database API that shouldn't be there. for example, smbd should not ever call getsmbpwXXX() it should call the Samr or Lsa API. this first implementation has minor problems with not reinstantiating the same services as the caller. the "homes" service is a good example. (This used to be commit caa50525220b0d0250fa139367593c2de2c12135)
1999-12-06the first independent msrpc daemon - lsarpcd.Luke Leighton1-2/+3
one horrible cut / paste job from smbd, plus a code split of shared components between the two. the job is not _yet_ complete, as i need to be able to do a become_user() call for security reasons. i picked lsarpcd first because you don't _need_ security on it (microsoft botched so badly on this one, it's not real. at least they fixed this in nt5 with restrictanonymous=0x2). fixing this involves sending the current smb and unix credentials down the unix pipe so that the daemon it eventually goes to can pick them up at the other end. i can't believe this all worked!!! (This used to be commit 2245b0c6d13c7c5886e81f9137b05df883598c26)
1999-12-02domain_client_validate() no longer takes serverlist, it callsLuke Leighton1-10/+1
get_any_dc_name(). (This used to be commit e21367c0ebdc5e202cdc39d50950bff089bf67f8)
1999-12-02need a domain resolving function, but get_trusted_serverlist() will do.Luke Leighton1-30/+6
this is horrible. (This used to be commit 9df973fe711f322075d86d6792d6c0b8539c1d00)
1999-11-21implement server-side generation of NTLMv2 session key. YESSS :-)Luke Leighton1-1/+1
(This used to be commit 1092b4f6fbdf3770c0dab756b982a562def1738e)
1999-11-21hmmm... have to add client-side support in domain_client_validate() toLuke Leighton1-4/+6
_use_ user session key. (This used to be commit be6a6b13939798a9c7242b38864f0ce842391a74)
1999-11-20modified domain_client_validate to take trust account name / type. thisLuke Leighton1-5/+56
is to pass DOMAIN_NAME$ and SEC_CHAN_DOMAIN instead of WKSTA_NAME$ and SEC_CHAN_WKSTA. modified check_domain_security to determine if domain name is own domain, and to use wksta trust account if so, otherwise check "trusting domains" parameter and use inter-domain trust account if so, otherwise return False. (This used to be commit 97ec74e1fa99d773812d2df402251fafb76b181c)
1999-11-15- added DCE/RPC "fault" PDU support.Luke Leighton1-0/+4
- 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. (This used to be commit 25c70e3c984c4fed19763ed405741e83fe14f87e)
1999-07-21comments requested by jeremy as to why NT/95 NULL-password distinction hackLuke Leighton1-1/+6
was modified. (This used to be commit 50f7bd8a9c47d073bbde66ae26e9f71f030afc4c)
1999-07-15work-around for win95 NULL session bug: NULL password actually beingLuke Leighton1-3/+13
placed in data stream before username / domain, whereas NT doesn't do this... (This used to be commit 44e6d4c1b0b6ae54e76e96471b40bb784c8b3c8c)
1999-07-15more dfs stuff. this looks like it's going to be more appropriate to useLuke Leighton1-25/+75
the vfs tables. at the moment, i replaced all calls to unix_convert() with unix_dfs_convert(). this does the job, but it's not very nice. (This used to be commit 00d4aebce9f268a737ef9df9bdbe59f8fe831979)
1999-07-12lengths of NT passwords when "encrypt passwords = no" can be completelyLuke Leighton1-1/+1
random. values seen can be as high as 18255. this fails the check of <= 24 which sets NT password length to 0, effectively ignoring it. the <= 24 was removed in reply_sesssetup_X. (This used to be commit 98d43b20dc4df72ddbfaeb34581222adc53d15dd)
1999-07-12Jean-Francois Micouleau's rewritten DFS patch, originally written byLuke Leighton1-0/+10
Nigel Williams. despite the data format being *exactly* the same as NT's, this still doesn't work yet. more work needed. (This used to be commit 270981960bb5aab52d2f8e494827101ece6729c4)
1999-07-06reporting failure to accept ntlmv2 (only) with down-level protocols (LANMAN1Luke Leighton1-3/+13
and below). (This used to be commit be7b978249ddb5e2e94aa160a360fecbf51f016e)
1999-06-29improving authentication code (tidyup).Luke Leighton1-3/+5
(This used to be commit ab1a6aa42db5217f025941fb5107436556bc23b7)
1999-06-24debugging of NBT messages added.Luke Leighton1-0/+3
(This used to be commit ceb20adb3c924818201fa8992e19e82f45b40710)
1999-06-13Moved code that changes the pw_passwd entry (i.e shadow password andTim Potter1-1/+1
weird unixware stuff) into _Get_Pwnam() to fix a memory allocation bug. Note that the Get_Pwnam() function now returns a const struct passwd * as a hint to other developers not to change entries in the struct passwd. (This used to be commit 36d7cb4ccc42268e8e6a7b783c945d1853624958)
1999-04-20Changed arguments to fsync() function to break dependency onTim Potter1-13/+17
connection_struct. (This used to be commit ee6f826ccc0897a4538f6f9a560127c54a4c4038)
1999-04-04Fixed up incorrect calls to read_file().Tim Potter1-2/+2
(This used to be commit 17d007daa3d1fa60501eae1eecfc2d0f88c1692e)
1999-04-04Use VFS operations for file I/O.Tim Potter1-73/+80
(This used to be commit cfddbdb62485256a947a30e04c753200451cbe1c)
1999-03-25SAM database "set user info".Luke Leighton1-3/+4
---------------------------- - removed DOM_RID4 - removed SAMR_UNKNOWN_32 - added SAMR_SET_USERINFO (opcode 0x32) - added level 0x1 to SAMR_QUERY_DOM_INFO (needed for create user) - fixed pwdb_gethexpwd() it was failing on XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - added mod_sam21pwd_entry() - preparing to call mod_sam21pwd_entry() - added "user session key" to user_struct.dc. this is md4(nt#) and is needed to decode user's clear-text passwords in SAMR_SET_USERINFO. - split code out in chgpasswd.c to decode 516 byte password buffers. (This used to be commit 2e58ed742435befe419aa366c4052019fede8c23)
1998-12-14trying to track down issues in get_home_dir().Luke Leighton1-1/+5
(This used to be commit 2cce78aa00f31b79d51aaf46da72019b926e8226)
1998-12-01check server role before doing nt user to unix user mappingLuke Leighton1-12/+15
(This used to be commit 9d4e810e7dd8d6d80b47204636f9a37774f95455)
1998-12-01andrej spotted that entries _not_ in domain map user were being refused.Luke Leighton1-10/+6
modified map_nt_and_unix_names() to never refuse a mapping (returns void now not BOOL). (This used to be commit faffcb3c8955dcea3987e2978dc34b4dba580167)