1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

541 Commits

Author SHA1 Message Date
Volker Lendecke
4f4781c6d1 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 :-)
2008-04-23 22:18:26 +02:00
Stefan Metzmacher
658d847533 smbd: create the messaging conntext earlier
metze
2008-04-18 15:00:19 +02:00
Stefan Metzmacher
425b3513a4 smbd: call reinit_after_fork() in the needed places
metze
2008-04-18 14:43:08 +02:00
Stefan Metzmacher
16d295d466 smbd: merge "smbd:backgroundqueue=no" option from the v3-0-ctdb tree
metze
2008-04-18 14:43:07 +02:00
Michael Adam
14d82708d4 registry: rename init_registry() to registry_init_full() for consistency.
Michael
2008-04-13 15:33:48 +02:00
Michael Adam
0b196095db registry: change init_registry() to return WERROR instead of bool.
Michael
2008-04-13 15:33:48 +02:00
Stefan Metzmacher
64450cc1e4 dbwrap: wait for tdb2 change notifies in smbd, nmbd and winbindd
metze
2008-04-12 09:14:10 +02:00
Alexander Bokovoy
a0cefd4400 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.
2008-04-08 15:19:01 +04:00
root
ddc989886d 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
2008-03-20 16:54:05 +01:00
Andrew Tridgell
5e8c624c9c [samba-3-0-ctdb.tridge @ tridge@samba.org-20070602053809-kpw5kjkcyjs8yjbl]
suppress that darn message
(cherry picked from commit 542e46a21898f6fcc8a0aeb63925607a60e0b99f)
2008-03-18 17:12:08 +01:00
Tim Potter
2b1eead269 Check return code of secrets_init() function. 2008-02-18 10:15:44 +01:00
Alexander Bokovoy
cf1f90ad7a Merge DMAPI fixes from CTDB Samba 2008-01-18 17:34:21 +03:00
Alexander Bokovoy
0c8e23afbb 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>
2008-01-16 12:09:48 +03:00
Jeremy Allison
3936de735a 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.
2008-01-10 15:15:01 -08:00
Volker Lendecke
c131d0dc52 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.
2007-12-21 09:58:20 +01:00
Jeremy Allison
c378c3edc1 Remove last_message completely as it's no longer used.
Jeremy.
2007-12-18 18:10:09 -08:00
Volker Lendecke
7a911b3571 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.
2007-12-18 09:56:04 +01:00
Rishi Srivatsavai
1e7241517d 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.
2007-12-13 20:56:29 -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
2f3c865707 Tiny simplifications
locking.c:open_read_only was unused

don't export the silly boolean flag locking_init(bool read_only)
2007-12-10 12:22:01 +01: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
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
Jeremy Allison
c15819b757 Three more pstring removals.
Jeremy.
2007-11-11 21:46:52 -08: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
Volker Lendecke
814bed029e Remove the silly "user_socket_options" global variable
This is better done with a 'lp_do_parameter(-1, "socket options", ..);
2007-11-09 15:11:54 +01: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
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
8cf78776b0 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.
2007-10-31 14:01:35 -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
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
Volker Lendecke
e17d3e10e8 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
2007-10-27 12:50:36 -07:00
Jeremy Allison
2ec6224b55 Ensure we don't terminate if we fail to bind to a socket,
only fail if we can't bind to any socket.
Jeremy.
2007-10-25 14:11:35 -07:00
Jeremy Allison
d04a8a6cdc Don't terminate on an invalid address family.
Jeremy.
2007-10-24 16:11:01 -07: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
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
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
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
306846a14f r24029: merge from http://samba.org/~tridge/samba_3_2_ctdb/:
the claim_connection() must come after the sockets are open

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