1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-12 04:23:49 +03:00
Commit Graph

289 Commits

Author SHA1 Message Date
Volker Lendecke
883f741576 Get the inbuf on talloc_tos() 2008-01-12 21:09:43 +01:00
Jeremy Allison
bc932b8ad4 Make use of talloc_pool in the main codepaths. Remove the sub-contexts.
Jeremy.
2008-01-09 17:11:04 -08:00
Jeremy Allison
8f36def18e Now conn is part of smb_request, we don't need it as
an extra parameter. This cleans up quite a few places
we were passing it around without needing it.
Jeremy.
2008-01-04 15:37:24 -08:00
Jeremy Allison
c4e5a50504 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.
2008-01-04 12:56:23 -08:00
Jeremy Allison
d241bfa577 Add the capability to set "smb encrypt = required"
on a share (or global) and have the server reply with
ACCESS_DENIED for all non-encrypted traffic (except
that used to query encryption requirements and set
encryption state).
Jeremy.
2007-12-27 23:51:03 -08:00
Jeremy Allison
d78045601a Add SMB encryption. Still fixing client decrypt but
negotiation works.
Jeremy.
2007-12-26 17:12:36 -08:00
Jeremy Allison
c378c3edc1 Remove last_message completely as it's no longer used.
Jeremy.
2007-12-18 18:10:09 -08:00
Jeremy Allison
c15819b757 Three more pstring removals.
Jeremy.
2007-11-11 21:46:52 -08:00
Volker Lendecke
0a1f524e8c Fix some warnings 2007-11-09 15:16:26 +01:00
Jeremy Allison
255c2adf7b Remove the horror that was the global smb_rw_error.
Each cli struct has it's own local copy of this variable,
so use that in client code. In the smbd server, add one
static to smbd/proccess.c and use that inside smbd. Fix
a bunch of places where smb_rw_error could be set by
calling read_data() in places where we weren't reading
from the SMB client socket (ie. winbindd).
Jeremy.
2007-11-05 11:12:56 -08:00
Jeremy Allison
46f3b04dde Forgot arg type.
Jeremy.
2007-11-04 17:15:35 -08:00
Jeremy Allison
de2ebffa3c Don't believe len returned from read_smb_length_return_keepalive(),
it may be a UNIX large writeX (which wraps len in that case).
Stevef this should fix your 128k write bug.
Jeremy.
2007-11-04 15:38:43 -08:00
Jeremy Allison
963fc76852 Remove most of the remaining globals out of lib/util_sock.c.
I have a plan for dealing with the remaining..... Watch
this space.
Jeremy.
2007-11-03 23:20:10 -07:00
Jeremy Allison
95d01279a5 I can't get away without a 'length' arg. :-).
Jeremy.
2007-11-03 18:41:26 -07:00
Jeremy Allison
e848506c85 Stop get_peer_addr() and client_addr() from using global
statics. Part of my library cleanups.
Jeremy.
2007-11-03 18:15:45 -07:00
Jeremy Allison
d50d14c300 Remove the smb_read_error global variable and replace
it with accessor functions. "One global or pstring a day...." :-).
Jeremy.
2007-11-03 15:12:42 -07:00
Jeremy Allison
8fbefe18a2 Fix vfstest link - move socket calls into smbd/process.c
not smbd/server.c
Jeremy
2007-10-31 14:24:52 -07:00
Jeremy Allison
11c03b75dd 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.
2007-10-30 16:22:24 -07:00
Jeremy Allison
f35a266b3c 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.
2007-10-18 17:40:25 -07:00
Gerald (Jerry) Carter
5c6c8e1fe9 [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. 2007-10-10 15:34:30 -05:00
Jeremy Allison
7f0db75fb0 r25117: The mega-patch Jerry was waiting for. Remove all pstrings from
the main server code paths. We should now be able to cope with
paths up to PATH_MAX length now.
Final job will be to add the TALLOC_CTX * parameter to
unix_convert to make it explicit (for Volker).
Jeremy.
2007-10-10 12:30:41 -05:00
Volker Lendecke
6585ea2cb7 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
2007-10-10 12:30:24 -05:00
Volker Lendecke
17df313db4 r24702: Remove the old API pointers 2007-10-10 12:30:14 -05:00
Jeremy Allison
267a0ac48d r24500: Add check that bcc is correct in an incoming packet.
Jeremy.
2007-10-10 12:29:52 -05:00
Jeremy Allison
4d01e0b744 r24468: Don't forget the +4 for length :-).
Jeremy.
2007-10-10 12:29:50 -05:00
Jeremy Allison
dbd58dd647 r24467: Do range checking on incoming smb request.
Jeremy.
2007-10-10 12:29:50 -05:00
Volker Lendecke
1e08fddafd r24457: Convert reply_tcon to the new API
Jeremy, I really apologize for doing this, but I just wanted to enjoy
converting the last SMB call :-)

I've left one little task for you there, I'm not certain that checking
the inbuf length is correct here.

Volker
2007-10-10 12:29:49 -05:00
Volker Lendecke
d941aae2df r24453: Remove the read and write bmpx calls
Talked to both Tridge and Jeremy about this, Tridge said that there is a
special error message persuading OS/2 to fall back to other methods.
The calls now checked in always return the error message we used to
return when "read bmpx = False" was set (the default): ERRSRV, ERRuseSTD.

If someone has a reproducable test case where this is really needed, we
can always dig it up from version control and convert it to the new API.
But that time without that silly parameter, and with a torture test case
for "make test" please :-)

Volker
2007-10-10 12:29:49 -05:00
Jeremy Allison
edc17dfcbd r24445: Convert SMBwritebraw. No test suite unfortunately.... I need to write one for this.
Jeremy
2007-10-10 12:29:48 -05:00
Volker Lendecke
6af8595346 r24444: Convert reply_find[n]close to the new API 2007-10-10 12:29:48 -05:00
Volker Lendecke
a8a33c377e r24443: Convert reply_search/fclose to the new API 2007-10-10 12:29:48 -05:00
Volker Lendecke
0cb00c5475 r24442: Convert reply_copy to the new API 2007-10-10 12:29:48 -05:00
Volker Lendecke
a5af7ebb7f r24441: Convert reply_ioctl to the new API 2007-10-10 12:29:48 -05:00
Volker Lendecke
a64bc31098 r24440: Convert the reply_sendXX functions to the new API 2007-10-10 12:29:48 -05:00
Volker Lendecke
6b0ad071d8 r24439: Convert reply_get/setattrE to the new API 2007-10-10 12:29:47 -05:00
Volker Lendecke
1b6add251c r24436: Convert reply_lockread/writeunlock to the new API 2007-10-10 12:29:47 -05:00
Volker Lendecke
42b07a52b9 r24433: Convert reply_ntrename to the new API 2007-10-10 12:29:46 -05:00
Volker Lendecke
e528479f56 r24431: Convert the reply_printXX calls to the new API 2007-10-10 12:29:46 -05:00
Volker Lendecke
6def2ee03b r24430: Convert reply_writeclose to the new API 2007-10-10 12:29:46 -05:00
Volker Lendecke
01c7426fc0 r24428: Convert reply_unlock to the new API 2007-10-10 12:29:45 -05:00
Volker Lendecke
212f43ddea r24427: Convert reply_lock to the new API 2007-10-10 12:29:45 -05:00
Volker Lendecke
30aada0ef8 r24426: Convert reply_read to the new API 2007-10-10 12:29:45 -05:00
Volker Lendecke
244965f7b6 r24425: Convert reply_write to the new API 2007-10-10 12:29:45 -05:00
Volker Lendecke
bd22885386 r24423: Convert reply_lseek to the new API 2007-10-10 12:29:44 -05:00
Volker Lendecke
3cc22fd74f r24422: Convert reply_ctemp to the new API 2007-10-10 12:29:44 -05:00
Volker Lendecke
56bab5ea4c r24417: Convert reply_setatr to the new API 2007-10-10 12:29:43 -05:00
Volker Lendecke
1a08b97a93 r24415: Convert reply_getatr to the new API 2007-10-10 12:29:43 -05:00
Volker Lendecke
fa341e4840 r24414: Convert reply_mv to the new API 2007-10-10 12:29:42 -05:00
Volker Lendecke
394987f522 r24412: Convert reply_open to the new API 2007-10-10 12:29:42 -05:00
Volker Lendecke
bce87ebdc0 r24406: Push reply_prep_legacy into reply_lockingX 2007-10-10 12:29:41 -05:00