1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-09 20:23:51 +03:00
Commit Graph

797 Commits

Author SHA1 Message Date
Volker Lendecke
e2c9fc4cf5 Always pass a TALLOC_CTX to str_list_make and str_list_copy 2008-02-04 20:57:49 +01:00
Volker Lendecke
fd34ce4370 strtok -> strtok_r 2008-01-23 15:08:04 +01:00
Michael Adam
487c43f928 Do an explicit init_globals() when restarting for "config backend = registry".
Michael
2008-01-20 03:54:57 +01:00
Volker Lendecke
5838a9f556 Revert "default to tdbsam instead of smbpasswd"
This reverts commit ab8ff39fd5.
2008-01-16 21:26:16 +01:00
Volker Lendecke
ab8ff39fd5 default to tdbsam instead of smbpasswd 2008-01-16 20:37:56 +01:00
Michael Adam
704ac0ba49 Add my (C) to loadparm.c.
I think now that I have changed some substantial logic,
I should confess.... :-)

Michael
2008-01-16 17:15:08 +01:00
Michael Adam
5680181025 Remove special semantics of "include = registry" from loadparm.c
This is now replaced by "config backend = registry".

Michael
2008-01-16 17:10:02 +01:00
Michael Adam
d8a7c3ec8e Add utility function lp_config_backend_is_registry().
So external callers can determine if we are running on
registry config without knowing the internals.

Michael
2008-01-16 17:10:02 +01:00
Michael Adam
9f69efe954 Initialise Globals.ConfigBackend from global var config_backend.
and use lp_config_backend() instead of config_backend.

Michael
2008-01-16 17:10:02 +01:00
Michael Adam
77b33cf34c Add config parameter "config backend = registry".
This adds a new config parameter "config backend" that can have
values "file" (default) and "registry". When lp_load() encounters
a "config backend = registry", then all config read up to that
point is discarded and globals are read from registry.

This is done in suche a way that as with "config file",
there is no way back to non-registry config during the
lifetime of a process: The file_list_changed mechanism
does not look at files anymore once config backend is
set to registry. This is modelled after the behaviour
of the "config file" option.

Note that only the global section is read by lp_load().
The shares are handled by the registry shares mechanism,
thus allowing for a smaller memory footprint since
share definitions are read on demand.

This new parameter is intended as a substitute of the
previously installed special semantics of "include = registry"
which allows for messed up mixed configurations.
This parameter (which has not yet been released) will
vanish next.

Michael
2008-01-16 17:10:02 +01:00
Michael Adam
a103509a46 Add "MSDFS options" separator to parm_table.
Michael
2008-01-16 17:10:02 +01:00
Michael Adam
9e11768256 Re-order an option block in parm_table to re-unite the misc options.
Michael
2008-01-16 17:10:02 +01:00
Volker Lendecke
9e736aab07 Reduce stat cache size default
Now that we have a LRU scheme for the stat cache we can live with a lot less
2008-01-09 11:25:49 +01:00
Michael Adam
9cd30fb25c Change registry_create_admin_token() to return NTSTATUS.
Michael
2008-01-09 01:47:10 +01:00
Michael Adam
0814352507 Extend a comment.
Michael
2008-01-09 01:47:10 +01:00
Jeremy Allison
c4e5a50504 Refactor the crypto code after a very helpful conversation
with Volker. Mostly making sure we have data on the incoming
packet type, not stored in the smb header.
Jeremy.
2008-01-04 12:56:23 -08:00
Jeremy Allison
df7e447623 Add "smb encrypt" parameter. Can be set to "no, yes, required".
Currently if set required this is not enforced. I'll be adding
that soon.
Jeremy.
2007-12-27 16:54: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
Volker Lendecke
c31c7e3e24 Fix a C++ warning 2007-12-21 09:58:20 +01:00
Volker Lendecke
735f593154 Remove Get_Pwnam and its associated static variable
All callers are replaced by Get_Pwnam_alloc
2007-12-19 21:09:10 +01: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
Günther Deschner
d30b945e99 Add lp_include_registry_globals().
Guenther
2007-12-12 00:58:58 +01: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
e816293395 use dbwrap_rbt in loadparm.c 2007-12-10 16:06:32 +01:00
Volker Lendecke
66bd6837b5 Convert ServiceHash to dbwrap 2007-12-10 16:06:32 +01:00
Jeremy Allison
78dc756000 We don't need P_GSTRING or P_UGSTRING anymore.
Jeremy.
2007-12-07 12:43:10 -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
Volker Lendecke
31d0a846db Remove some globals 2007-12-05 14:39:07 +01:00
Jeremy Allison
f1e401ef5c Save one extra strdup per lp_string. Use talloc_sub_basic()
directly.
Jeremy.
2007-11-27 19:12:42 -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
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