summaryrefslogtreecommitdiffstats
path: root/source/smbd/open.c
Commit message (Collapse)AuthorAgeFilesLines
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Fixed display of "remote downlevel document" in old print job submissionJeremy Allison2002-01-251-1/+1
| | | | | case. Jeremy.
* don't use O_NONBLOCK in open(). This was added erroneously for kernelAndrew Tridgell2002-01-171-4/+0
| | | | oplocks and really shouldn't be used
* Added the O_NOFOLLOW flag if follow symlinks is set off.Jeremy Allison2002-01-121-0/+6
| | | | Jeremy.
* Moved fchown_acl change to the point where we *really* know if weJeremy Allison2001-12-161-10/+10
| | | | | created the file or not. Jeremy.
* Spelling pedents strike again :-).Jeremy Allison2001-11-281-1/+1
| | | | Jeremy.
* Ensure the CAN_WRITE is checked and prevents O_CREAT and O_TRUNC fromJeremy Allison2001-11-281-2/+2
| | | | | | being set. Also prevent an open on a file on a readonly share from setting delete on close. Jeremy.
* Re-added "Share modes" meaning don't allow deny mode conflict. Due toJeremy Allison2001-11-281-2/+10
| | | | | user demand (don't talk to me about removing parameters.... :-). Jeremy.
* Fix for the logic bug wrt. existant oplocks. See long messageJeremy Allison2001-11-271-5/+2
| | | | | in samba-technical for explaination. Jeremy.
* nsswitch/winbindd_group.c nsswitch/winbindd_user.c: formatting fixups.Jeremy Allison2001-11-271-1/+1
| | | | | smbd/open.c: Fix "delete on close" for directories. Jeremy.
* Fixed delete on close bug. Added core dump code to winbindd.Jeremy Allison2001-11-231-1/+22
| | | | Jeremy.
* Move from timestamp to gen count file id's for finding oplocked filesJeremy Allison2001-10-201-7/+2
| | | | | in a tdb. Jeremy.
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-2/+0
|
* Change log message to 2 from zero when failing to create directory.Jeremy Allison2001-09-241-1/+1
| | | | | Stops spurious profile creation messages. Jeremy.
* move to SAFE_FREE()Simo Sorce2001-09-171-9/+8
|
* use variables _before_ freeing them!Simo Sorce2001-09-151-3/+2
| | | | thanks to Andreas Moroder for spotting these two.
* fixed formatting to make the code vaguely readable. It's still a dogsAndrew Tridgell2001-09-051-142/+143
| | | | breakfast, but at least you can follow the indents
* converted smbd to use NTSTATUS by defaultAndrew Tridgell2001-08-271-4/+1
| | | | | | | | | | | | | | | | 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
* Missed '\' at eol...Jeremy Allison2001-08-221-1/+1
| | | | Jeremy.
* Tidyup fixes for fcntl spin problem.Jeremy Allison2001-08-221-3/+13
| | | | Jeremy.
* Fixed the (incorrect) paranioa fix I put in for the fcntl lock spin.Jeremy Allison2001-08-221-9/+35
| | | | | | Don't delete a share mode that failed to remove the oplock (doh!), just set the oplock entry to zero.... Jeremy.
* This is Jeremy pretending to be Volker, 'cos theVolker Lendecke2001-08-211-0/+10
| | | | | | | | | | | | | | | | | link from Seattle is having problems. I've added 3 things here to work on the fcntl spin problem. 1). Check *all* tdb return codes... :-). 2). If we're asking ourselves to break an oplock, and we can't find a fsp pointer that matches the entry, this is a *logic bug* and we should abort and panic so someone with gdb can pick up the pieces. 3). After we've broken an oplock, ensure that the entry itself has been removed, and if not remove it ourselves. This should not be neccessary in a correctly working environmen,t, but will provide an added layer of robustness in error situations. 4). I hate german keyboards :-) :-). Jeremy.
* We were making an assumption in the oplockJeremy Allison2001-07-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | | break code path that was invalid (ie. we were assuming we could infer a non-levelII oplock when such an oplock was detected - this may no longer be valid once we've processed the break process dealing with the break will change the state of it anyway. This prevents the state where we get the following packet trace : client server NTcreate -> <- NTcreate resp NTcreate -> <- break to level II ok - broken -> <- break to none Thanks to Alan Romeril for providing the trace that allowed me to track this down. Jeremy.
* Fix race where wrong action (created or opened) could be returned.Jeremy Allison2001-07-051-0/+8
| | | | Jeremy.
* strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell2001-07-041-2/+2
| | | | can't redefine them. damn.
* The big character set handling changeover!Andrew Tridgell2001-07-041-24/+2
| | | | | | | This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation.
* Fixed the first locking error (test #8 found by locktest code fromJeremy Allison2001-06-301-1/+1
| | | | | Clarion locktest. Jeremy.
* Extra debug in open.c, fix for bad debug message in reply.cJeremy Allison2001-06-191-2/+2
| | | | Jeremy.
* Removed mktemp from HEAD - same as done in 2.2.Jeremy Allison2001-04-181-1/+1
| | | | Jeremy.
* Finally got the semantics right (hurrah!).Jeremy Allison2001-04-161-6/+14
| | | | Jeremy.
* Correct fix for open readonly with truncate.Jeremy Allison2001-04-161-17/+18
| | | | Jeremy.
* This little piece of insanity is inspired by theJeremy Allison2001-04-141-3/+18
| | | | | | | | | | | | fact that an NT client can open a file for O_RDONLY, but set the create disposition to FILE_EXISTS_TRUNCATE. If the client *can* write to the file, then it expects to truncate the file, even though it is opening for readonly. Quicken uses this stupid trick in backup file creation... Thanks *greatly* to "David W. Chapman Jr." <dwcjr@inethouston.net> for helping track this one down. It didn't bite us in 2.0.x as we always opened files read-write in that release. Jeremy.
* configure:Jeremy Allison2001-04-141-7/+47
| | | | | | | | | | | | | | | | | | | | | | configure.in: include/config.h.in: include/profile.h: smbd/vfs-wrap.c: smbd/vfs.c: Added fchmod and fchown to VFS (sorry Gerald - but we needed them anyway). smbd/dosmode.c: smbd/files.c: printing/printfsp.c: smbd/close.c: smbd/open.c: Fixed "dos filemode" correctly so there are no race conditions. Forces test of open of file O_WRONLY before allowing fchmod as root. Afterwards, calls standard close function that preserves POSIX locks due to POSIX-me-harder braindamage. :-). Andrew please review this code. Also - in removing the tmpdir param in smbrun an extra NULL parameter was missed in each print_run_command() call (which is a varargs fn.). Now fixed. Jeremy.
* Fixed potential file descriptor leak with MS-Access fix.Jeremy Allison2001-04-131-1/+9
| | | | Jeremy.
* This is a big, rather ugly patch. Whilst investigating the files not truncatedJeremy Allison2001-03-301-6/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | when copying to a full disk problem, I discovered that we were not allowing the delete on close flag to be set properly, this led to other things, and after investigation of the proper delete on close semantics and their relationship to the file_share_delete flag I discovered there were some cases where we weren't doing the deny modes properly. And this after only 5 years working on them..... :-) :-). So here's the latest attempt. I realised the delete on close flag needs to be set across all smbds with a dev/ino pair open - in addition, the delete on close flag, allow share delete and delete access requested all need to be stored in the share mode tdb. The "delete_on_close" entry in the fsp struct is now redundant and should really be removed. This may also mean we can get rid of the "iterate_fsp" calls that I didn't like adding in the first place. Whilst doing this patch, I also discovered we needed to do the se_map_generic() call for file opens and POSIX ACL mapping, so I added that also. This code, although ugly, now passes the deny mode torture tests plus the delete on close tests I added. I do need to add one more multiple connection delete on close test to make sure I got the semantics exactly right, plus we should also (as Andrew suggested) move to random testing here. The good news is that NT should now correctly delete the file on disk full error when copying to a disk :-). Jeremy.
* smbd/posix_acls.c: Saving and restoring errno here is the wrong place. Moved itJeremy Allison2001-03-261-3/+6
| | | | | to the places where [f]chmod_acl is called instead. Jeremy.
* Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison2001-03-111-4/+0
| | | | | | RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy.
* Sync up with POSIX ACL code from 2.2.Jeremy Allison2001-01-241-0/+7
| | | | Jeremy.
* include/vfs.h:Jeremy Allison2001-01-231-2/+2
| | | | | | | | | | | | | smbd/vfs-wrap.c: smbd/vfs.c: Added fchmod_acl and chmod_acl. lib/substitute.c: smbd/lanman.c: smbd/open.c: smbd/process.c: smbd/reply.c: smbd/service.c: Removed sessetup_user variable. Added current_user_info struct which conatins domain info etc. Added '%D' for client domain parameter. Jeremy.
* Fixed very subtle bug returning correct error on an open, when we haveJeremy Allison2000-12-111-8/+22
| | | | | | | a choice of invalid share mode and access denied. We must return the access denied by preference, but also remember to break the oplocks... This is needed for multi-user MS-Access. Jeremy.
* Fix for vfs_fstat() crash with new stat code.Jeremy Allison2000-10-201-0/+3
| | | | Jeremy.
* Ok - this is a big patch - and it may break smbd a bit (althoughJeremy Allison2000-10-191-52/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | I hope not). If you encounter strange file-serving behavior after this patch then back it out. I analysed our stat() usage and realised we were doing approx. 3 stat calls per open, and 2 per getattr/setattr. This patch should fix all that. It causes the stat struct returned from unix_convert() (which now *must* be passed a valid SMB_STRUCT_STAT pointer) to be passed through into the open code. This should prevent the multiple stats that were being done so as not to violate layer encapsulation in the API's. Herb - if you could run a NetBench test with this code and do a padc/par syscall test and also run with the current 2.2.0 code and test the padc/par syscalls I'd appreciate it - you should find the number of stat calls reduced - not sure by how much. The patch depends on unix_convert() actually finding the file and returning a stat struct, or returning a zero'd out stat struct if the file didn't exist. I believe we can guarentee this to be the case - I just wasn't confident enough to make this an assertion before. Ok ok - I did write this whilst at the Miami conference..... sometimes you get a little free time at these things :-). Jeremy.
* Restructuring of vfs layer to include a "this" pointer - can be an fsp orJeremy Allison2000-10-061-7/+7
| | | | | | | | | | | | | | | a conn struct depending on the call. We need this to have a clean NT ACL call interface. This will break any existing VFS libraries (that's why this is pre-release code). Andrew gets credit for this one :-) :-). In addition - added Herb's WITH_PROFILE changes - Herb - please examine the changes I've made to the smbd/reply.c code you added. The original code was very ugly and I have replaced it with a START_PROFILE(x)/END_PROFILE(x) pair using the preprocessor. Please check this compiles ok with the --with-profile switch. Jeremy.
* utf-8 and EUC3 patch from Hiroshi Miura Samba User Group Japan staff.Jeremy Allison2000-10-031-2/+1
| | | | | mkdir high bits patch from Robert Dahlem" <Robert.Dahlem@gmx.net>. jeremy.
* open files with O_NONBLOCK when available. This is necessary toAndrew Tridgell2000-06-151-1/+6
| | | | | | | prevent possible deadlocks with kernel leases and harmless when kernel leases are not used. basically we don't ever want smbd to block
* added support for kernel level share modes. These are a (small) hack,Andrew Tridgell2000-06-151-1/+24
| | | | | I suspect we will either get rid of them or do them properly at some stage.
* Check fstat return for error.Jeremy Allison2000-05-121-1/+5
| | | | Jeremy.
* more merging voodooAndrew Tridgell2000-05-101-0/+4
| | | | | | 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
* Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison2000-05-021-2/+2
| | | | | of doing a system call every time we want to just get our pid. Jeremy.
* Made changes suggested by Andrew review.Jeremy Allison2000-04-281-15/+1
| | | | | | | fd_close now calls fd_close_posix() directly. set_posix_lock/release_posix_lock() now handle the reference counting. More changes due when this gets moved to the file locking/posix.c Jeremy.