1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

122 Commits

Author SHA1 Message Date
Tim Prouty
fb37f15600 Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
(This used to be commit 6b189dabc5)
2008-05-20 22:40:13 +02:00
Jeremy Allison
29562987c3 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.
(This used to be commit 8f36def18e)
2008-01-04 15:37:24 -08: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
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
5993ddf240 r24659: Some formatting changes helping to minimize the 3_2_0 diff
(This used to be commit c5caea43af)
2007-10-10 12:30:13 -05:00
Stefan Metzmacher
66294f9db5 r24309: if no protocol matches, just return choise 0xffff
as we've done before revision 24002

metze
(This used to be commit 6014ecbbfd)
2007-10-10 12:29:26 -05:00
Stefan Metzmacher
aece6db714 r24308: this needs a better fix that compiles...
metze
(This used to be commit 1a177eb08d)
2007-10-10 12:29:26 -05:00
Stefan Metzmacher
f210f7c432 r24307: fill in choise with value -1 on error
as we've done before revision 24002

metze
(This used to be commit 2961a35e90)
2007-10-10 12:29:26 -05:00
Volker Lendecke
b91704d47b r24135: Convert call_trans2open to the new API
This itself won't help much, because send_trans2_replies_new still allocates
the big buffers, but stay tuned :-)

Also add/update my copyright on stuff I recently touched.

Volker
(This used to be commit 248f15ff14)
2007-10-10 12:29:10 -05:00
Volker Lendecke
8e2aa47b3f r24009: Revert to the 3.0.25 logic for parsing the client's protocols. hpisgr8
with gcc still gives timeouts which worry me.

Volker
(This used to be commit c30835b4f0)
2007-10-10 12:28:56 -05:00
Volker Lendecke
3a836c3ee4 r24006: Some more paranoia in reply_negprot
Some hosts see the smb_bufrem(req->inbuf, p) as an unsigned int. And as
the p += strlen(p) + 2 went one beyond the buffer, this was a very
large positive. Also take the chance to add one more consistency check.
(This used to be commit 3673707f9f)
2007-10-10 12:28:55 -05:00
Volker Lendecke
3d12c53eb3 r24002: Convert reply_negprot to the new API
(This used to be commit bd981f5328)
2007-10-10 12:28:54 -05:00
Volker Lendecke
de1c9f1f6d r24001: Separate out the parsing of the client's requested protocols
This way the range checking only needs to be done once
(This used to be commit befaa9713a)
2007-10-10 12:28:54 -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
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
Volker Lendecke
14e25f10d6 r23168: Move the lp_max_connections() into service.c.
(This used to be commit 4afe37d431)
2007-10-10 12:22:51 -05:00
Volker Lendecke
f3c477c631 r23167: Remove an unused parameter
(This used to be commit 3452a870d5)
2007-10-10 12:22:51 -05:00
Volker Lendecke
b4a7b7a888 r22844: Introduce const DATA_BLOB data_blob_null = { NULL, 0, NULL }; and
replace all data_blob(NULL, 0) calls.
(This used to be commit 3d3d61687e)
2007-10-10 12:22:01 -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
Jeremy Allison
8b63654c2e r21969: Start working on the gss-side of the server negotiation.
Jeremy.
(This used to be commit fbc569b530)
2007-10-10 12:18:54 -05:00
Günther Deschner
ab9a46a35c r21858: Fix typo.
Guenther
(This used to be commit 663514e511)
2007-10-10 12:18:39 -05:00
Günther Deschner
8d5f85e004 r21857: Stop pretending to be Vista in the %a macro towards Samba clients.
Guenther
(This used to be commit f55e1a312e)
2007-10-10 12:18:39 -05:00
Gerald Carter
7db1c6873c r21250: Partial fix for BUG 4093: Make %a expand to "Vista"
based on the flags2 values in the negprot request.

This also includes some code for testing the dialect
strings for "SMB 2.001" but this is unreliable as Vista
only sends that in the 1st negprot and caches the fact
that we don't support it.  Restartnig the WOrkstation
service on the client clears the cache.
(This used to be commit d781eeb0e4)
2007-10-10 12:17:51 -05:00
Jeremy Allison
2703b3ac48 r20368: Fix valgrind report of uninitialized memory
being returned (false positive). Up debug
level on "open_directory" message.
Jeremy.
(This used to be commit 71a8b8863f)
2007-10-10 12:16:44 -05:00
James Peach
5bb49b08f3 r20237: Replace exit_server with exit_server_cleanly where appropriate. All
send_smb failures should be clean exits. All times when we exit as
a matter of policy should also be clean exits.
(This used to be commit d6382092e7)
2007-10-10 12:16:34 -05:00
Volker Lendecke
c209219d06 r18773: Change negprot_spnego to return a blob
(This used to be commit 28fa772721)
2007-10-10 12:00:56 -05:00
Volker Lendecke
3bddf16b1f r18772: Now that we don't have a one-byte keylength in the extended security case
anymore, we don't have to truncate the length to 255 anymore.

The test I did for this: I sent 50 times the NTLMSSP oid. With truncating
Vista said Access Denied, without truncating it liked the response.

Volker
(This used to be commit f1512cb43c)
2007-10-10 12:00:56 -05:00
Volker Lendecke
a4a2d795b1 r18771: Sequel to r18761: If we always set the keylen to 0 there's no point in passing
a pointer down to negprot_spnego().

Volker
(This used to be commit 18f47130b1)
2007-10-10 12:00:55 -05:00
Volker Lendecke
8f7643bd83 r18761: Even if only offering NTLMSSP Windows (tested with Vista & XP) sends 0 as the
key length in the case of extended security. It does make sense because with
SPNEGO our beloved ASN1 structure gives us the length.

Next test I did to verify this: I modified the server to put in random
garbage, and W2kwks, XP, Vista and W2k3srv still talked to us.

Volker
(This used to be commit f19bd479ce)
2007-10-10 12:00:55 -05:00
Volker Lendecke
45ca718d19 r18760: Fix typos, remove unneeded code
(This used to be commit 56ccfe98b2)
2007-10-10 12:00:55 -05:00
Jeremy Allison
ce61fb21d9 r16397: Fix Klocwork #11767 and drasticly simplify the
logic in smbd/process.c. All interested (Volker,
Jerry, James etc). PLEASE REVIEW THIS CHANGE.
The logic should be identical but *much* easier
to follow and change (and shouldn't confuse Klockwork :-).
Jeremy.
(This used to be commit d357f8b335)
2007-10-10 11:18:52 -05:00
Jeremy Allison
0229b65755 r13647: Fix for standalone Samba servers and XP clients. Reverts
part of the PocketPC bugfix. I'm trying to get someone who
has a pocketpc to test this.
Jeremy.
(This used to be commit ce25e6b002)
2007-10-10 11:10:21 -05:00
Jeremy Allison
6d5757395a r11511: A classic "friday night check-in" :-). This moves much
of the Samba4 timezone handling code back into Samba3.
Gets rid of "kludge-gmt" and removes the effectiveness
of the parameter "time offset" (I can add this back
in very easily if needed) - it's no longer being
looked at. I'm hoping this will fix the problems people
have been having with DST transitions. I'll start comprehensive
testing tomorrow, but for now all modifications are done.
Splits time get/set functions into srv_XXX and cli_XXX
as they need to look at different timezone offsets.
Get rid of much of the "efficiency" cruft that was
added to Samba back in the day when the C library
timezone handling functions were slow.
Jeremy.
(This used to be commit 414303bc02)
2007-10-10 11:05:19 -05:00
Jeremy Allison
8d7c886671 r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box.
Jeremy.
(This used to be commit d720867a78)
2007-10-10 11:05:02 -05:00
Jeremy Allison
97a321e557 r10974: Get closer to trying to fix #1825 (PcoketPC spnego bug). Ensure we
set keylen to zero if no spnego.
Jeremy.
(This used to be commit 57ed94e6e4)
2007-10-10 11:04:58 -05:00
Jeremy Allison
4a190ec27b r10947: Fix bugs #3133 and #1828 - SPNEGO not working with PocketPC 2003.
Our sessionsetup code now handles raw NTLMSSP connects, so we can go
back to doing what W2K3 does here which is to send no OID's in
the negprot reply when not in a security=ads mode.
Jeremy.
(This used to be commit 38a70185b7)
2007-10-10 11:04:57 -05:00
Gerald Carter
dacdfbc98c r7398: commiting abartlet's patch for kerberos authentication when using a keytab and security != ads
(This used to be commit 3faaa5c3eb)
2007-10-10 10:57:08 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Jeremy Allison
404fa5636d r6069: Fix for bug #2541. Ensure we recognise LANMAN2.1 as OS/2 and select LANMAN2
protocol, ensure the EA size is always correctly set on a query for a file with no EA's.
Jeremy.
(This used to be commit d6ad1f8df0)
2007-10-10 10:56:20 -05:00
Gerald Carter
2fffc40b1d r4018: * move claim_connection from the netbios session request
reply code to the negprot reply code to cope with
  client connections on port 445.  Fixes the spurious
  "register_message_flags: tdb fetch failed" errors.

* don't run the backgroup LPQ daemon when we are running
  in interactive mode.
(This used to be commit 88747a7da3)
2007-10-10 10:53:27 -05:00
Jeremy Allison
482f14871d r3946: Fix for bugid #2085 reported by Jason Mader <jason@ncac.gwu.edu>. Use consistent
enum type for Protocol extern.
Jeremy.
(This used to be commit 65dfae7ea4)
2007-10-10 10:53:26 -05:00
Jeremy Allison
b447065629 r1939: Ensure with my new change we set extended security in flags2 in
the negprot reply.
Jeremy.
(This used to be commit 8b80b46b8b)
2007-10-10 10:52:24 -05:00
Jeremy Allison
6219c997cb r1936: Fix bug noticed by Steve - ensure extended security bit is on only
if we negotiated extended security. Do not merge for 3.0.6. Works
with W2K but needs further testing.
Jeremy.
(This used to be commit 284689aa18)
2007-10-10 10:52:24 -05:00
Jeremy Allison
2acd084866 r1154: Change default setting for case sensitivity to "auto". If set to auto
then is the client supports it (current clients supported are Samba and
CIFSVFS - detected by the negprot strings "Samba", "POSIX 2" and a bare
"NT LM 0.12" string) then the setting of the per packet flag smb_flag
FLAG_CASELESS_PATHNAMES is taken into account per packet. This allows
the linux CIFS client to use Samba in a case sensitive manner.
Additional command in smbclient "case_sensitive", toggles the
flag in subsequent packets.
Docs to follow.
Jeremy.
(This used to be commit cf84c0fe1a)
2007-10-10 10:51:57 -05:00
Andrew Bartlett
deee8fae47 As I raised (without objection) on the mailing list a while back, this
patch removes the 'unicode' smb.conf option.

Clients are as always free not to negotiate unicode, but Samba will always
accept unicode in smbd.

Setting 'unicode = no' caused me more client BSODs than any other option
I have seen, and I really want to protect some of our more silly users, who
will, no matter what, select and change every option...

Andrew Bartlett
(This used to be commit 3f9177bd5d)
2004-03-27 05:38:20 +00:00
Jeremy Allison
6b9dbbcd24 Modified fix for bugid #784. Based on a patch from moriyama@miraclelinux.com (MORIYAMA Masayuki).
Don't use nstrings to hold workgroup and netbios names. The problem with them is that MB netbios
and workgroup names in unix charset (particularly utf8) may be up to 3x bigger than the name
when represented in dos charset (ie. cp932). So go back to using fstrings for these but
translate into nstrings (ie. 16 byte length values) for transport on the wire.
Jeremy.
(This used to be commit b4ea493599)
2004-03-13 02:16:21 +00:00
Jeremy Allison
814e987c62 Signing so far... the client code fails on a SMBtrans2 secondary transaction
I think (my changes haven't affected this I believe). Initial support on the
server side for smbclient. Still doesn't work for w2k clients I think...
Work in progress..... (don't change).
Jeremy.
(This used to be commit e5714edc23)
2003-07-18 00:53:34 +00:00
Jeremy Allison
f1b6cd794d Putting the framework for server signing in place. Ensure we don't use
sendfile when signing (I need to add this for readbraw/writebraw too...).
Jeremy.
(This used to be commit f2e84f1ba6)
2003-07-17 00:48:21 +00:00
Jeremy Allison
ce72beb2b5 Removed strupper/strlower macros that automatically map to strupper_m/strlower_m.
I really want people to think about when they're using multibyte strings.
Jeremy.
(This used to be commit ff222716a0)
2003-07-03 19:11:31 +00:00