summaryrefslogtreecommitdiffstats
path: root/source/smbd
Commit message (Collapse)AuthorAgeFilesLines
* Fix the offset checks in the trans routinesVolker Lendecke2008-11-173-9/+9
| | | | | | | This fixes a potential crash bug, a client can make us read memory we should not read. Luckily I got the disp checks right... Volker
* Revert "Fix bug #5783 FindFirst fails where search pattern == mangled filename."Karolin Seeger2008-11-172-8/+8
| | | | This reverts commit fc9247572e0ace4956845e279c63c9d00fa667bd.
* Revert "Fix bug #5790 samba returns STATUS_OBJECT_NAME_NOT_FOUND on set file ↵Karolin Seeger2008-11-171-2/+4
| | | | | | disposition." This reverts commit 24348e2e028f8f63c7acad33f2f9a362a3d3fdc0.
* Revert "Fix bug #5797 - Moving readonly files fails. Reported by ↵Karolin Seeger2008-11-171-1/+3
| | | | | | infomail@lordb.de." This reverts commit 7292c322ca70e9df82e020f45f1510e9ca02efbc.
* Revert "Second part of the fix for bug #5790 - samba returns ↵Karolin Seeger2008-11-171-6/+4
| | | | | | STATUS_OBJECT_NAME_NOT_FOUND on set file disposition call." This reverts commit e73c090b5ff624f71ce827c494cd71ca73144ba9.
* Revert "Fix the make test problem Karolin reported. Now rename_open_files ↵Karolin Seeger2008-11-171-2/+2
| | | | | | actually works correctly we must emit the change notify before we change the name, not before." This reverts commit ac2046979cacf96f8d4df7c5ece06e55d51758c8.
* Revert "Fix use of DLIST_REMOVE as spotted by Constantine Vetoshev ↵Karolin Seeger2008-11-171-1/+1
| | | | | | <gepardcv@gmail.com>." This reverts commit 8443b4859f64aa5459976ce37ca96a90daae889a.
* Revert "Fix bug 5691: SIGBUS on Solaris"Karolin Seeger2008-11-171-4/+1
| | | | This reverts commit 41b2199fd87598076a1f45106b512c94042f7968.
* Revert "Note url explaining this code."Karolin Seeger2008-11-171-4/+0
| | | | This reverts commit 9953885d0be6a2477f5fd29940f3f1d6a7136cf4.
* Revert "Cope with bad trans2mkdir requests from System i QNTC IBM SMB client."Karolin Seeger2008-11-171-4/+3
| | | | This reverts commit feb057d4503118e519b5dbd9d2c3ca2c1ee55380.
* Cope with bad trans2mkdir requests from System i QNTC IBM SMB client.Jeremy Allison2008-10-211-3/+4
| | | | | | | | | If total_data == 4 Windows doesn't care what values are placed in that field, it just ignores them. The System i QNTC IBM SMB client puts bad values here, so ignore them. Jeremy. (cherry picked from commit 5b1d8588d01d11251541829c5a3dff211fe925fd)
* Note url explaining this code.Jeremy Allison2008-10-151-0/+4
| | | | | Jeremy. (cherry picked from commit 4f1cdfe0901f4c78dff56ae5c26d2801b97d50d5)
* Fix bug 5691: SIGBUS on SolarisVolker Lendecke2008-10-151-1/+4
| | | | (cherry picked from commit 0f3f34033a80e44fa18cae452a164e445392138a)
* Fix use of DLIST_REMOVE as spotted by Constantine Vetoshev <gepardcv@gmail.com>.Jeremy Allison2008-10-061-1/+1
| | | | | | | | | | | | | | | | | | This API is unusual in that if used to remove a non-list head it nulls out the next and prev pointers. This is what you want for debugging (don't want an entry removed from the list to be still virtually linked into it) but means there is no consistent idiom for use as the next and prev pointers get trashed on removal from the list, meaning you must save them yourself. You can use it one way when deleting everything via the head pointer, as this preserves the next pointer, but you *must* use it another way when not deleting everything via the head pointer. Fix all known uses of this (the main one is in conn_free_internal() and would not free all the private data entries for vfs modules. The other changes in web/statuspage.c and winbindd_util.c are not strictly neccessary, as the head pointer is being used, but I've done them for consistency. Long term we must revisit this as this API is too hard to use correctly. Jeremy. (cherry picked from commit 347fc4ed725083f2c520afc39f7c81db0dd60324)
* Fix the make test problem Karolin reported. Now rename_open_files actually ↵Jeremy Allison2008-10-061-2/+2
| | | | | | | works correctly we must emit the change notify before we change the name, not before. Jeremy. (cherry picked from commit 10ae99d86c0c90bee9a0538854f6f96fc7cbbc23)
* Second part of the fix for bug #5790 - samba returns ↵Jeremy Allison2008-10-061-4/+6
| | | | | | | | STATUS_OBJECT_NAME_NOT_FOUND on set file disposition call. This was my fault. I use a singleton cache (positive and negative) to speed up pathname based qfileinfo/setfileinfo lookups for alternate fsp's open on the same path. I only invalidated the negative cache on adding a new file fsp, as I incorrectly imagined the new fsp was put at the *end* of the open files list. DLIST_ADD puts it at the start, meaning any subsequent open wasn't seen once the cache was set. Doh ! Jeremy. (cherry picked from commit a7fd59a26bfc4a98b6936dc3ac8e67e1a7cb3733)
* Fix bug #5797 - Moving readonly files fails. Reported by infomail@lordb.de.Jeremy Allison2008-10-061-3/+1
| | | | | | | | | We don't need to deny a DELETE open on a readonly file (I'm also adding a s4 torture test for this), the set_file_disposition call will return NT_STATUS_CANNOT_DELETE if the delete-on-close bit is set on a readonly file (and we already do this). Jeremy. (cherry picked from commit dd43302066b2d3f5270d3ee25a1e2c85d8ce2b85)
* Fix bug #5790 samba returns STATUS_OBJECT_NAME_NOT_FOUND on set file ↵Jeremy Allison2008-10-061-4/+2
| | | | | | | | | disposition. We were checking that fd != -1 in file_find_di_XXX calls which is no longer needed due to a change in internal semantics. Jeremy. (cherry picked from commit bd7acd6344022e87495edc124e262eb50ba5ebd8)
* Fix bug #5783 FindFirst fails where search pattern == mangled filename.Jeremy Allison2008-10-062-8/+8
| | | | | | That was an old and subtle bug. Jeremy. (cherry picked from commit c412888f916563c44c4c753884df23c1951f6e27)
* Fix aio on FreeBSD.Timur2008-09-161-1/+16
| | | | (cherry picked from commit 144b1bb05a734e15369d6d59636b6849d9405af5)
* Fix cut and paste error in quota code.Timur2008-09-161-2/+2
| | | | (cherry picked from commit c2a05d4ed34aa8185a7d236e8d7b1493d67a3068)
* Fix bug 5761 "open of mangled directory name results in 'is a stream name'"Jeremy Allison2008-09-161-3/+7
| | | | | | reported by Regan Heath <Regan.Heath@BridgeHeadSoftware.com>. Jeremy. (cherry picked from commit 1b839eb9e4a6312e638d1856d1225b170525da7e)
* Modify a comment to make things clearer.Jeremy Allison2008-09-151-1/+3
| | | | | Jeremy. (cherry picked from commit 46a5c08b101f1c218ecd6397614dde1d13a9077a)
* Fix bug #5052 - not work cancel inheritance on share. We wereJeremy Allison2008-09-111-3/+10
| | | | | | | using the parent security descriptor type and flags instead of using the passed in SD. Jeremy. (cherry picked from commit c22bf57329f16a45eb0954b72f8083270f6535e7)
* When requesting UNIX info levels on findfirst/findnext, don't play games ↵Jeremy Allison2008-09-111-1/+5
| | | | | | | | with write time, just return what the underlying filesystem says. Trying not to confuse UNIX apps any more than necessary. Jeremy. (cherry picked from commit 4e06c71a12654d78c9a94fb023e372920bf7618b)
* Fix calculation of useable_space for trans2 and nttrans repliesVolker Lendecke2008-09-092-18/+19
| | | | | | | When alignment was in place, we pretended to send more data/params according to the param_offset/param_length and data_offset/data_length parameters than would actually fit into the SMB according to the NBSS length field. (cherry picked from commit 2ae870aead5e0ea7e7f9f6f9730f989ae34755b9)
* smbd: some write time fixesStefan Metzmacher2008-09-091-8/+7
| | | | | | | | | | | | | | | - only the first non truncating write causes the write time update with 2 seconds delay. It's not enough to check for an existing update event as it will be NULL after the event was triggered. - SMBwrite truncates always update the write time unless the sticky write time is set. - SMBwrite truncates don't trigger a write time update on close. metze (cherry picked from commit 142a9703ae19a467a23ee72429f899dae156df64)
* Write times code update.Jeremy Allison2008-09-094-35/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ok, here's the fix for the write times breakage with the new tests in S4 smbtorture. The key is keeping in the share mode struct the "old_file_time" as the real write time, set by all the write and allocation calls, and the "changed_write_time" as the "sticky" write time - set by the SET_FILE_TIME calls. We can set them independently (although I kept the optimization of not setting the "old_file_time" is a "changed_write_time" was already set, as we'll never see it. This allows us to update the write time immediately on the SMBwrite truncate case, SET_END_OF_FILE and SET_ALLOCATION_SIZE calls, whilst still have the 2 second delay on the "normal" SMBwrite, SMBwriteX calls. I think in a subsequent patch I'd like to change the name of these from "old_file_time" to "write_time" and "changed_write_time" to "sticky_write_time" to make this clearer. I think I also fixed a bug in Metze's original code in that once a write timestamp had been set from a "normal" SMBwriteX call the fsp->update_write_time_triggered variable was set and then never reset - thus meaning the write timestamp would never get updated again on subsequent SMBwriteX's. The new code checks the update_write_time_event event instead, and doesn't update is there's an event already scheduled. Metze especially, please check this over for your understanding. Jeremy. (cherry picked from commit f2fb6321b6666a30ca7fa11bc8d395f1a1865bb2)
* Fix Coverity ID 587Volker Lendecke2008-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | The following test program prints "8" on 64-bit :-) static void print_size(const char lenbuf[4]) { printf("sizeof(lenbuf) = %d\n", (int)sizeof(lenbuf)); } int main(void) { const char lenbuf[4]; print_size(lenbuf); return 0; } Jeremy, please check :-) Volker (cherry picked from commit 9daea0ccfdda58450be3c9a9a94c016f5900c319) (cherry picked from commit 11fdeeeb551ac3287b75e114b15bc4f76cf2d337)
* Add st_birthtime and friends for accurate create times on systems that ↵Jeremy Allison2008-09-011-3/+4
| | | | | | | | support it (*BSD and MacOSX). This really needs to be in 3.2.x. Should have done this ages ago, sorry. Jeremy. (cherry picked from commit 0cba30073410ba499834ac26dee3f81a75c8de4f)
* become root for AIO operationsAndrew Tridgell2008-08-281-1/+7
| | | | | | | We need to become root for AIO read and write to allow the AIO thread to send a completion signal to the parent process when the IO completes (cherry picked from commit 27b1ae601542ebe2e23ab4ff81eb14f8e03a3caf)
* EINVAL is also a valid error return, meaning "this filesystemAndrew Tridgell2008-08-281-2/+3
| | | | | cannot do sendfile for this file" (cherry picked from commit dc04b5adf7569b3501cb95f86d01e00276b41c23)
* Don't re-initialize a token when we already have one. This fixes the build ↵Jeremy Allison2008-08-281-10/+13
| | | | | | | | farm failures when winbindd connects as guest. This one took a *lot* of tracking down :-). Jeremy. (cherry picked from commit f845c95dcfa0b1630a0057c62941bb8a72ebdd83)
* smbd: fix the handling of create_options to pass RAW-OPENStefan Metzmacher2008-08-282-0/+17
| | | | | | | | | | Some of the bits generate INVALID_PARAMETER and some bits are ignored when they come from a client, that's why we need to use bits from the ignored range for our internal usage. metze (cherry picked from commit 7b4c8a4e39f310eb450918fa841b0ea1b4af19f7) (cherry picked from commit 3366ac2857820d87fb36a1357786a3564d258da5)
* Revert "smbd: fix the handling of create_options to pass RAW-OPEN"Karolin Seeger2008-08-272-17/+0
| | | | This reverts commit ebd1f8f9297b31353d094ddccc320a83f02877ce.
* Revert "Don't re-initialize a token when we already have one. This fixes the ↵Karolin Seeger2008-08-271-13/+10
| | | | | | build farm failures when winbindd connects as guest." This reverts commit a90648e905aebc98c78897adf76729bea269cedf.
* Don't re-initialize a token when we already have one. This fixes the build ↵Jeremy Allison2008-08-221-10/+13
| | | | | | | | farm failures when winbindd connects as guest. This one took a *lot* of tracking down :-). Jeremy. (cherry picked from commit f845c95dcfa0b1630a0057c62941bb8a72ebdd83)
* smbd: fix the handling of create_options to pass RAW-OPENStefan Metzmacher2008-08-212-0/+17
| | | | | | | | | | Some of the bits generate INVALID_PARAMETER and some bits are ignored when they come from a client, that's why we need to use bits from the ignored range for our internal usage. metze (cherry picked from commit 7b4c8a4e39f310eb450918fa841b0ea1b4af19f7) (cherry picked from commit 3366ac2857820d87fb36a1357786a3564d258da5)
* Fix for bug #5688 from SATOH Fumiyasu <fumiyas@osstech.co.jp>. LPQ process ↵Jeremy Allison2008-08-141-1/+2
| | | | | | | | is orphaned if socket address parameter is invalid. If the "socket address" parameter is a null string that is an invalid value for Samba 3.2 but valid for Samba 3.0. Jeremy. (cherry picked from commit a46dc151f692e6b4bd14d3881f90bca5fe5b9474)
* Fix for bug #5617, reported and patched by Bartosz Antosik antosik@gmail.com.Jeremy Allison2008-08-141-0/+2
| | | | | | | xp/2003 explorer freezes browsing shares on samba ipv6 hosts. Caused by missing reply packet to SMB printclose packet. Jeremy (cherry picked from commit 93c977e80594e20ebd562b1eb8a03d57b9299461)
* I found lots of places where we assume error will be set when callingAndrew Tridgell2008-08-131-2/+2
| | | | | | | | | | | | | | | | one of our virtualised functions, such as db_open(), but error is only set when a system call fails, and it is not uncommon for us to fail a function internally without ever making a system call. That led to us passing back success when a function had in fact failed. I found two places where we relied on map_nt_error_from_unix() returning success when errno==0, but lots and lots of places where we relied on the reverse, so I fixed those two places. map_nt_error_from_unix() will now always return an error, returning NT_STATUS_UNSUCCESSFUL if errno is 0 (cherry picked from commit 69d40ca4c1af925d4b0e59ddc69ef8c26e6501d1) (cherry picked from commit 8c66020a82d9b92fb10d14359b1381d58ad4972b)
* Fix unix_convert() for "*" after changing map_nt_error_from_unix().Michael Adam2008-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | map_nt_error_from_unix() now assumes that it is called in an error path and returns an error even for a given errno == 0. The original behaviour of unix_convert() used the mapping of errno == 0 ==> NT_STATUS_OK to return success through an error path. I think this must have been an oversight, and unix_convert() worked only by coincidence (or because explicitly using the knowledge of the conceptually wrong working of map_nt_error_from_unix(). This patch puts this straight by not interpreting errno == 0 as an error condition and proceeding in that case. Jeremy - please check! Michael (cherry picked from commit 736bdf15d934028b579a02dc411aed6c14a437f3)
* Make sure to always set errno on error path in OpenDir (and hence ↵Michael Adam2008-08-131-0/+1
| | | | | | | scan_directory). Michael (cherry picked from commit 06304f3c5f538c75bfc63c7abc1457d2b4dc0f0b)
* fix smb_len calculation for chained requestsVolker Lendecke2008-08-111-3/+5
| | | | | | I think chain_reply() is one of the most tricky parts of Samba. This recursion needs to go away, we need to sequentially walk the chain list. (cherry picked from commit 34b56cb54e06f9b38d2bb0a626ec7b04030fc4fa)
* Fix andx offset calculation for more than 2 chained requestsVolker Lendecke2008-08-111-1/+7
| | | | | | Untested code is broken code.... Test follows later, it's quite an intrusive change to libsmb/ (cherry picked from commit 2abeea64e15f0e8e8c413744de9194bdcedd6f16)
* Fix bug creating files using DOS clients with mixedJeremy Allison2008-07-281-1/+1
| | | | | | | | | | case files. Reported by Daniel Johnson <Progman2000@usa.net>. The smb_set_file_time() call to set the filetimes is failing because it's using the unmodified name passed in by the client, not the modified name (matching case on the disk) that comes out from create_file(). Jeremy. (cherry picked from commit d54fe83b16c187847a975df373e73d56111d7f21)
* If we're not allowing streams on this conn ptr,Jeremy Allison2008-07-251-0/+5
| | | | | | | then don't allow create_file() to call down to create_file_unixpath() with a stream name. Jeremy. (cherry picked from commit 7f749a10eff0bb469e6eb50b02cb60fd65c23f9e)
* Patch from SATOH Fumiyasu <fumiyas@osstech.co.jp> for bug #5202. Re-activate ↵Jeremy Allison2008-07-061-14/+26
| | | | | | | | "acl group control" parameter and make it only apply to owning group. Also added man page fix. Jeremy. (cherry picked from commit 93e91e5364a7f131d988648cf5fe822a9bd68734)
* Two more fixes from Jim Brown <jim.brown@miami.edu> for SGI compiler warnings.Jeremy Allison2008-07-061-1/+1
| | | | | Jeremy. (cherry picked from commit 8dd833b908cc8d4c0aa34cdece014d0e160aaf9e)
* Sorry volker, lost your original git-id due to proto.h conflicts.Jeremy Allison2008-06-241-11/+11
| | | | | | | | | | | | | Remove the "exists" parameter from create_msdfs_link Jeremy, setting "exists" to True in _dfs_Add prevented the initial creation of a new symlink for me, because the SMB_VFS_UNLINK failed. This also exists in 3.2. I only check it into 3.3 as I would like you to look at it first. Thanks, Volker (cherry picked from commit 47e66814c176d597d9a3c165a7cfa6a5a2fd70be)