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

544 Commits

Author SHA1 Message Date
Michael Adam
59634c91ec smbd: untangle logic in smbd_messaging_context() slightly.
Michael
(This used to be commit fae4c21b14)
2008-06-26 12:31:10 +02:00
Michael Adam
8b6d41b3b0 smbd: don't panic if messaging_init() fails but return NULL
leaving panic or more appropriate action to callers.
This can for instance happen in a clustered setup, when
ctdb is not running. This allows for a more defined behaviour,
reducing chicken-egg-problems.

Michael
(This used to be commit 3b6541ff48)
2008-06-26 12:31:10 +02:00
Jeremy Allison
6811dc3fc2 Allow server manager to close open files selected by id.
Jeremy.
(This used to be commit 7eeed8bb41)
2008-05-27 11:25:46 -07:00
Volker Lendecke
0c4093a234 Fix CLEAR_IF_FIRST handling of messages.tdb
We now open messages.tdb even before we do the become_daemon. become_daemon()
involves a fork and an immediate exit of the parent, thus the
parent_is_longlived argument must be set to false in this case. The parent is
not really long lived :-)
(This used to be commit 4f4781c6d1)
2008-04-23 22:18:26 +02:00
Stefan Metzmacher
2df0ade13a smbd: create the messaging conntext earlier
metze
(This used to be commit 658d847533)
2008-04-18 15:00:19 +02:00
Stefan Metzmacher
f2067658df smbd: call reinit_after_fork() in the needed places
metze
(This used to be commit 425b3513a4)
2008-04-18 14:43:08 +02:00
Stefan Metzmacher
b7a141f8a7 smbd: merge "smbd:backgroundqueue=no" option from the v3-0-ctdb tree
metze
(This used to be commit 16d295d466)
2008-04-18 14:43:07 +02:00
Michael Adam
a9ff941f41 registry: rename init_registry() to registry_init_full() for consistency.
Michael
(This used to be commit 14d82708d4)
2008-04-13 15:33:48 +02:00
Michael Adam
281e610ff3 registry: change init_registry() to return WERROR instead of bool.
Michael
(This used to be commit 0b196095db)
2008-04-13 15:33:48 +02:00
Stefan Metzmacher
e21b283d67 dbwrap: wait for tdb2 change notifies in smbd, nmbd and winbindd
metze
(This used to be commit 64450cc1e4)
2008-04-12 09:14:10 +02:00
Alexander Bokovoy
c2bb4b51c1 Destroy DMAPI session when main smbd daemon exits.
DMAPI session is precious resource maintained at kernel level. We open one of them and use across multiple smbd daemons
but once last of them exits, DMAPI session needs to be destroyed. There are some HSM implementations which fail to
shutdown when opened DMAPI sessions left. Ensure we shutdown our session when it is really not needed anymore.
This is what recommended by DMAPI specification anyway.
(This used to be commit a0cefd4400)
2008-04-08 15:19:01 +04:00
root
3d2ec80693 Port 3c1f1f0797e from 3-0-ctdb
We need to inform ctdb about the client's TCP connection so that after a fail
over ctdbd can trigger the client to reconnect very quickly
(This used to be commit ddc989886d)
2008-03-20 16:54:05 +01:00
Andrew Tridgell
f152fe2103 [samba-3-0-ctdb.tridge @ tridge@samba.org-20070602053809-kpw5kjkcyjs8yjbl]
suppress that darn message
(cherry picked from commit 542e46a21898f6fcc8a0aeb63925607a60e0b99f)
(This used to be commit 5e8c624c9c)
2008-03-18 17:12:08 +01:00
Tim Potter
a8fbb92146 Check return code of secrets_init() function.
(This used to be commit 2b1eead269)
2008-02-18 10:15:44 +01:00
Alexander Bokovoy
c17c64530e Merge DMAPI fixes from CTDB Samba
(This used to be commit cf1f90ad7a)
2008-01-18 17:34:21 +03:00
Alexander Bokovoy
68694369fc Merge CTDB-related fixes from samba-ctdb 3.0 branch (http://samba.org/~tridge/3_0-ctdb)
Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit 0c8e23afbb)
2008-01-16 12:09:48 +03:00
Jeremy Allison
13785d5c62 Don't print out debug messages at level 0 if we can't
bind to a socket if we've already bound to one (this
prevents :
bind failed on port 445 socket_addr = 0.0.0.0.
Error = Address already in use
bind failed on port 139 socket_addr = 0.0.0.0.
Error = Address already in use
messages when trying to bind to an IPv4 address
when we've already bound to the IPv6 equivalent.
Jeremy.
(This used to be commit 3936de735a)
2008-01-10 15:15:01 -08:00
Volker Lendecke
cc48010f41 Add a global cache
It hurts, but I think this global variable is necessary for transition, and it
has the potential to remove quite a few other global variables without messing
with APIs too much.
(This used to be commit c131d0dc52)
2007-12-21 09:58:20 +01:00
Jeremy Allison
a34c6cd0e7 Remove last_message completely as it's no longer used.
Jeremy.
(This used to be commit c378c3edc1)
2007-12-18 18:10:09 -08:00
Volker Lendecke
f427d4ce65 Add a in-memory cache
This is a more general API that caches data with a LRU scheme. See
include/cache.h. No comments yet, I'm still working on it. But Jeremy has given
me a hint in one of his checkins that he would like to make use of this now.

The idea is that we get rid of all our silly little caches and merge them all
into one cache that we can then very easily trim, for example even with a
smbcontrol message if someone decides memory is tight. The main user is the
stat cache, this patch also converts the getwd cache. More caches to come.
(This used to be commit 7a911b3571)
2007-12-18 09:56:04 +01:00
Rishi Srivatsavai
12ac4c3119 Register the smb service with mDNS if mSDN is supported.
If mDNS is supported, attempt to register the first port we are
listening on for the _smb._tcp service. This provides more reliable
service discovery than NetBIOS browsing.
(This used to be commit 1e7241517d)
2007-12-13 20:56:29 -08:00
Jeremy Allison
7faee02d0d Remove the char[1024] strings from dynconfig. Replace
them with malloc'ing accessor functions. Should save a
lot of static space :-).
Jeremy.
(This used to be commit 52dc5eaef2)
2007-12-10 11:30:37 -08:00
Volker Lendecke
d60fac2a5a Tiny simplifications
locking.c:open_read_only was unused

don't export the silly boolean flag locking_init(bool read_only)
(This used to be commit 2f3c865707)
2007-12-10 12:22:01 +01:00
Jeremy Allison
42cfffae80 Remove next_token - all uses must now be next_token_talloc.
No more temptations to use static length strings.
Jeremy.
(This used to be commit ec003f3936)
2007-12-07 17:32:32 -08:00
Jeremy Allison
acf15ae730 Don't build rpctorture anymore - not maintained. Just remove.
Remove all vestiges of pstring (except for smbctool as noted
in previous commit).
Jeremy
(This used to be commit 4c32a22ac5)
2007-12-07 12:26:32 -08:00
Jeremy Allison
68be9a8200 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.
(This used to be commit 1ea3ac8014)
2007-11-15 14:19:52 -08:00
Jeremy Allison
d068bc64b6 Three more pstring removals.
Jeremy.
(This used to be commit c15819b757)
2007-11-11 21:46:52 -08:00
Jeremy Allison
6c25260ec1 Remove more static fstring/pstrings. Fix socket option
set on wrong fd (-1).
Jeremy.
(This used to be commit 52fe04df8e)
2007-11-09 15:09:16 -08:00
Volker Lendecke
e63bcdd720 Remove the silly "user_socket_options" global variable
This is better done with a 'lp_do_parameter(-1, "socket options", ..);
(This used to be commit 814bed029e)
2007-11-09 15:11:54 +01:00
Jeremy Allison
5b0b4f23ef 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.
(This used to be commit 963fc76852)
2007-11-03 23:20:10 -07:00
Jeremy Allison
25074433f4 I can't get away without a 'length' arg. :-).
Jeremy.
(This used to be commit 95d01279a5)
2007-11-03 18:41:26 -07:00
Jeremy Allison
6658165d5e Stop get_peer_addr() and client_addr() from using global
statics. Part of my library cleanups.
Jeremy.
(This used to be commit e848506c85)
2007-11-03 18:15:45 -07:00
Jeremy Allison
695c4a7a74 Fix vfstest link - move socket calls into smbd/process.c
not smbd/server.c
Jeremy
(This used to be commit 8fbefe18a2)
2007-10-31 14:24:52 -07:00
Jeremy Allison
133fad90b5 Make explicit draining the socket on RECVFILE. Add
capability for large UNIX write if not signing and
recvfile set. Cope with large UNIX write length on
incoming processing. Stevef - we can now test 1-16Mb
writes from CIFFS.
Jeremy.
(This used to be commit 8cf78776b0)
2007-10-31 14:01:35 -07: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
Stefan Metzmacher
851ef9e22f start smbd, nmbd and winbindd with the same startup message
at debug level 0.

metze
(This used to be commit 95f76ae7a5)
2007-10-30 15:44:27 +01:00
Volker Lendecke
a97b33baad Two patches
Hi!

Can you check and push them?

Thanks,

Volker

From b488af5905e2dee12a1a72a3b40801ae5c26f24f Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl@sernet.de>
Date: Sat, 27 Oct 2007 14:20:09 +0200
Subject: [PATCH] Fix some warnings and errors
(This used to be commit e17d3e10e8)
2007-10-27 12:50:36 -07:00
Jeremy Allison
38c34ffd6b Ensure we don't terminate if we fail to bind to a socket,
only fail if we can't bind to any socket.
Jeremy.
(This used to be commit 2ec6224b55)
2007-10-25 14:11:35 -07:00
Jeremy Allison
fac788d6e2 Don't terminate on an invalid address family.
Jeremy.
(This used to be commit d04a8a6cdc)
2007-10-24 16:11:01 -07:00
Jeremy Allison
f88b7a076b 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.
(This used to be commit 98e154c312)
2007-10-24 14:16:54 -07:00
Jeremy Allison
9a85533914 Fix the popt / bool issues. Some places we used BOOL
where we meant int. Fix this. Thanks to metze for
pointing this out.
Jeremy.
(This used to be commit 793a9d24a1)
2007-10-19 11:38:36 -07:00
Stefan Metzmacher
7f82fbad50 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
(This used to be commit 9cb1937fe8)
2007-10-19 10:34:06 +02: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
Jeremy Allison
8e54530b52 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.
(This used to be commit 3f6bd0e1ec)
2007-10-10 18:25:16 -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
b578db69e9 r24702: Remove the old API pointers
(This used to be commit 17df313db4)
2007-10-10 12:30:14 -05:00
Stefan Metzmacher
8dd00920ef r24621: - deferr calling build_options();exit(0);
- use poptPrintUsage() to give the user more info

metze
(This used to be commit a95d9d1ef9)
2007-10-10 12:30:11 -05:00
Stefan Metzmacher
2e498b48bb 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
(This used to be commit 8532e3182a)
2007-10-10 12:30:09 -05:00
Stefan Metzmacher
1ba6f17278 r24029: merge from http://samba.org/~tridge/samba_3_2_ctdb/:
the claim_connection() must come after the sockets are open

metze
(This used to be commit 306846a14f)
2007-10-10 12:28:57 -05:00