1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-05 09:18:06 +03:00
Commit Graph

481 Commits

Author SHA1 Message Date
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
James Peach
171dc060e2 r23510: Tidy calls to smb_panic by removing trailing newlines. Print the
failed expression in SMB_ASSERT.
2007-10-10 12:23:23 -05:00
Jeremy Allison
e3f33a2a50 r23425: Volker noticed this obvious fix for the wins server
code :-). Thanks Volker !
Jeremy.
2007-10-10 12:23:15 -05:00
Jeremy Allison
9ee310f3d6 r23349: Fix from Steve Langasek <vorlon@debian.org> to
allow SIGTERM to cause nmbd to exit on awaiting
an interface to come up. Debian bug #168079
Jeremy.
2007-10-10 12:23:08 -05:00
Volker Lendecke
eaefd00563 r23055: Rewrite messages.c to use auto-generated marshalling in the tdb. I'm
doing this because for the clustering the marshalling is needed in more
than one place, so I wanted a decent routine to marshall a message_rec
struct which was not there before.

Tridge, this seems about the same speed as it used to be before, the
librpc/ndr overhead in my tests was under the noise.

Volker
2007-10-10 12:22:17 -05:00
Volker Lendecke
a8082a3c7c r23015: Make message_(de)register static to messages.c 2007-10-10 12:22:15 -05:00
Volker Lendecke
cc92ce665d r22911: Pass a messaging_context to message_send_all 2007-10-10 12:22:07 -05:00
Volker Lendecke
330946ad23 r22908: All callers of message_init now also call messaging_init. Unify those. 2007-10-10 12:22:07 -05:00
Volker Lendecke
6d210fb8a1 r22902: Add an event_context and a messaging_context to nmbd. Not used yet. 2007-10-10 12:22:06 -05:00
Volker Lendecke
e43e94cda1 r22761: This introduces lib/conn_tdb.c with two main functions: connections_traverse
and connections_forall. This centralizes all the routines that did individual
tdb_open("connections.tdb") and direct tdb_traverse.

Volker
2007-10-10 12:21:55 -05:00
Volker Lendecke
0ad4b1226c r22736: Start to merge the low-hanging fruit from the now 7000-line cluster patch.
This changes "struct process_id" to "struct server_id", keeping both is
just too much hassle. No functional change (I hope ;-))

Volker
2007-10-10 12:21:52 -05:00
James Peach
19c929c633 r22417: Refactor the various daemon run-mode options to make the semantics
of the various flags explicit.
2007-10-10 12:19:33 -05:00
Jeremy Allison
2d80a96120 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.
2007-10-10 12:19:30 -05:00
Jeremy Allison
c3e2207cb4 r22157: Fix bug #3634 - stop nmbd segfaulting with bad interface line.
Jeremy.
2007-10-10 12:19:17 -05:00
Jeremy Allison
140881cfbb r22045: As Volker noticed, skip_string's last argument is
redundent. Remove it.
Jeremy.
2007-10-10 12:19:05 -05:00
Jeremy Allison
d47af7c926 r22042: Try and clean up my own mess using the API Volker
suggested. I now use :

BOOL is_offset_safe(const char *buf_base, size_t buf_len, char *ptr, size_t off)
char *get_safe_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off)
char *get_safe_str_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off)
int get_safe_SVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval)
int get_safe_IVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval)

Volker, please criticize and comment. Thanks,

Jeremy.
2007-10-10 12:19:04 -05:00
Herb Lewis
a4c1c770a2 r22018: fix compile error 2007-10-10 12:19:02 -05:00
Jeremy Allison
c3a565081d r22014: Make us pass RANDOMIPC test again :-(. This is an ugly check-in,
but I've no option.
Jeremy.
2007-10-10 12:19:01 -05:00
Stefan Metzmacher
3a28443079 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
2007-10-10 12:19:00 -05:00
Stefan Metzmacher
fa322f0cc9 r22001: change prototype of dump_data(), so that it takes unsigned char * now,
which matches what samba4 has.

also fix all the callers to prevent compiler warnings

metze
2007-10-10 12:18:59 -05:00
Volker Lendecke
c8ae60ed65 r21064: The core of this patch is
void message_register(int msg_type,
                      void (*fn)(int msg_type, struct process_id pid,
-                                void *buf, size_t len))
+                                void *buf, size_t len,
+                                void *private_data),
+                     void *private_data)
 {
        struct dispatch_fns *dfn;

So this adds a (so far unused) private pointer that is passed from
message_register to the message handler. A prerequisite to implement a tiny
samba4-API compatible wrapper around our messaging system. That itself is
necessary for the Samba4 notify system.

Yes, I know, I could import the whole Samba4 messaging system, but I want to
do it step by step and I think getting notify in is more important in this
step.

Volker
2007-10-10 12:17:32 -05:00
James Peach
9a51fba71c r19626: Coalesce usage of DUMP_CORE. Fix formatting on chdir error message
in core dump path.
2007-10-10 12:15:42 -05:00
Jim McDonough
f8ea2069d4 r18660: Fix build, one uuid->GUID was missed. 2007-10-10 11:52:20 -05:00
Stefan Metzmacher
2f58645b70 r18605: sync dlinklist.h with samba4, that means DLIST_ADD_END()
and DLIST_DEMOTE() now take the type of the tmp pointer
not the tmp pointer itself anymore.

metze
2007-10-10 11:51:59 -05:00
Jeremy Allison
1ec77c5011 r17864: Fix possible null deref if client doesn't give us
an answer record. Found by the Stanford checker.
Jeremy.
2007-10-10 11:38:55 -05:00
Volker Lendecke
fac007ccbe r17807: Fix a file descriptor leak pointed out by John Malmberg. Thanks!
Volker
2007-10-10 11:38:49 -05:00