1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-30 13:18:05 +03:00
Commit Graph

100 Commits

Author SHA1 Message Date
Günther Deschner
c6ebab846d s3: only include gen_ndr headers where needed.
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time
as follows:

ccache build w/o patch
real    4m21.529s
ccache build with patch
real    3m6.402s

pch build w/o patch
real    4m26.318s
pch build with patch
real    3m6.932s

Guenther
2010-05-06 00:22:59 +02:00
Jeremy Allison
7984243768 Move to using 64-bit mid values in our internal open file database.
This will allow us to share logic much easier between SMB1 and SMB2
servers.

Jeremy
2010-04-12 21:40:28 -07:00
Volker Lendecke
d1c34d4054 s3: Replace some create_synthetic_smb_fname() calls
In very hot codepaths like the statcache copy_smb_filename and the subsequent
recursive talloc_free is noticable in the CPU load.
2009-11-18 23:16:13 +01:00
Stefan Metzmacher
47452b8cec s3:smbd: add smbd_notify_cancel_by_smbreq()
This function will be used by the SMB2 notify code.

metze
2009-08-17 09:25:45 +02:00
Tim Prouty
5a8d70d465 s3: Change fsp->fsp_name to be an smb_filename struct! 2009-07-20 17:26:56 -07:00
Stefan Metzmacher
b804c30856 s3:smbd: make change_notify_reply() more generic and hide send_nt_replies() behind a callback
This prepares change notify support for SMB2.

metze
2009-07-02 09:11:01 +02:00
Stefan Metzmacher
ef96e8c958 s3:smbd: simplify the notify code a bit and always reply via change_notify_reply() -> send_nt_replies()
metze
2009-07-02 09:11:00 +02:00
Stefan Metzmacher
f62a331045 s3:smbd: move global notify_changes_by_mid to smbd_server_connection
metze
2009-07-02 09:10:58 +02:00
Tim Prouty
e129384d7c s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTAT
This patch introduces two new temporary helper functions
vfs_stat_smb_fname and vfs_lstat_smb_fname.  They basically allowed me
to call the new smb_filename version of stat, while avoiding plumbing
it through callers that are still too inconvenient.  As the conversion
moves along, I will be able to remove callers of this, with the goal
being to remove all callers.

There was also a bug in create_synthetic_smb_fname_split (also a
temporary utility function) that caused it to incorrectly handle
filenames with ':'s in them when in posix mode.  This is now fixed.
2009-06-24 21:15:25 -07:00
Volker Lendecke
32a36e4703 Add notify_onelevel.tdb
This optimizes non-recursive notifys. For non-recursive notifies we can use a
per-directory file-id indexed notify record. This matters for the Windows
Explorer and IIS cases which do not use recursive notifies. In these cases, we
do not have to shuffle around the whole notify record on every change.

For the cluster case, this improves correctness of the notifies, ctdb only
distributes the tdb seqnum once a second, so we can lose notifies.
2009-04-16 15:07:06 +02:00
Volker Lendecke
94d3047de1 Use convert_string_talloc, thanks Andrew! 2009-04-13 09:30:18 +02:00
Volker Lendecke
5fc9ca93f3 Fix a memleak in an unlikely error path in change_notify_create() 2009-04-11 11:06:21 +02:00
Volker Lendecke
ea6094d2cb Use talloc_tos() for a temp convert_string_allocate() 2009-04-11 11:06:21 +02:00
Stefan Metzmacher
c16c90a1cb s3:smbd: use new simplified snb_signing code in the server
We keep the seqnum/mid mapping in the smb_request structure.

This also moves one global variable into the
smbd_server_connection struct.

metze
2009-03-23 12:21:13 +01:00
Steven Danneman
9a90cbea83 s3: Make change notify immediately return a catch-all packet on underlying error
* This allows a problem in the underlying CN backend to be bubbled up
  to the general CN layer so a catch-all reply can be returned
* We now also return a catch-all response immediately if the server-side
  event queue becomes too big
2009-02-20 14:10:30 -08:00
Steven Danneman
b329ea1cf3 s3: Modifications to generic notify structures to allow implementation of OneFS notify.
The OneFS kernel based change notify system takes an fd of the directory
to watch in it's initialization syscall.  Since we already have this
directory open, this commit plumbs that fd down to the VFS layer via the
notify_entry struct.

We also need to know if the watch is taken out on a snapshot directory.
The full file_id struct is also passed down to make this determination.
The file_id marshalling wrappers are hand written here, but should
eventually be auto-generated by moving the struct file_id into the idl.
2009-02-20 14:10:30 -08:00
todd stecher
54c51a66e3 S3: New module interface for SMB message statistics gathering
This changelist allows for the addition of custom performance
monitoring modules through smb.conf. Entrypoints in the main message
processing code have been added to capture the command, subop, ioctl,
identity and message size statistics.
2009-02-09 13:23:44 -08:00
Stefan Metzmacher
3dde0cbb76 s3:smbd: move all globals and static variables in globals.[ch]
The goal is to move all this variables into a big context structure.

metze
2009-01-08 12:22:21 +01:00
Dina Fine
0e62bb39de Fix bug #5908 - Samba 3.0.32 - internal change notify on share directory fails" 2008-11-18 12:45:42 -08:00
Volker Lendecke
87d4138d09 Converting notify.c to store a request, not an inbuf 2008-11-08 10:42:20 +01:00
Volker Lendecke
b8125663d9 Make "inbuf" a talloc child of "smb_request" for normal smb requests
This is necessary if we want to keep the whole smb_request for deferred ops.
The explicit settings of req->inbuf will be removed once all those deferring
operations are converted to store the whole request and not just the inbuf.
2008-11-04 20:52:06 +01:00
Volker Lendecke
d314f7eab5 Add some debug to notify
(This used to be commit 4394235378)
2008-06-17 10:48:40 +02:00
Tim Prouty
bb869741dd Cleanup size_t return values in convert_string_allocate
This patch is the first iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
(This used to be commit 59124382d2)
2008-04-11 11:33:33 +02:00
Marc VanHeyningen
e06aa46b9f Coverity fixes
(This used to be commit 3fc85d2259)
2008-03-17 20:52:25 +01:00
Jeremy Allison
9f75099657 Fix CID 505 - don't copy uninitialized memory.
Jeremy.
(This used to be commit 0d2c77e8d3)
2008-01-11 23:17:23 -08:00
Jeremy Allison
3f55798be0 ensure uni_name.buffer is initialised
merge from http://samba.org/~tridge/3_0-ctdb

Jeremy.
(This used to be commit dec77b387c)
2008-01-08 22:48:22 -08:00
Jeremy Allison
9254bb4ef1 Refactor the crypto code after a very helpful conversation
with Volker. Mostly making sure we have data on the incoming
packet type, not stored in the smb header.
Jeremy.
(This used to be commit c4e5a50504)
2008-01-04 12:56:23 -08:00
Jeremy Allison
afc93255d1 Add SMB encryption. Still fixing client decrypt but
negotiation works.
Jeremy.
(This used to be commit d78045601a)
2007-12-26 17:12:36 -08:00
Jeremy Allison
c3250149e1 Add new parameter, "min receivefile size" (by default set
to zero). If non-zero, writeX calls greater than this
value will be left in the socket buffer for later handling
with recvfile (or userspace equivalent). Definition of
recvfile for your system is left as an exercise for
the reader (I'm working on getting splice working :-).
Jeremy.
(This used to be commit 11c03b75dd)
2007-10-30 16:22:24 -07:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
Volker Lendecke
929e1d9920 r24809: Consolidate the use of temporary talloc contexts.
This adds the two functions talloc_stackframe() and talloc_tos().

 * When a new talloc stackframe is allocated with talloc_stackframe(), then
 * the TALLOC_CTX returned with talloc_tos() is reset to that new
 * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse
 * happens: The previous talloc_tos() is restored.
 *
 * This API is designed to be robust in the sense that if someone forgets to
 * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and
 * resets the talloc_tos().

The original motivation for this patch was to get rid of the
sid_string_static & friends buffers. Explicitly passing talloc context
everywhere clutters code too much for my taste, so an implicit
talloc_tos() is introduced here. Many of these static buffers are
replaced by a single static pointer.

The intended use would thus be that low-level functions can rather
freely push stuff to talloc_tos, the upper layers clean up by freeing
the stackframe. The more of these stackframes are used and correctly
freed the more exact the memory cleanup happens.

This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and
lp_talloc_ctx (did I forget any?)

So, never do a

tmp_ctx = talloc_init("foo");

anymore, instead, use

tmp_ctx = talloc_stackframe()

:-)

Volker
(This used to be commit 6585ea2cb7)
2007-10-10 12:30:24 -05:00
Volker Lendecke
f65041cbf1 r24512: Fix RAW-NOTIFY
With the inbuf consistency checks we have to more correctly fake the
inbuf
(This used to be commit 2b8ecda30f)
2007-10-10 12:29:53 -05:00
Volker Lendecke
52a738301a r24400: Fix a valgrind bug
(This used to be commit 7c65deaed7)
2007-10-10 12:29:40 -05:00
Volker Lendecke
6a5bdb79e1 r24399: Change change_notify_reply to use send_nt_replies_new
(This used to be commit be67bb50ee)
2007-10-10 12:29:40 -05:00
Volker Lendecke
b41b38031f r24398: Convert call_nt_transact_notify_change to the new API
(This used to be commit 607b3ab8bc)
2007-10-10 12:29:40 -05:00
Volker Lendecke
3c5811c272 r24314: Attempt to fix bug 4868
(This used to be commit 0ced8fcfe1)
2007-10-10 12:29:27 -05:00
Jeremy Allison
921ac7da4f r23941: Don't use "False" when you mean "MARSHALL".
Jeremy.
(This used to be commit 57d4d5f2cd)
2007-10-10 12:28:47 -05:00
Jeremy Allison
cf09627894 r23940: Added missing line that was deleted accidently.
Should fix the build.
Jeremy.
(This used to be commit b085366d5b)
2007-10-10 12:28:47 -05:00
Jeremy Allison
ed9e0d9a3a r23939: Fixes for notify returns. Returned param value must fix inside
max_param or return NT_STATUS_OK.
Jeremy.
(This used to be commit ab4af60d1a)
2007-10-10 12:28:47 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Jeremy Allison
10c83ace04 r23735: Second part of the bugfix for #4763
This should coalesce identical adjacent notify records - making the "too large"
bug very rare indeed. Please test.
Jeremy.
(This used to be commit 1aaa1f5bbe)
2007-10-10 12:23:50 -05:00
Jeremy Allison
35d09869ed r23728: First part of bugfix for #4763. Limit notify responses
to client max buf size.
Jeremy.
(This used to be commit 6113f56919)
2007-10-10 12:23:49 -05:00
Volker Lendecke
32ba5145b8 r23518: Remove the silly assumption that string_replace requires a pstring.
Jeremy, I am always very confused about the different length arguments
in convert_string and friends. Can you take a look at the change in
string_replace and verify it's ok? Thanks!

While at it, remove the pstring limit for strhasupper and strhaslower.
(This used to be commit e6e5703658)
2007-10-10 12:23:25 -05:00
James Peach
b1ce226af8 r23510: Tidy calls to smb_panic by removing trailing newlines. Print the
failed expression in SMB_ASSERT.
(This used to be commit 171dc060e2)
2007-10-10 12:23:23 -05:00
Jeremy Allison
28bc066aa8 r23450: max_params_return is complete fiction when getting a changenotify
request. Ignore it. Should fix bug #4689 but more tests and
valgrinding will follow.
Jeremy.
(This used to be commit c23e08cc09)
2007-10-10 12:23:17 -05:00
Volker Lendecke
87d18ac488 r22755: Second half of r22754. As it stands now, string_replace expects a
pstring. Give it one, although I hate putting it in :-)

Thanks to Tom Bork! :-)
(This used to be commit f4ea3fd365)
2007-10-10 12:21:54 -05:00
Jeremy Allison
0829e1ad1c r22391: Looks bigger than it is. Make "inbuf" available
to all callers of smb_setlen (via set_message()
calls). This will allow the server to reflect back
the correct encryption context.
Jeremy.
(This used to be commit 2d80a96120)
2007-10-10 12:19:30 -05:00
Volker Lendecke
0d0e322d4d r21123: Make notify_fsp() static to notify.c.
Volker
(This used to be commit d663b729c0)
2007-10-10 12:17:41 -05:00