1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-12 04:23:49 +03:00
Commit Graph

767 Commits

Author SHA1 Message Date
Jeremy Allison
d6e2519c67 Remove pstring from param/
This was a little tricky..... I'll watch the
build farm.
Jeremy.
2007-11-13 18:42:42 -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
6bf053a6a1 Constrain "min receivefile size" to max of BUFFER_SIZE
(128k). Add debug error messages so we can see why
writeX large is denied. Ensure we don't allow recvfile
writes on IPC$.
Jeremy.
2007-11-07 21:47:00 -08:00
Gerald (Jerry) Carter
779353b86d Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-test 2007-11-01 21:30:43 -04: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
Volker Lendecke
94f2c35a68 save memory
Hi!

Attached find a patch that I've wanted to check in for ages.
The whole area probably needs a major rewrite, but this is a
minimal patch that on a 32-bit box saves 1.5k per smbd per
defined share, twice as much on a 64-bit box.

Volker

From ebb80e664ecc49eb597a45cb57e1067fbae49e62 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl@sernet.de>
Date: Wed, 31 Oct 2007 15:04:34 +0100
Subject: [PATCH] Change global->copymap from bool* to a bitmap

We right now have 401 parameters, so with bool being represented as a 64-bit
integer this saves about 3k of memory per smbd per share that is defined in
smb.conf.
2007-11-01 11:04:24 -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
Volker Lendecke
04d660bbb3 Fix two type-punned warnings 2007-10-21 08:47:30 +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
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
d100bfffe2 r25564: Pass sharename to delete_share_security() 2007-10-10 12:31:13 -05:00
Michael Adam
066a46ba91 r25434: Add the option to print the debug class (DBGC_CLASS) in the debug header.
Control this by a new boolean smb.conf option "debug class" which is
by default set to "no" to keep the default debug header unchanged.

Michael

Note: You need to make clean for this patch.
2007-10-10 12:31:05 -05:00
Andrew Bartlett
87d39f61b4 r25049: Set new, more secure defaults for Samba 3.2.
Andrew Bartlett
2007-10-10 12:30:36 -05:00
Volker Lendecke
9e53f50e94 r25036: Fix a become/unbecome_root() pair 2007-10-10 12:30:36 -05:00
Jeremy Allison
dee8beba7a r25009: Large patch discussed with Volker. Move unix_convert to a talloc-based
interface. More development will come on top of this. Remove the
"mangled map" parameter.
Jeremy.
2007-10-10 12:30:32 -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
Jeremy Allison
bea8e9840f r24639: Add parameter "directory name cache size" - parameterize
use of directory name cache, 100 by default. Will be needed
to turn this off for *BSD systems.
Jeremy.
2007-10-10 12:30:13 -05:00
Michael Adam
c0022ff927 r24636: Raise one debug level, since the callers (that want to do so)
issue a level 0 debug message.

Michael
2007-10-10 12:30:12 -05:00
Michael Adam
bf0daa74fa r24616: In set_boolean(), only pass the result back to the caller
if parsing of the boolean string was successful.
Also, initialize the local result variable
(although not strictly necessary anymore, now.)
2007-10-10 12:30:10 -05:00
Michael Adam
d13eaa60f5 r24602: Add function lp_string_is_valid_boolean() to check if a string
contains a correct representation of a boolean value (in the
understanding of loadparm.c).

Make set_boolean() catch passing NULL for the boolean target.

Michael
2007-10-10 12:30:09 -05:00
Michael Adam
07dc0fecf5 r24572: Allow for functions map_parameter_canonical() and is_synonym_of() to
be called with inverse == NULL.

Add a new function lp_parameter_is_canonical() to check whether a
parameter name is the canonical name (as apposed to an alias).

Michael
2007-10-10 12:30:07 -05:00
Michael Adam
3b762ab183 r24527: Add a function lp_canonicalize_parameter_with_value that turns
a parameter and value into the canonical paramter with the value
inverted if it was in invers boolean synonym.

Make net conf use this function when storing parameters.

Michael
2007-10-10 12:29:54 -05:00
Michael Adam
0dfb5eee25 r24526: Refactor determiniation of the index of the canonical form of a
parameter given in string representation into a function of its
own (map_parameter_canonical).

Michael
2007-10-10 12:29:54 -05:00
Michael Adam
fd2dbae825 r24525: Add output of synonym information to show_parameter_list().
Also simplify lp_canonicalize_parameter by making use of
the new function "is_synonym_of".

Michael

Note: If anything depends on the exact former output format of
show_parameter list, I would trigger the output of synonym information
by a boolean verbose switch (that could be passed to testparm
via the "-v" command line switch).
2007-10-10 12:29:53 -05:00
Michael Adam
70dfe5d098 r24519: Refactor printing of one parameter into a helper function of its own. 2007-10-10 12:29:53 -05:00
Michael Adam
ce1d7ad1ac r24510: Fix logic. Thanks to Volker for the hint!
Michael
2007-10-10 12:29:53 -05:00
Michael Adam
113ac07199 r24495: Add a function lp_canonicalize_parameter: It takes a name of a parameter
and produces the "canonical" (or main) name of the parameter (the one
synonym that does not have the flag FLAG_HIDE). The function also sets
a flag as to whether the synonym is a reverse boolean synonym.

Add some functions for the handling of string representations of boolean
values: return the canonical string representation of a bool, invert
a bool given as a string, canonicalize a bool given as a string.

Michael
2007-10-10 12:29:52 -05:00
Volker Lendecke
d941aae2df r24453: Remove the read and write bmpx calls
Talked to both Tridge and Jeremy about this, Tridge said that there is a
special error message persuading OS/2 to fall back to other methods.
The calls now checked in always return the error message we used to
return when "read bmpx = False" was set (the default): ERRSRV, ERRuseSTD.

If someone has a reproducable test case where this is really needed, we
can always dig it up from version control and convert it to the new API.
But that time without that silly parameter, and with a torture test case
for "make test" please :-)

Volker
2007-10-10 12:29:49 -05:00
Volker Lendecke
df40d336af r24266: Remove the "open files database hash size" parameter
This has been superseded by the "tdb_hashsize:<tdbname>" parameter
2007-10-10 12:29:22 -05:00
Stefan Metzmacher
26ccbad721 r24072: Add "client ldap sasl wrapping" parameter.
Possible values are "plain" (default), "sign" or "seal".

metze
2007-10-10 12:29:02 -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
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Michael Adam
7f85cff49d r23666: Rename lp_parameter_valid -> lp_parameter_is_valid.
Michael
2007-10-10 12:23:44 -05:00
Michael Adam
bf92d56798 r23657: Prevent setting of a global option in a share definition
in "net conf setparm".

Michael
2007-10-10 12:23:42 -05:00
Michael Adam
639051e58d r23656: Add initial checking of the validity of a paramter
given to "net conf setparm". Add a utility function
lp_parameter_valid() for this to loadparm.c.

Michael
2007-10-10 12:23:42 -05:00
Michael Adam
00be68a841 r23641: Put check for forbidden values in smbconf into a function.
(This will be used in a next step to prevent storing these
values in reg_smbconf.c.)

Michael
2007-10-10 12:23:40 -05:00
Michael Adam
bbbfd7f41a r23592: Change a debuglevel to not clutter output when calling
net as a non-root user, e.g.

Michael
2007-10-10 12:23:34 -05:00
Michael Adam
56f82485ec r23579: Up to now, the "allparameters" argument to lp_next_parameter was
not effective for the global section (snum < 0). This checkin
makes it effective for the global section, too.

This does not produce changes in the results of the present calls of
lp_next_parameter: Beside the new use in utils/net_conf.c (which is
hereby fixed), the only calls of lp_next_parameter are in web/swat.c,
where it is effectively always called with allparameters == 1.

Michael
2007-10-10 12:23:32 -05:00
Michael Adam
235a5ae4cd r23575: Fix a segfault when lp_load is called before init_registry.
Michael
2007-10-10 12:23:31 -05:00
Michael Adam
3695a66166 r23553: Also ignore "lock directory" in registry global options.
Michael
2007-10-10 12:23:28 -05:00
Michael Adam
a4714b3428 r23552: Use proper comparison function an fix logic.
Michael
2007-10-10 12:23:28 -05:00
Michael Adam
73e41c1d0a r23548: Fix comments.
Michael
2007-10-10 12:23:27 -05:00
Michael Adam
f0992c0d79 r23547: Ignore parameter "include" in regsitry globals.
Michael
2007-10-10 12:23:27 -05:00
Jeremy Allison
fca5637dc6 r23513: Fix one more use of VALUE_PREFIX.
Jeremy.
2007-10-10 12:23:24 -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
Michael Adam
24b0cbcb37 r23509: This activates the global options from the registry in loadparm.
The global options are stored as values in the subkey "global"
of the SMBCONF registry key.

The activation is accomplished in smb.conf though a new special
semantic of the "include" parameter: "include = registry" triggers
the processing of the registry global options exactly at the
position of the include statement. Options read from the registry
take the same precedence as parameters loaded from a file via
include. Need to reload the registry globals is detected by
watching the tdb sequence number.

Registry shares are automatically activated when the registry
globals are processed.

So a "registry only" configuration can be realized by an
smb.conf that looks as follows:

================================
[global]
include = registry
================================

The global options and registry shares can be conveniently
edited with the "net conf" utility.

Caveat:

A possible pitfall consists in using "include = registry"
together with the "lock directory" directive in the registry.
This problem will be addressed in the next time.

Note on the code:

Processing of the registry options is accomplished by a function
process_registry_globals() in loadparm.c The current version is
only an interim solution: It is handcoded instead of using the
infrastructure of reg_api.c. The reason for this is that using
reg_api still has too large linker dependencies, bloating virtually
all targets by PASSDB_OBJ, SMBLDAP_OBJ, GROUPDB_OBJ and LDB stuff.
A version of process_registry_globals that uses reg_api is
included but commented out. The goal is to eventually refactor
and restructure the registry code so that one can use the reg_api
to access only the registry tdb and not link all the dynamic
backends with all their linking implications.
2007-10-10 12:23:23 -05:00
Gerald Carter
1f80f9d145 r23472: add missing default setting for 'winbind nss info' (merge from 3.0.26) 2007-10-10 12:23:19 -05:00
Gerald Carter
3d3a813035 r23471: Here's a rough patch for expanding domain group membership
in the winbindd_getgrnam() call.  Couple of comments:

* Adds "winbind expand groups" parameter which defines the
  max depth winbindd will expand group members.  The default
  is the current behavior of one level of expansion.
* The entire getrgnam() interface should be async.  I
  haven't done that.
* Refactors the domain users hack in fill_grent_mem() into
  its own function.
2007-10-10 12:23:19 -05:00
Volker Lendecke
15553d6327 r23410: Merge the core of the cluster code.
I'm 100% certain I've forgotten to merge something, but the main code
should be in. It's mainly in dbwrap_ctdb.c, ctdbd_conn.c and
messages_ctdbd.c.

There should be no changes to the non-cluster case, it does survive make
test on my laptop.

It survives some very basic tests with ctdbd enables, I did not do the
full test suite for clusters yet.

Phew...

Volker
2007-10-10 12:23:14 -05:00