summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
AgeCommit message (Collapse)AuthorFilesLines
2000-04-30go back to ascii in SMB_FIND_FILE_BOTH_DIRECTORY_INFOAndrew Tridgell1-10/+4
NT gives out unicode, but NT clients can't handle a unicode response! (This used to be commit 85d634974f4f8841bf68cd2b22d134fbc010b568)
2000-04-30- removed all our old wildcard matching code and replaced it with aAndrew Tridgell1-38/+29
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-25moved trans2.h and nterr.h into includes.h with all our other includesAndrew Tridgell1-1/+0
(This used to be commit d7cd7c88fdabb01d9e40ae8a657737907a21ac37)
2000-04-24Now that fsp's are created on successful file open, the structure memberJeremy Allison1-2/+2
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-23fixed two uninitialised memory referencesAndrew Tridgell1-2/+2
(This used to be commit e4ddd1a4a96b7f723d3d92e4334f4033e1dbc8a8)
2000-04-22This is a *big* checkin that may break some things, but implements theJeremy Allison1-87/+78
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-11finally got sick of the "extern int Client" code and the stupidAndrew Tridgell1-4/+3
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-11/+11
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-04-04Removed strange optimisation (paranoia fix maybe ?) that stopped smbdJeremy Allison1-6/+0
from returning '.' and '..' in a top level listing of a trans2 directory scan. NT does return these entries. Jeremy. (This used to be commit 7325059a0940909ddd98b32d62423700545ef87e)
2000-03-28Win2k will only accept volume labels in UNICODE. Fixed.... :-(.Jeremy Allison1-1/+2
Jeremy. (This used to be commit 676db02f1cd7cb81c58cbbdd3bc94da17dad5227)
2000-03-28Moved common code to set parameter offset field correctly oout of 'if'Jeremy Allison1-10/+8
statement into main function code path. Jeremy. (This used to be commit f15ca0d9273d718534ba2fdd2ccd14ab90a95c8b)
2000-03-27changed the definition of dos_PutUniCodeAndrew Tridgell1-4/+4
the previous definition could result is us overflowing a buffer. The null termination was always added yet the size returned did not include the null termination. the new function takes a BOOL null_terminate, and always returns the total number of bytes consumed by the string. (This used to be commit 426c90433396a95033eefcc4af97603abc934221)
2000-03-13Cleaning up call_trans2getdfsreferral.Shirish Kalele1-1/+0
Instead of a #ifdef MS_DFS in call_trans2getdfsreferral()... , now using a generic call leading to some #define problems.. hopefully I've corrected the last of them. (This used to be commit b5a489fbb808cc7c8ff2338344ef2dae8e351e44)
2000-03-13Cleaned up call_trans2getdfsreferral for when MS_DFS is not defined.Shirish Kalele1-1/+1
(This used to be commit 2b99318341a3f3a3ac138fe96ad271726bf1552c)
2000-03-13moved #endif to end of function to compile when dfs is disabled.Jean-François Micouleau1-1/+1
J.F. (This used to be commit b534fb03b1ef39e5362c29a05cca53782cd157f7)
2000-03-10Cleaning up the warnings from configure.developer.Shirish Kalele1-6/+3
Found that Jeremy had already made some of the changes. (This used to be commit ca02d9f8219265f80fe11236c8c146db1dbb1ae2)
2000-03-10Fixups for compiles with gcc flags -Wall -Wshadow -Wstrict-prototypes ↵Jeremy Allison1-0/+2
-Wpointer-arith -Wcast-qual Partially implemented rpc daemon redirect (needs more work). Jeremy. (This used to be commit a462191698fa589ceac4afd14c652adf699eccad)
2000-03-08dded Microsoft Dfs services.Shirish Kalele1-3/+56
* 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-18Fix for reporting file system attributes correctly.Jeremy Allison1-1/+2
Jeremy. (This used to be commit 801ed2389b97f921aa855513696d304c542fda04)
2000-02-03Mega-VFS merge. Yeah baby!Tim Potter1-17/+21
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-14useable_space does not include the alignment offset calculations.Jeremy Allison1-1/+8
Bugfix from Marc_Jacobsen@hp.com. Jeremy. (This used to be commit eb06c199163232453e2d9ca50d00765c90f8f3e2)
2000-01-14Added "inherit permissions" patch.Jeremy Allison1-2/+2
Fixed locking bug found by Andrew. Jeremy. (This used to be commit 38dffd360dc2e44bfc9e751f017e24f81ff0f2fa)
1999-12-21Changed MAX to MIN in SET_FILE_BASIC_INFO as recommended by "Michael C. ↵Jeremy Allison1-1/+1
Adler" <Michael.Adler@compaq.com> as this breaks the least number of programs. Jeremy. (This used to be commit 2cf408772f7b763a484fdd893da28999c8f9d025)
1999-12-21converted all our existing shared memory code to use a tdb databaseAndrew Tridgell1-6/+5
instead of either sysv or mmap shared memory or lock files. this means we can now completely remove locking_shm.c locking_slow.c shmem.c shmem_sysv.c and lots of other things also got simpler locking.c got a bit larger, but is much better compartmentalised now (This used to be commit e48c2d9937eea0667b8cd3332e49c06314ef31e7)
1999-12-20*Finally*. Correct patch to fix timestamp problems from Paul Eggert ↵Jeremy Allison1-3/+14
<eggert@twinsun.com>. I wish I had written this one :-). Jeremy. (This used to be commit 8f93c08881c22d121c7337d11de070e2b8f7ba33)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-602/+432
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-07-15more dfs stuff. this looks like it's going to be more appropriate to useLuke Leighton1-7/+35
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-15dfs issuesLuke Leighton1-1/+1
(This used to be commit d9ada8b55d539e555d25298e0a308ea952e2807e)
1999-07-13dfs parsed string length was being set explicitly to value "6", overwritingLuke Leighton1-22/+21
the correct length. (This used to be commit 5d1fad53c2bdfef63930e0b9d5cc460c9740066e)
1999-07-12Jean-Francois Micouleau's rewritten DFS patch, originally written byLuke Leighton1-66/+332
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-04-04Use VFS operations for file I/O.Tim Potter1-14/+19
(This used to be commit cfddbdb62485256a947a30e04c753200451cbe1c)
1999-02-15Always null-terminate strings.Matthew Chapman1-3/+3
Also some string length and sizeof(pointer) corrections. (This used to be commit ce24191939b82985d09eabe945199f38b0fea486)
1999-02-12UNICODE cleanup (see lib/util_unistr.c).Matthew Chapman1-6/+7
No more ugly static library buffers and all functions take a destination string length (especially unistrcpy was rather dangerous; we were only saved by the fact that datagrams are limited in size). (This used to be commit a1d39af1ce1d451b811dbd7c2ba391214851b87e)
1998-11-23Fixed -Wall -Wshadow warning.Jeremy Allison1-2/+1
Jeremy. (This used to be commit 81b90208910528a4ace683f30e39c54d8cfa12b7)
1998-11-19Sync up with 2.0 code.Jeremy Allison1-2/+1
Added HPUX autoconf changes. Added "gross hack" printer code. Jeremy. (This used to be commit 1ef6d3bd63722afe9c376793a6ea72046d1a0602)
1998-11-18Fixed crash bug which was assuming that fd_ptr was always non-nullJeremy Allison1-3/+6
(which is not the case with open directories). Jeremy. (This used to be commit c154b1601f5891d664fc538ec8874fa8ef2061e6)
1998-11-17Fixed NT modify timestamp issue.Jeremy Allison1-2/+15
If a client does a modify timestamp on an open file (which will do no good at all on UNIX :-) then keep the modify request pending in the files_struct and apply it at close instead. Jeremy. (This used to be commit 92a7a86f0e0255e3812dd35bebfcd653091514ae)
1998-11-15change ROUNDUP to SMB_ROUNDUP to prevent conflicts with system macrosAndrew Tridgell1-6/+6
(This used to be commit d9d44d98ec719b7fc6d5b0fc35bf8727f4cd0372)
1998-10-26Fixed a couple of issues with the SMB_QUERY_FILE_ALL_INFO query.Jeremy Allison1-2/+5
Ensured offset was being reported correctly for 64 bit file access, ensured delete on close bit was being reported correctly. Jeremy. (This used to be commit 4332bc06c6604a3e14007eda4f40e6183a1f8526)
1998-10-24volker was concerned about unique inode numbers and smbsh. This set ofAndrew Tridgell1-0/+1
changes uses the unique index number from a SMB_QUERY_FILE_ALL_INFO to try to provide inode numbers. If it is 0 then use the hash of the filename as before. (This used to be commit 2565ccf9de9d5e80fdb5bcadbc7130faba386d95)
1998-10-23Handle the case where multiple smbd have the file open, some of whomJeremy Allison1-15/+65
don't have the ALLOW_DELETE_ON_CLOSE share flag enabled. Told you this was fiddly code :-). Jeremy. (This used to be commit 222d686a6cdbc2947e7201636ae80ef4c650a65d)
1998-10-23Make the new code conditional on lp_share_modes() just like the code in ↵Jeremy Allison1-36/+39
open_file_shared(). Jeremy. (This used to be commit 8de02620ea8f45f6a700617911947467e7be46e1)
1998-10-23Fixed debug reporting in the changed code.Jeremy Allison1-1/+6
Jeremy. (This used to be commit d815e2d7a65c95ae71372b4fc8fe82f0202386dc)
1998-10-23Fixed bug in previous commit where I was overwriting share_mode fromJeremy Allison1-3/+4
one fsp with that of another. Not good :-). Jeremy. (This used to be commit 269bca2b3bbf5cae9fdf05d0405bfd80272da5d1)
1998-10-23Reasonably large change to give us *exactly* correct NT delete on close ↵Jeremy Allison1-1/+51
semantics. This was trickier than it looks :-). Check out the new DELETE_ON_CLOSE flag in the share modes and the new code that iterates through all open files on the same device and inode in files.c and trans2.c Also changed the code that modifies share mode entries to take generic function pointers rather than doing a specific thing so this sort of change should be easier in the future. Jeremy. (This used to be commit 5e6a7cd99d29d1cf068fc517272559c1cf47ea3a)
1998-10-23include/smb.h: Added #defines for lots of things - makes our code a *lot* ↵Jeremy Allison1-7/+4
easier to read. lib/util.c: Fixed Luke's set_first_token() function - should return void. smbd/close.c: Move delete_on_close into file_fd_struct structure. smbd/ipc.c: Changed local_machine back to fstring. smbd/nttrans.c: Use defines for mapping share modes. smbd/open.c: Move delete_on_close into file_fd_struct structure, added code for ALLOW_SHARE_DELETE. smbd/reply.c: Use defines for mapping share modes. smbd/trans2.c: Move delete_on_close into file_fd_struct structure. Jeremy. (This used to be commit 8e1ce307bd6a9056b4a95fe6f52ff42dc6e03a08)
1998-10-21Fixed mainly signed/unsigned issues found by SGI cc in -fullwarn mode.Jeremy Allison1-7/+29
smbd/chgpasswd.c: Fixed (my) stupid bug where I was returning stack based variables. Doh ! smbd/trans2.c: Allows SETFILEINFO as well as QFILEINFO on directory handles. Jeremy. (This used to be commit 0b44d27d0b5cc3948a6c2d78370ccddf1a84cd80)
1998-10-20smbd/nttrans.c smbd/trans2.c: First fixes for NT5.0beta2. That redirectorJeremy Allison1-11/+32
has some *horrible* bugs ! smbwrapper/shared.c smbwrapper/smbsh.c smbwrapper/smbw.c: Fixed gcc warnings. Jeremy. (This used to be commit 76448d1d82a78520953c662afee0886122ce134b)
1998-10-18Fixed sys_lseek and seek_file calls so all returnsJeremy Allison1-1/+2
are *checked* :-). Jeremy. (This used to be commit b8b781191dd7d28944d87eec5fa0fbef798e289b)
1998-10-16only do the MAC extensions if we are a NTFS filesystemAndrew Tridgell1-6/+10
(This used to be commit 91d224735d1a4ef26d75d87e3b35d8d156b8998b)