1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-29 11:21:54 +03:00
Commit Graph

506 Commits

Author SHA1 Message Date
Jeremy Allison
5440c752ff Fix bug #5267 - nmbd shuts down when network interfaces go down.
Cause nmbd to wait for an interface, in a mode where SIGTERM
will kills us (same way we wait on startup for an interface).
Jeremy.
2008-03-06 17:43:25 -08:00
Jeremy Allison
fa12667ec2 Patch to fix the "Invalid read of size 4" errors. Bug #3617.
Jeremy.
2008-02-29 06:55:33 -08:00
Jeremy Allison
d954a4954b Fix part of bug #3617 from valgrind trace.
"Invalid read of size 1" errors.
Jeremy.
2008-02-29 05:51:09 -08:00
Volker Lendecke
af40b71023 Convert read_data() to NTSTATUS 2008-02-02 11:03:23 +01:00
Volker Lendecke
902d1d6709 Fix Coverity ID 454 2008-01-24 16:31:55 +01:00
Volker Lendecke
8629a0e1c3 Fix Coverity ID 465 2008-01-24 16:31:55 +01:00
Volker Lendecke
fd34ce4370 strtok -> strtok_r 2008-01-23 15:08:04 +01:00
Jeremy Allison
ecb52f50fe Fix CID 475. work should not be checked against NULL
here as it can never be null.
Jeremy.
2008-01-11 23:56:48 -08:00
Jeremy Allison
318cbcfae5 Ensure we don't take address of one past buffer.
Jeremy.
2008-01-09 14:35:00 -08:00
Jeremy Allison
7e8e91aeb3 More logical operation on bool.
Jeremy.
2008-01-04 23:26:47 -08:00
Jeremy Allison
1b06ee69f6 Attempt to fix bug #3617. Mix of patches from Volker and
myself. Use standard dlinklist macros.
Jeremy.
2008-01-02 11:56:07 -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
6b1246c29a Arg. The fix for CVE-2007-6015 hadn't been merged into 3.2.
Do so now....
Jeremy.
2007-12-13 16:44:24 -08:00
Jeremy Allison
52dc5eaef2 Remove the char[1024] strings from dynconfig. Replace
them with malloc'ing accessor functions. Should save a
lot of static space :-).
Jeremy.
2007-12-10 11:30:37 -08:00
Volker Lendecke
60500fac30 Fix two incompatible pointer warnings
Jeremy, please check
2007-12-08 09:39:20 -08:00
Jeremy Allison
ec003f3936 Remove next_token - all uses must now be next_token_talloc.
No more temptations to use static length strings.
Jeremy.
2007-12-07 17:32:32 -08:00
Jeremy Allison
4c32a22ac5 Don't build rpctorture anymore - not maintained. Just remove.
Remove all vestiges of pstring (except for smbctool as noted
in previous commit).
Jeremy
2007-12-07 12:26:32 -08:00
Jeremy Allison
cc257b71d1 Remove PSTRING_LEN from smbd/ nmbd/.
Remove pstring from libsmb/clidfs.c except for a nasty
hack (that will be removed when pstrings are gone from
client/).
Jeremy.
2007-11-29 17:25:41 -08:00
Jeremy Allison
a317f70c22 Remove pstring from nmbd.
Jeremy.
2007-11-19 15:15:09 -08:00
Jeremy Allison
ad9f14b6dc Fix bug noticed by kukks <linux@kukkukk.com> where
ip list didn't match namelist added to subnetdb.
Could cause bogus IP addresses to be reported for
the __SAMBA__ name.
Jeremy.
2007-11-15 17:59:12 -08:00
Jeremy Allison
1ea3ac8014 More pstring removal. This one was tricky. I had to add
one horror (pstring_clean_name()) which will have to
remain until I've removed all pstrings from the client code.
Jeremy.
2007-11-15 14:19:52 -08:00
Gerald (Jerry) Carter
e40c372e0d Fix for CVE-2007-5398.
== Subject:     Remote code execution in Samba's WINS
==              server daemon (nmbd) when processing name
==              registration followed name query requests.
==
== CVE ID#:     CVE-2007-5398
==
== Versions:    Samba 3.0.0 - 3.0.26a (inclusive)
...
Secunia Research reported a vulnerability that allows for
the execution of arbitrary code in nmbd.  This defect may
only be exploited when the "wins support" parameter has
been enabled in smb.conf.
2007-11-15 10:57:31 -06:00
Jeremy Allison
52fe04df8e Remove more static fstring/pstrings. Fix socket option
set on wrong fd (-1).
Jeremy.
2007-11-09 15:09:16 -08:00
Jeremy Allison
7a1de5b44e Remove more pstring/fstrings.
Jeremy.
2007-11-08 18:50:07 -08:00
Jeremy Allison
2a0173743d Remove more fstring/pstring bad useage. Go talloc !
Jeremy.
2007-11-08 17:25:45 -08: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
35aaa36f82 Remove more static data from lib/util_sock.c and
callers.
Jeremy.
2007-11-03 22:34:46 -07:00
Gerald (Jerry) Carter
d6cdbfd875 Patch 2 of 3 from Debian Samba packagers:
The point is doing the following associations:

- non discardable state data (all TDB files that may need to be backed
  up) go to statedir
- shared data (codepage stuff) go to codepagedir

The patch *does not change* the default location for these
directories. So, there is no behaviour change when applying it.

The main change is for samba developers who have to think when dealing
with files that previously pertained to libdir whether they:
- go in statedir
- go in codepagedir
- stay in libdir
2007-11-01 15:53:44 -04:00
Stefan Metzmacher
95f76ae7a5 start smbd, nmbd and winbindd with the same startup message
at debug level 0.

metze
2007-10-30 15:44:27 +01:00
Jeremy Allison
98e154c312 This is a large patch (sorry). Migrate from struct in_addr
to struct sockaddr_storage in most places that matter (ie.
not the nmbd and NetBIOS lookups). This passes make test
on an IPv4 box, but I'll have to do more work/testing on
IPv6 enabled boxes. This should now give us a framework
for testing and finishing the IPv6 migration. It's at
the state where someone with a working IPv6 setup should
(theorecically) be able to type :
smbclient //ipv6-address/share
and have it work.
Jeremy.
2007-10-24 14:16:54 -07:00
Stefan Metzmacher
97f47e3913 fix move to OPT_LOG_STDOUT
metze
2007-10-20 10:12:55 +02:00
Jeremy Allison
793a9d24a1 Fix the popt / bool issues. Some places we used BOOL
where we meant int. Fix this. Thanks to metze for
pointing this out.
Jeremy.
2007-10-19 11:38:36 -07:00
Stefan Metzmacher
9cb1937fe8 fix startup of smbd, nmbd, winbindd
jra: POPT_ARG_VAL arguments need int values.
     I assume there're more places like this
     in the cmdline tools.

     Please fix this properly, as my commit is just
     a hack to get make test working again.

in samba4 we have a workaround for this see
smbd/server.c

metze
2007-10-19 10:34:06 +02: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
Jeremy Allison
3f6bd0e1ec Add start of IPv6 implementation. Currently most of this is avoiding
IPv6 in winbindd, but moves most of the socket functions that were
wrongly in lib/util.c into lib/util_sock.c and provides generic
IPv4/6 independent versions of most things. Still lots of work
to do, but now I can see how I'll fix the access check code.
Nasty part that remains is the name resolution code which is
used to returning arrays of in_addr structs.
Jeremy.
2007-10-10 18:25:16 -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
18c6a2211d r25492: Start adding IPv6 compatible code to lib/util_sock.c and deal with
the ripple effects this causes. utmp has to change etc. Remove some
global varables and store address/port in the unexpected db.
Jeremy.
2007-10-10 12:31:09 -05:00
Jeremy Allison
abedd96786 r25238: Make the error returns from the string functions
always consistent. Return -1 on error, and ensure
we check for this. In cases where the dest is already
specified and we've been asked to terminate with a
null, ensure we always do so even on error.
Jeremy.
2007-10-10 12:30:53 -05:00
Jeremy Allison
764574ee05 r25170: Remove pstring limits from ms_fnmatch and module load.
Jeremy.
2007-10-10 12:30:48 -05:00
Jeremy Allison
39c211a702 r25138: More pstring elimination. Add a TALLOC_CTX parameter
to unix_convert().
Jeremy.
2007-10-10 12:30:44 -05:00
Jeremy Allison
f789186086 r25021: Fix coverity #435. Use of -1.
Jeremy.
2007-10-10 12:30:35 -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
Stefan Metzmacher
a95d9d1ef9 r24621: - deferr calling build_options();exit(0);
- use poptPrintUsage() to give the user more info

metze
2007-10-10 12:30:11 -05:00
Stefan Metzmacher
8532e3182a r24599: patch from Karolin Seeger <ks@sernet.de>:
smbd, nmbd and winbindd can be started with invalid options currently.
The first patch attached would be a possible solution.
It contains an exit if an invalid option has been used. The main problem
is, that existing setups with wrong options or missing arguments in start
scripts will break (which is the right behaviour from my point of view).

metze
2007-10-10 12:30:09 -05:00
Stefan Metzmacher
98c57562c4 r24027: merge from http://people.samba.org/bzr/metze/samba/3_2-ctdb-metze/:
add in any cluster addresses. We need to response to these,
but not listen on them. This allows us to run nmbd on every
node in the cluster, and have all of them register with a
WINS server correctly

metze
2007-10-10 12:28:57 -05:00
Andrew Tridgell
b0132e94fc r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
Andrew Tridgell
22e8404cef r23783: Processing the UAS change message was causing problems on ppc64 Linux
systems. Rather than trying to fix this, it's much better just to
remove the code, as it serves no purpose at all (the message that is
generated is ignored by smbd).

This sort of parsing should really be done by PIDL generated code.
2007-10-10 12:28:21 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Jeremy Allison
3f70c1b105 r23556: Fix for error path from Atsushi Nakabayashi <nakabayashi@miraclelinux.com>.
Jeremy.
2007-10-10 12:23:28 -05:00
Jeremy Allison
073fdc5a58 r23554: Fix bug #4711 by makeing cli_connect return an NTSTATUS.
Long overdue fix....
Jeremy.
2007-10-10 12:23:28 -05:00