summaryrefslogtreecommitdiff
path: root/source3/smbd/nttrans.c
AgeCommit message (Collapse)AuthorFilesLines
2000-08-01Tidyup removing many of the 0xC0000000 | NT_STATUS_XXX stuff (only need ↵Jeremy Allison1-5/+5
NT_STATUS_XXX). Removed IS_BITS_xxx macros as they were just reproducing "C" syntax in a more obscure way. Jeremy. (This used to be commit c55bcec817f47d6162466b193d533c877194124a)
2000-07-27Ok - this is a *BIG* change - but it fixes the problems with static stringsJeremy Allison1-2/+20
in the RPC code. This change was prompted by trying to save a long (>256) character comment in the printer properties page. The new system associates a TALLOC_CTX with the pipe struct, and frees the pool on return of a complete PDU. A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx code, and is freed in the main loop. This code works with insure, and seems to be free of memory leaks and crashes (so far) but there are probably the occasional problem with code that uses UNISTRxx structs on the stack and expects them to contain storage without doing a init_unistrXX(). This means that rpcclient will probably be horribly broken. A TALLOC_CTX also needed associating with the struct cli_state also, to make the prs_xx code there work. The main interface change is the addition of a TALLOC_CTX to the prs_init calls - used for dynamic allocation in the prs_XXX calls. Now this is in place it should make dynamic allocation of all RPC memory on unmarshall *much* easier to fix. Jeremy. (This used to be commit 0ff2ce543ee54f7364e6d839db6d06e7ef1edcf4)
2000-06-12split all the change notify code out into a separate moduleAndrew Tridgell1-392/+35
smbd/notify.c. All the data structures are now private to that module. this is in preparation for Linux kernel support for change notify (coming soon to a CVS tree near you) (This used to be commit 1bb0aad4f66dbfa2d0f767ea90f926affff20b17)
2000-06-09(Correct) fix for desired_access being zero in map_share_mode().Jeremy Allison1-12/+12
Jeremy. (This used to be commit cc447fbe3cd77d57e18c3d1dff94a95d6032c311)
2000-06-08Fix for map_share_mode to allow desired access of zero map to stat open.Jeremy Allison1-0/+11
Jeremy. (This used to be commit b0242080fe464e71815431559fe54d109e0b92f2)
2000-06-07Fixing get/set of security descriptors.Jeremy Allison1-1/+4
Removed ugly hack for NT printing. Fixed up tdb parse stuff memory leaks. Jeremy. (This used to be commit 8ef41f31c53e14ad057d883810a1cd2301fede2a)
2000-06-03rpc_client/cli_lsarpc.c: Removed unused variable.Jeremy Allison1-9/+9
rpc_server/srv_spoolss_nt.c: Fixed more memory leaks. smbd/nttrans.c: Fixed shadow variable problem. Jeremy. (This used to be commit f0a7540831181d3a47e7f8ce8be55a36a2f2aba1)
2000-05-31Changed interface to set_nt_acl slightly.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 4534eae405f952d4b93e445571fc487e66a7541b)
2000-05-31Fixed interface between new ACLS and nttrans code.Jeremy Allison1-183/+12
Jeremy. (This used to be commit 400263245b4e5344b496c5de52a659f040206798)
2000-05-27prs_give_memory in wrong place, also poss. was losing mem.Luke Leighton1-7/+7
(This used to be commit 9805e17cd0ce427c329a8b5a8318d5f75227e283)
2000-05-27fixed nttrans.cLuke Leighton1-406/+38
(This used to be commit 06cd46b0ec10b32af54edd8256d2fdbec45e1371)
2000-05-26Changed MS_DFS to WITH_MSDFS throughout.Shirish Kalele1-1/+1
Fixed trans2 calls on IPC$ to let dfs referral calls through. (This used to be commit e0965a80bdca5239886b11ef55dc29fed261bfc0)
2000-05-23Did a proper fix for the file access on IPC$. Denied all pipe opens onJeremy Allison1-124/+192
trans2 open calls as we don't have the pipe open response coded up yet. Jeremy. (This used to be commit 8142e27c9c32aba5a7dabc48a676b93cf680151b)
2000-05-23Fixed bug where file access was allowed on IPC$ share.Jeremy Allison1-0/+3
Return correct error codes on invalid share name. Jeremy. (This used to be commit 420d6bc4809cef9d74354175d0fa956ab4e8ac3c)
2000-05-18Added the NETDFS pipe to allow remote administration of the msdfs symlinksShirish Kalele1-0/+3
on the samba server. (This used to be commit 15e7d8f6c5cddf6ce409ee2505744250d181ec34)
2000-05-10more merging voodooAndrew Tridgell1-1/+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 (This used to be commit 92109d7b3c06f240452d39f669ecb8c9c86ab610)
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-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-23insure caught an uninitialised memory reference - ensure it starts asAndrew Tridgell1-0/+2
zero (This used to be commit 53077295b76487a6eafc6b14b69a91074a02aa35)
2000-04-22This is a *big* checkin that may break some things, but implements theJeremy Allison1-40/+16
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-6/+4
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-32/+8
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-22Correctly convert from little-endian UNICODE to dos_codepage when doingJeremy Allison1-17/+4
secure file create. Jeremy. (This used to be commit 90134dd13721f60d4fb05ce9434b65e95ff09629)
2000-03-13include/smb.h:Jeremy Allison1-19/+84
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-09Fixups for Win2K security descriptors from the 2.0.x branch.Jeremy Allison1-26/+60
Jeremy. (This used to be commit d22d4482b5e170f352dbfde5b37fc4d4e0eb0a49)
2000-03-08dded Microsoft Dfs services.Shirish Kalele1-1/+4
* 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-03-01Off by one error in detecting Win2k unicode bug.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 4971e8b44ac38806f6fc0b3bd22d3ccafd1f5d4e)
2000-03-01Fix for Win2k unicode bug where doing SMB_NT_TRANSACT_CREATE it usesJeremy Allison1-12/+21
unicode filenames whilst *not* bothering to set the unicode bit. Nice :-(. Jeremy. (This used to be commit ccddf4d92e4b1af6076692c21247a838498201fc)
2000-02-29Fixes for strange Win2K attempts to auto-inherit ACLs.Jeremy Allison1-8/+27
Jeremy. (This used to be commit 41e37c51816ec048952ada1513c62f2689589001)
2000-02-15Added replacement functions sys_popen and sys_pclose. These are basedJeremy Allison1-4/+2
on the glibc source code and are safer than the traditional popen as they don't use a shell to exec the requested command. Now we have these functions they can be tightened up (environment etc.) as required to make a safe popen. It should now be safe to add the environement variable loading code to loadparm.c Jeremy. (This used to be commit b52e92b09d4ca3b66e534f520468dee27065d048)
2000-02-07Jeremy can you check lib/util_unistr.c for codepages support ?Jean-François Micouleau1-0/+1
I added 2 UNICODE <-> ASCII functions which _don't_ honor codepage support. J.F. (This used to be commit b81dc7b7f832cae2e66076398a134fbb6c1f78ca)
2000-02-03Mega-VFS merge. Yeah baby!Tim Potter1-11/+14
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-25First set of speed improvements from Ying Chen <ying@almaden.ibm.com>.Jeremy Allison1-1/+0
Inline several commonly used functions as macros. Jeremy. (This used to be commit fc0219c7cc4b83e6db17d5b3be70d74fd7971089)
2000-01-14Added "inherit permissions" patch.Jeremy Allison1-3/+3
Fixed locking bug found by Andrew. Jeremy. (This used to be commit 38dffd360dc2e44bfc9e751f017e24f81ff0f2fa)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-161/+1056
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-11-19- bug in nmbd registering DOMAIN_NAME<1c> to WINS server; recursionLuke Leighton1-0/+1
desired flag MUST be set in any NBT UDP packets sent to a WINS server, else they will go to the WINS client side of the NT NetBIOS kernel instead, and will get trashed. - added \PIPE\browser server-side code. (This used to be commit 8e406c1fa296c3f97b1cd7ddde7b5aeb9232b26e)
1999-07-15more dfs stuff. this looks like it's going to be more appropriate to useLuke Leighton1-2/+10
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-12Jean-Francois Micouleau's rewritten DFS patch, originally written byLuke Leighton1-0/+1
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-27rpc_parse/parse_misc.c : defined a new BUFFER5 structJean-François Micouleau1-0/+1
include/ntdomain.h : added rpc_spoolss.h include statement include/proto.h include/rpc_dce.h : added definition of RPC_ALTER_CONTEXT request & reply param/loadparm.c : 2 new options for NT printing support and some changes to initial values in the LPRNG case. rpc_parse/parse_prs.c : added prs_uint16s() rpc_parse/parse_rpc.c : added SYNT_SPOOLSS_V1 and code for the alter-context support. rpc_server/srv_pipe.c : alter-context support smbd/nttrans.c smbd/server.c include/rpc_misc.h Makefile.in include/smb.h Jean Francois (This used to be commit 4c515804b70254248e378a3f90f47e4c32639d29)
1999-04-04Use VFS operations for file I/O.Tim Potter1-11/+15
(This used to be commit cfddbdb62485256a947a30e04c753200451cbe1c)
1998-12-08adding srvsvc pipe.Luke Leighton1-0/+1
(This used to be commit d06d6369942828ec89e90f99bd0d0d3f91d61d13)
1998-11-23unix instance of group database APILuke Leighton1-2/+2
(This used to be commit e76f593b3572ac881f1aa1fb3326d8b7169b0078)
1998-11-20Instrumented hack fix with debug level 10 statements just in case :-).Jeremy Allison1-0/+3
Jeremy. (This used to be commit 10f51b85722141f99ffecc3f19a39de108400828)
1998-11-19Sync up with 2.0 code.Jeremy Allison1-7/+73
Added HPUX autoconf changes. Added "gross hack" printer code. Jeremy. (This used to be commit 1ef6d3bd63722afe9c376793a6ea72046d1a0602)
1998-11-17- group database API. oops and oh dear, the threat has been carried out:Luke Leighton1-2/+2
the pre-alpha "domain group" etc parameters have disappeared. - interactive debug detection - re-added mem_man (andrew's memory management, detects memory corruption) - american spellings of "initialise" replaced with english spelling of "initialise". - started on "lookup_name()" and "lookup_sid()" functions. proper ones. - moved lots of functions around. created some modules of commonly used code. e.g the password file locking code, which is used in groupfile.c and aliasfile.c and smbpass.c - moved RID_TYPE_MASK up another bit. this is really unfortunate, but there is no other "fast" way to identify users from groups from aliases. i do not believe that this code saves us anything (the multipliers) and puts us at a disadvantage (reduces the useable rid space). the designers of NT aren't silly: if they can get away with a user- interface-speed LsaLookupNames / LsaLookupSids, then so can we. i spoke with isaac at the cifs conference, the only time for example that they do a security context check is on file create. certainly not on individual file reads / writes, which would drastically hit their performance and ours, too. - renamed myworkgroup to global_sam_name, amongst other things, when used in the rpc code. there is also a global_member_name, as we are always responsible for a SAM database, the scope of which is limited by the role of the machine (e.g if a member of a workgroup, your SAM is for _local_ logins only, and its name is the name of your server. you even still have a SID. see LsaQueryInfoPolicy, levels 3 and 5). - updated functionality of groupname.c to be able to cope with names like DOMAIN\group and SERVER\alias. used this code to be able to do aliases as well as groups. this code may actually be better off being used in username mapping, too. - created a connect to serverlist function in clientgen.c and used it in password.c - initialisation in server.c depends on the role of the server. well, it does now. - rpctorture. smbtorture. EXERCISE EXTREME CAUTION. (This used to be commit 0d21e1e6090b933f396c764af535ca3388a562db)
1998-10-23include/smb.h: Added #defines for lots of things - makes our code a *lot* ↵Jeremy Allison1-16/+26
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-22libsmb/smbdes.c: #ifdef'ed out code prior to removal.Jeremy Allison1-32/+60
rpc_client/cli_pipe.c: Inlined code removed from smbdes.c rpc_server/srv_samr.c: Fixed unused variable warning. rpc_server/srv_util.c: Inlined code removed from smbdes.c Luke - the above changes are the first part of the changes you and I discussed as being neccessary at the CIFS conference. *PLEASE REVIEW THESE CHANGES* - make sure I haven't broken any of the authenticated DCE/RPC code. smbd/nttrans.c: Fixed to allow NT5.0beta2 to use Samba shares with NT SMB support. smbd/open.c: Fixed mkdir when called from nttrans calls. smbd/server.c: Set correct size for strcpy of global_myworkgroup. Jeremy. (This used to be commit d891421d16ff80998dee429227bd391455f9d1a1)
1998-10-20smbd/nttrans.c smbd/trans2.c: First fixes for NT5.0beta2. That redirectorJeremy Allison1-1/+44
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-18check for lp_nt_pipe_support() in open callsAndrew Tridgell1-1/+1
(This used to be commit 44d901b3e040a520c4ad9089e68c566c78acacca)
1998-10-09basic client-side ntcreateX function (hard-wired values except filename)Luke Leighton1-1/+1
(This used to be commit caeb99201a1471bd709b4e8f07c57e5caabf0795)