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

1004 Commits

Author SHA1 Message Date
Michael Adam
33d18c76f1 [s3]loadparm: fix memory error - free the right param_opt->list in copy_service.
Michael
2008-09-27 22:28:26 +02:00
Michael Adam
612aa3915f [s3]loadparm: refactor freeing of parametric options into free_param_opts().
This code was there in three places.

Michael
2008-09-27 22:28:25 +02:00
Michael Adam
b38ed2674b [s3]loadparm: rename process_registry_service() to process_smbconf_service().
There is nothing registry-specific in that function.

Michael
2008-09-27 22:28:25 +02:00
Michael Adam
21c4061414 [s3]loadparm: add a command test_lp_load to test the lp_load function.
This is not like testparm, just a simple tool that runs
lp_load_with_registry_shares the requested number of times.

Michael
2008-09-27 22:28:24 +02:00
Karolin Seeger
9cf1a68977 printing: Rename new parameter "cups timeout" to "cups connection timeout".
Karolin
2008-09-24 11:09:04 -07:00
Karolin Seeger
765e5d2282 printing: Add new parameter "cups timeout".
The default timeout for connections to CUPS servers is set
to 5 minutes in the CUPS libraries. The smbd hangs on startup
until the timeout is reached if the CUPS server is unreachable.
This parameter makes the timeout configurable. The default value
is set to 30 seconds.

Karolin
2008-09-23 16:57:58 -07:00
Jeremy Allison
c16f2907c5 Fix bug #5729. Explicitly allow "-valid".
Jeremy
(This used to be commit 4f2de29723)
2008-09-03 13:06:36 -07:00
Volker Lendecke
c529cd153f Increase the default positive idmap cache time to a week
(This used to be commit 60af636750)
2008-08-26 13:01:11 -07:00
Karolin Seeger
b90607e6e8 loadparm: idmap backend is not depracated any longer.
Karolin
(This used to be commit fcfab47036)
2008-08-22 10:06:26 +02:00
Jeremy Allison
79150da70b Here is a re-working of the winbindd
reconnect code to cope with rebooting a DC. This
replaces the code I asked Volker to revert.
The logic is pretty simple. It adds a new parameter,
"winbind reconnect delay", set to 30 seconds by
default, which determines how long to wait between
connection attempts.
To avoid overwhelming the box with DC-probe
forked children, the code now keeps track of
the DC probe child per winbindd_domain struct
and only starts a new one if the existing one
has died.
I also added a little logic to make sure the
dc probe child always sends a message whatever
the reason for exit so we will always reschedule
another connect attempt.
Also added documentation.
Jeremy.
(This used to be commit 8027197635)
2008-08-20 16:24:22 -07:00
Jeremy Allison
03991ab073 Fix bug 5686 - libsmbclient segfaults with more than one SMBCCTX.
Here is a patch to allow many subsystems to be re-initialized. The only
functional change I made was to remove the null context tracking, as the memory
allocated here is designed to be left for the complete lifetime of the program.
Freeing this early (when all smb contexts are destroyed) could crash other
users of talloc.
Jeremy.
(This used to be commit 8c630efd25)
2008-08-12 13:35:15 -07:00
Volker Lendecke
340ab6a256 idmap rewrite
(This used to be commit 30a180f2fc)
2008-08-12 11:28:29 +02:00
Michael Adam
bf291c95bc loadparm: add two parameters "init logon delay hosts" and "init logon delay"
"init logon delays hosts" takes a list of hosts names or addresses
or networks for which the initial SAMLOGON reply should be delayed
(so other DCs get preferred by XP workstations if there are any).
This option takes the same type of list as "hosts allow" does.

"init logon delay" allows one to configure the delay for the hosts
configured for delayed initial samlogon with "init logon delayed hosts".
The value is interpreted as milliseconds. The default value is 100.

This commit only introduces the parameters.
They will be activated in a subsequent commit.

Michael
(This used to be commit f7c1f85438)
2008-08-09 01:15:58 +02:00
Michael Adam
1a6aecaea8 testparm: Display warning if invalid values are used.
This one came up while using "csc policy = disabled" instead of
"disable"... ;-)
(This used to be commit d01da44de7)
2008-07-30 16:31:09 +02:00
Volker Lendecke
065fb506a2 Sequel to c10aad9f13: Ignore whitespaces in parametric options
It's a bit difficult to explain why

idmap config backend:FOO = rid

should work while

idmap config backend : FOO = rid

should not. And I doubt we will ever see domain names with whitespaces...
(This used to be commit 0207f99d3f)
2008-07-16 18:21:22 +02:00
Volker Lendecke
d11796d392 Tiny logic simplification: Remove an indentation by using an early return;
(This used to be commit 37dba0c192)
2008-07-16 18:21:17 +02:00
Volker Lendecke
ed5e6b3244 Remove a silly "typedef struct _param_opt_struct param_opt_struct"
(This used to be commit 78801431c8)
2008-07-16 18:21:11 +02:00
Jeremy Allison
24eec914c0 Fix swat. Bug #5613.
Jeremy
(This used to be commit 15920f8388)
2008-07-15 14:37:48 -07:00
Volker Lendecke
d5ccdcce0b Revert "Slightly increase the default idmap cache time"
This reverts commit 448836d44d.
(This used to be commit a9b29ab6b7)
2008-07-11 17:53:24 +02:00
Volker Lendecke
5515c0e81c Slightly increase the default idmap cache time
(This used to be commit 448836d44d)
2008-07-03 21:19:09 +02:00
Jeremy Allison
1fb1c67fb9 Patch from SATOH Fumiyasu <fumiyas@osstech.co.jp> for bug #5202. Re-activate "acl group control"
parameter and make it only apply to owning group. Also added man page fix.
Jeremy.
(This used to be commit e98e080bad)
2008-07-03 10:24:12 -07:00
Volker Lendecke
335e3b1197 Fix the build
(This used to be commit 3bfeae651f)
2008-06-25 16:25:05 +02:00
Andrew Tridgell
927621ba12 make parametic options case insensitive
This is needed as some options are uppercased internally in Samba, such as the idmap config option
Without this change it is not possible to set these options via net conf which lowercases options
(This used to be commit c10aad9f13)
2008-06-25 21:40:53 +10:00
Michael Adam
769646efc6 loadparm: use the return value of the special handlers in lp_load().
Up to now, the bool return value was silently ignored.

Michael
(This used to be commit c65d425fec)
2008-06-19 17:22:27 +02:00
Michael Adam
09d769057e loadparm: don't treat a missing include file as an error in handle_include().
Michael
(This used to be commit a8ef8870be)
2008-06-19 17:22:27 +02:00
Volker Lendecke
2cfacbaacb Always set "registry shares = yes" for "include = registry"
This fixes the case where "include = registry" is set in the smb.conf text file
and *only* shares (no [global] settings) are present in the registry.

Michael, please check!

Thanks,

Volker
(This used to be commit 6c80362e29)
2008-06-03 21:36:56 +02:00
Björn Jacke
d8b234648c Add ldap connection timeout for OpenLDAP and Netscape LDAP libs. This can be controlled via the ldap connection timeout parameter. This fixes fallbacks to secondary LDAP servers in multi LDAP server setups like in #4544
(This used to be commit 8e59a2fedc)
2008-06-03 16:32:31 +02:00
Michael Adam
2f446d9e55 loadparm: fix process_registry_shares() when there is only [global] in registry.
This fixes testparm printing "Error loading services." when there is only
the global section in registry and no other service definition.

Michael
(This used to be commit 28d1972200)
2008-05-27 11:00:30 +02:00
Michael Adam
33f632b8b5 loadarm: fix testparm with "config backend = registry".
Set the iServiceIndex to "-1" for starup with either config
backend (originally only for text backend). Otherwise,
process_registry_shares() will fail.

Currently, the only user of lp_load_with_registry_shares() is testparm.

Michael
(This used to be commit 5e2b925367)
2008-05-26 12:00:13 +02:00
Michael Adam
42beddc991 loadparm: add funcion lp_load_with_registry_shares().
This is like lp_load(), except that it will load the
registry shares into the services aarray when registry
shares are activated.

Michael
(This used to be commit b387c614ba)
2008-05-15 02:42:41 +02:00
Michael Adam
0589c607a7 loadparm: add call to do_section() to process_registry_service().
Michael
(This used to be commit e1b76cd5d6)
2008-05-15 02:42:41 +02:00
Michael Adam
0ba819dd21 loadparm: add parameter allow_registry_shares to lp_load_ex().
This allows for registry shares to be activated, i.e. loaded into
the services array at lp_load() time.

Michael
(This used to be commit b3233ecefd)
2008-05-15 02:42:41 +02:00
Michael Adam
86766b5220 loadparm: add a function process_registry_shares()
This loads the shares defined in registry into the services array.

Michael
(This used to be commit b3a90b7251)
2008-05-15 02:42:40 +02:00
Michael Adam
8cb4461044 loadparm: refactor processing of service out of process_registry_globals()
into new function process_registry_service().

Michael
(This used to be commit 2986e5174e)
2008-05-15 02:42:40 +02:00
Michael Adam
18b385ccef loadparm: refactor initalization of registry config out into lp_smbconf_ctx().
Michael
(This used to be commit 83cd9f74d5)
2008-05-15 02:42:40 +02:00
Michael Adam
1e161b8c81 loadparm: Fix activation of registry globals in lp_load_*.
This completes bba04a8fba:
The reverted logic has to be put into the callers
lp_load() and lp_load_initial_only() of lp_load_ex(), too.
Silly bug.

Michael
(This used to be commit c1f300c76e)
2008-05-10 00:15:00 +02:00
Michael Adam
fb9232c0a9 libsmbconf: rewrite API to use smbconf_service struct
instead of lists of strings and counters directly...

Michael
(This used to be commit 17415e2dc4)
2008-04-23 01:43:31 +02:00
Michael Adam
00210d773b loadparm: reformat - fix whitespace/tab
Michael
(This used to be commit 3acc0d84dc)
2008-04-21 00:21:23 +02:00
Michael Adam
4244655e5b loadparm: rename bNoIncludes to bAllowIncludeRegistry (inverting logic)
This is what that variable controls now...

Michael
(This used to be commit bba04a8fba)
2008-04-21 00:21:23 +02:00
Michael Adam
318c983d82 loadparm: make lo_load_initial() only skip registry include.
This is only to be able to set everything properly for registry
before reading registry includes.

This fixes "make test" as non-root user in a directory, where
root-daemons have already created a messaging.tdb in the compiled
in lockdir...

Michael
(This used to be commit 1bb28bc1d8)
2008-04-21 00:21:23 +02:00
Stefan Metzmacher
49bf9d35cd loadparm: make it possible to just load the config without following "include =" statements
metze
(This used to be commit 6b5c76bf1e)
2008-04-18 14:43:07 +02:00
Michael Adam
2e1e83b4c0 loadparm: reactivate special semantics of "include = registry" for now.
This includes the configuration stored in HKLM/Software/Samba/smbconf .

Michael
(This used to be commit 42c7fb4ddf)
2008-04-17 18:39:00 +02:00
Michael Adam
b7bb61eff0 loadparm: remove pfunc parameter from process_registry_globals().
Use do_parameter() directly.

Michael
(This used to be commit 59b81bfd0a)
2008-04-15 22:45:38 +02:00
Michael Adam
9fd9060e53 loadparm: use the new smbconf_init() dispatcher for loading registry config.
Michael
(This used to be commit 78afb30f80)
2008-04-13 20:04:44 +02:00
Björn Jacke
67be6b3af7 fix some extrasemi compile warnings
(This used to be commit cbdb79b7a1)
2008-04-10 08:55:57 +02:00
Michael Adam
92f52469a9 loadparm: drop debug level in map_parameter from 0 to 1
we don't want to see this all the times in tests.

Michael
(This used to be commit fd43a4a1e0)
2008-04-10 01:29:02 +02:00
Michael Adam
2b84aea424 loadparm: add userdata parameter to do_section() and do_parameter().
The userdata is currently unused. It can be used in the future for
passing a context like in samba4 code.

Michael
(This used to be commit 31b31171bd)
2008-03-26 14:55:05 +01:00
Michael Adam
6f7cfeddd6 libsmbconf: add a "path" variable to the conf context.
This is passed to the module init routines.
In case of the registry, this is the path of the
basekey in registry, that is to be used, defaulting
to KEY_SMBCONF (HKLM\software\samba\smbconf), when
NULL is given. This is the only case currently used.

In order to support other keys, registry initialization
for smbconf has to be changed to support different keys.

Michael
(This used to be commit 96434d9dc7)
2008-03-21 18:19:24 +01:00
Michael Adam
fececde181 libsmbconf: add backend specific init function.
Hide generic init function taking smbconf_ops argument
from public api.

Michael
(This used to be commit b3f6920ccb)
2008-03-21 02:25:56 +01:00
Michael Adam
adf5bf554c libsmbconf: rename smbconf_open() to smbconf_init().
That's more appropriate.

Michael
(This used to be commit d7bd9bb8aa)
2008-03-21 02:25:56 +01:00
Michael Adam
153ed797e6 libsmbconf: change the API to always take the smbconf_ctx parameter first.
..for consistency. Exception: the open/init function, where the smbconf_ctx
is created from the given talloc context.

Michael
(This used to be commit 304dba6cb2)
2008-03-21 02:25:55 +01:00
Michael Adam
7621b4c3d8 libsmbconf: change smbconf_get_seqnum() to smbconf_changed().
The former seqnum is hidden inside a struct smbconf_csn.
And the get_seqnum is united with a changed function that
stores the seqnum inside the given csn.

Michael
(This used to be commit 5b6b90900a)
2008-03-21 02:25:55 +01:00
Michael Adam
f18722f889 loadparm: reenable checking files for updates while in registry configuration.
This is necessary now that includes (to files) are enabled from registry.

Michael
(This used to be commit 7dc64d1021)
2008-03-20 15:01:52 +01:00
Michael Adam
78d37365d4 loadparm: remove unneeded include.
libnet.h unneeded after separation of libsmbconf from libnet.

Michael
(This used to be commit 5c3f14e02f)
2008-03-20 15:01:52 +01:00
Michael Adam
6274929b1e libsmbconf: rename all occurrences of libnet_conf_ to smbconf_ .
Michael
(This used to be commit 097af0309d)
2008-03-17 18:03:02 +01:00
Michael Adam
646f3b6fec loadparm: add a debug message.
Michael
(This used to be commit ce943aeb58)
2008-03-12 02:12:34 +01:00
Michael Adam
7af7afc594 loadparm: remove services read from smb.conf when starting over for config backend registry.
Michael
(This used to be commit b942ff6b7f)
2008-03-12 02:12:34 +01:00
Michael Adam
90fd5082a2 loadparm: add convenience wrapper lp_kill_all_services()
Michael
(This used to be commit 32bfd131e3)
2008-03-12 02:12:34 +01:00
Michael Adam
a3eae3039d loadparm: add a comment
Michael
(This used to be commit 05eda12525)
2008-03-12 02:12:34 +01:00
Michael Adam
e14e348d06 loadparm: fix a comment typo.
Michael
(This used to be commit 0a619d4dc4)
2008-03-12 02:12:33 +01:00
Michael Adam
62c9c6be22 loadparm: add utility function to check for config backend file.
Michael
(This used to be commit 288495ec1a)
2008-03-12 02:12:33 +01:00
Michael Adam
4f739abea5 loadparm: use a function to check for the registry config backend.
Michael
(This used to be commit 4ac52a5a1d)
2008-03-12 02:12:33 +01:00
Michael Adam
9fa02847b7 loadparm: fix init_globals() to re-init all options event when called 2nd time.
Up to the globals had only been fully reset when init_globals() was called
for the first time. But a full restart is needed for use with
"config backend = registry". (And should be with "config file = ...", but
in this case the restart is outsourced to the daemons.) This left
some options (like e.g. "realm") set to values that were set in smb.conf
before the occurence of "config backend = registry".

Now this misbehaviour is fixed with this change.

Michael
(This used to be commit f12259d9c4)
2008-03-10 17:22:41 +01:00
Michael Adam
080fedd25e loadparm: replace typedef struct {} global/service by struct global/struct service.
Michael
(This used to be commit ab70e781b2)
2008-03-10 17:22:40 +01:00
Michael Adam
ffb45fd8f8 loadparm: fix whitespaces in global and service parameter structs.
Michael
(This used to be commit 10ab0681e6)
2008-03-10 17:22:40 +01:00
Michael Adam
b99ca19040 loadparm: fix spacing in parm_table (training spaces and empty lines).
Michael
(This used to be commit 91aab823fc)
2008-03-10 17:22:40 +01:00
Michael Adam
d4c24fff32 loadparm: Reformat the parm table to use named initializers.
This makes each entry in the parm table much more comprehensible
at first glance (to me). On the other hand, roughly 9 lines are
used instead of one for each entry which makes the overall list
less clearly laid out, one might argue. But we have 400+ lines
of parameter descriptions anyways...

Michael
(This used to be commit 869a17f1a9)
2008-03-10 17:22:40 +01:00
Derrell Lipman
914cd3e483 Eliminate global variable in_client and a plethora of extern declarations.
Derrell
(This used to be commit b7f34e7ef2)
2008-03-06 10:41:42 -05:00
Günther Deschner
ddd8bdedcb Fix lp_load with an empty registry and "config backend = registry". Michael, please check.
Guenther
(This used to be commit d9f4060c66)
2008-03-06 09:52:06 +01:00
Andreas Schneider
1751b533f0 Rename the 'hidden' variable to 'administrative share'.
(This used to be commit eff3d3bad5)
2008-02-29 13:08:04 +01:00
Jeremy Allison
22ac09c08c Remove my change
(This used to be commit 7bf4216644)
2008-02-28 02:13:48 -08:00
Jeremy Allison
9d37794a6c Fix debug %lu message.
Jeremy.
(This used to be commit 644a3be37a)
2008-02-28 02:07:06 -08:00
Andreas Schneider
d85c517b45 Add variable to define if a share should be hidden.
If you create a share on a Windows machine called foo$ then this share is
of the type STYPE_DISKTREE. So it is possible to administrate this kind of
share. Tested on Windows NT and 2003.

In samba we assume that if a share with a $ at the end must be of the type
STYPE_DISKTREE_HIDDEN. This is wrong, so we need a variable in the config
to define if the share should be hidden or not.
(This used to be commit a3da677bf0)
2008-02-26 21:34:05 +01:00
Volker Lendecke
3176392878 Fix some warnings
warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result
(This used to be commit ad37b7b0ae)
2008-02-25 16:09:26 +01:00
Michael Adam
6d963a807d Use linbet_conf code in loadparm's registry handling.
This replaces the original hand-written tdb code, now that the
linking dependencies have been significantly reduced.

Michael
(This used to be commit d08a3a1957)
2008-02-19 09:09:05 +01:00
Michael Adam
9af84dd382 Rename registry_init_regdb() to registry_init_smbconf().
That's what it actually is.

Michael
(This used to be commit 9d3c27f557)
2008-02-15 16:23:10 +01:00
Michael Adam
7183e5811e Add support for LDAP debug output in Samba log file.
Logging of the ldap libraries appears with a [LDAP] prefix
inside the samba logs. This is controlled by two new parameters:

* "ldap debug level" sets the debug level of the ldap libraries.
  It is the bit-field as understood by the openldap server.

* "ldap debug threshold" is the samba debug level at which ldap
  logging appears inside the samba logs.

This probably needs some configure tests since it makes
use of the LBER_OPT_LOG_PRINT_FN option to redirect the
debug output of the ldap libraries.

Michael
(This used to be commit 15c25990bd)
2008-02-06 18:16:22 +01:00
Volker Lendecke
b361956942 str_list_free is not needed anymore
(This used to be commit feddc1447d)
2008-02-04 21:05:41 +01:00
Volker Lendecke
2762b9a975 Always pass a TALLOC_CTX to str_list_make and str_list_copy
(This used to be commit e2c9fc4cf5)
2008-02-04 20:57:49 +01:00
Volker Lendecke
587cf54c61 strtok -> strtok_r
(This used to be commit fd34ce4370)
2008-01-23 15:08:04 +01:00
Michael Adam
536bff4229 Do an explicit init_globals() when restarting for "config backend = registry".
Michael
(This used to be commit 487c43f928)
2008-01-20 03:54:57 +01:00
Volker Lendecke
60c3ec3fca Revert "default to tdbsam instead of smbpasswd"
This reverts commit ab8ff39fd5.
(This used to be commit 5838a9f556)
2008-01-16 21:26:16 +01:00
Volker Lendecke
088183896a default to tdbsam instead of smbpasswd
(This used to be commit ab8ff39fd5)
2008-01-16 20:37:56 +01:00
Michael Adam
422fbd0bbd Add my (C) to loadparm.c.
I think now that I have changed some substantial logic,
I should confess.... :-)

Michael
(This used to be commit 704ac0ba49)
2008-01-16 17:15:08 +01:00
Michael Adam
762ca95be7 Remove special semantics of "include = registry" from loadparm.c
This is now replaced by "config backend = registry".

Michael
(This used to be commit 5680181025)
2008-01-16 17:10:02 +01:00
Michael Adam
d3be7a7bdd 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
(This used to be commit d8a7c3ec8e)
2008-01-16 17:10:02 +01:00
Michael Adam
1abc94e95b Initialise Globals.ConfigBackend from global var config_backend.
and use lp_config_backend() instead of config_backend.

Michael
(This used to be commit 9f69efe954)
2008-01-16 17:10:02 +01:00
Michael Adam
89b1c68b37 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
(This used to be commit 77b33cf34c)
2008-01-16 17:10:02 +01:00
Michael Adam
789720e0ed Add "MSDFS options" separator to parm_table.
Michael
(This used to be commit a103509a46)
2008-01-16 17:10:02 +01:00
Michael Adam
f2b2e01fd8 Re-order an option block in parm_table to re-unite the misc options.
Michael
(This used to be commit 9e11768256)
2008-01-16 17:10:02 +01:00
Volker Lendecke
059be4dda0 Reduce stat cache size default
Now that we have a LRU scheme for the stat cache we can live with a lot less
(This used to be commit 9e736aab07)
2008-01-09 11:25:49 +01:00
Michael Adam
22068a0c16 Change registry_create_admin_token() to return NTSTATUS.
Michael
(This used to be commit 9cd30fb25c)
2008-01-09 01:47:10 +01:00
Michael Adam
3ff1fc3932 Extend a comment.
Michael
(This used to be commit 0814352507)
2008-01-09 01:47:10 +01:00
Jeremy Allison
9254bb4ef1 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.
(This used to be commit c4e5a50504)
2008-01-04 12:56:23 -08:00
Jeremy Allison
675f41dc14 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.
(This used to be commit df7e447623)
2007-12-27 16:54:07 -08:00
Jeremy Allison
afc93255d1 Add SMB encryption. Still fixing client decrypt but
negotiation works.
Jeremy.
(This used to be commit d78045601a)
2007-12-26 17:12:36 -08:00
Volker Lendecke
eeb92cedde Fix a C++ warning
(This used to be commit c31c7e3e24)
2007-12-21 09:58:20 +01:00
Volker Lendecke
e518e19bc0 Remove Get_Pwnam and its associated static variable
All callers are replaced by Get_Pwnam_alloc
(This used to be commit 735f593154)
2007-12-19 21:09:10 +01: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
Günther Deschner
b0614071bf Add lp_include_registry_globals().
Guenther
(This used to be commit d30b945e99)
2007-12-12 00:58:58 +01:00
Volker Lendecke
ff1a79f24b Remove two completely unnecessary globals
Can someone look over this? To me it looks as if bufr was only made static to
save a malloc during an included smb.conf file. I think that's pretty much
pointless.
(This used to be commit 068e8de72c)
2007-12-10 12:36:43 -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
0c0054fe16 use dbwrap_rbt in loadparm.c
(This used to be commit e816293395)
2007-12-10 16:06:32 +01:00
Volker Lendecke
307396435b Convert ServiceHash to dbwrap
(This used to be commit 66bd6837b5)
2007-12-10 16:06:32 +01:00
Jeremy Allison
ade51769d5 We don't need P_GSTRING or P_UGSTRING anymore.
Jeremy.
(This used to be commit 78dc756000)
2007-12-07 12:43:10 -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
Volker Lendecke
78c6ee0090 Remove some globals
(This used to be commit 31d0a846db)
2007-12-05 14:39:07 +01:00
Günther Deschner
4b9f336a62 Move param helper routines to one place.
Guenther
(This used to be commit 6bf2c8038c)
2007-11-30 22:25:01 +01:00
Jeremy Allison
b11e6f2158 Save one extra strdup per lp_string. Use talloc_sub_basic()
directly.
Jeremy.
(This used to be commit f1e401ef5c)
2007-11-27 19:12:42 -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
7a3ece4145 Remove pstring from param/
This was a little tricky..... I'll watch the
build farm.
Jeremy.
(This used to be commit d6e2519c67)
2007-11-13 18:42:42 -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
ae74aa9993 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.
(This used to be commit 6bf053a6a1)
2007-11-07 21:47:00 -08:00
Gerald (Jerry) Carter
31286b302a Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-test
(This used to be commit 779353b86d)
2007-11-01 21:30:43 -04:00
Gerald (Jerry) Carter
88ee61625a 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
(This used to be commit d6cdbfd875)
2007-11-01 15:53:44 -04:00
Volker Lendecke
456ca680f2 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.
(This used to be commit 94f2c35a68)
2007-11-01 11:04:24 -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
Volker Lendecke
611479fd44 Fix two type-punned warnings
(This used to be commit 04d660bbb3)
2007-10-21 08:47:30 +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
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
b5535567c1 r25564: Pass sharename to delete_share_security()
(This used to be commit d100bfffe2)
2007-10-10 12:31:13 -05:00
Michael Adam
b6a6fbd493 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.
(This used to be commit 066a46ba91)
2007-10-10 12:31:05 -05:00
Andrew Bartlett
3428c63aa7 r25049: Set new, more secure defaults for Samba 3.2.
Andrew Bartlett
(This used to be commit 87d39f61b4)
2007-10-10 12:30:36 -05:00
Volker Lendecke
325b342f31 r25036: Fix a become/unbecome_root() pair
(This used to be commit 9e53f50e94)
2007-10-10 12:30:36 -05:00
Jeremy Allison
132ee3990a 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.
(This used to be commit dee8beba7a)
2007-10-10 12:30:32 -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
Jeremy Allison
f1041f98ce 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.
(This used to be commit bea8e9840f)
2007-10-10 12:30:13 -05:00
Michael Adam
85d0c15da4 r24636: Raise one debug level, since the callers (that want to do so)
issue a level 0 debug message.

Michael
(This used to be commit c0022ff927)
2007-10-10 12:30:12 -05:00
Michael Adam
aa1c863063 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.)
(This used to be commit bf0daa74fa)
2007-10-10 12:30:10 -05:00
Michael Adam
b9a7a2b966 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
(This used to be commit d13eaa60f5)
2007-10-10 12:30:09 -05:00
Michael Adam
987d7010f8 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
(This used to be commit 07dc0fecf5)
2007-10-10 12:30:07 -05:00
Michael Adam
c56874d112 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
(This used to be commit 3b762ab183)
2007-10-10 12:29:54 -05:00
Michael Adam
bb76f3f98e 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
(This used to be commit 0dfb5eee25)
2007-10-10 12:29:54 -05:00
Michael Adam
7190e7515b 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).
(This used to be commit fd2dbae825)
2007-10-10 12:29:53 -05:00
Michael Adam
b2455bb8d2 r24519: Refactor printing of one parameter into a helper function of its own.
(This used to be commit 70dfe5d098)
2007-10-10 12:29:53 -05:00
Michael Adam
ed4b40e9cb r24510: Fix logic. Thanks to Volker for the hint!
Michael
(This used to be commit ce1d7ad1ac)
2007-10-10 12:29:53 -05:00
Michael Adam
bf374d3d3d 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
(This used to be commit 113ac07199)
2007-10-10 12:29:52 -05:00
Volker Lendecke
24f42c5cef 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
(This used to be commit d941aae2df)
2007-10-10 12:29:49 -05:00
Volker Lendecke
28210588ed r24266: Remove the "open files database hash size" parameter
This has been superseded by the "tdb_hashsize:<tdbname>" parameter
(This used to be commit df40d336af)
2007-10-10 12:29:22 -05:00
Stefan Metzmacher
31dc9126c1 r24072: Add "client ldap sasl wrapping" parameter.
Possible values are "plain" (default), "sign" or "seal".

metze
(This used to be commit 26ccbad721)
2007-10-10 12:29:02 -05:00
Stefan Metzmacher
4ce5c36367 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
(This used to be commit 98c57562c4)
2007-10-10 12:28:57 -05:00
Andrew Tridgell
153cfb9c83 r23801: The FSF has moved around a lot. This fixes their Mass Ave address.
(This used to be commit 87c91e4362)
2007-10-10 12:28:27 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Michael Adam
f26abd78b1 r23666: Rename lp_parameter_valid -> lp_parameter_is_valid.
Michael
(This used to be commit 7f85cff49d)
2007-10-10 12:23:44 -05:00
Michael Adam
e388130aa6 r23657: Prevent setting of a global option in a share definition
in "net conf setparm".

Michael
(This used to be commit bf92d56798)
2007-10-10 12:23:42 -05:00
Michael Adam
2073303664 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
(This used to be commit 639051e58d)
2007-10-10 12:23:42 -05:00
Michael Adam
72f468088f 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
(This used to be commit 00be68a841)
2007-10-10 12:23:40 -05:00
Michael Adam
e8f99045c4 r23592: Change a debuglevel to not clutter output when calling
net as a non-root user, e.g.

Michael
(This used to be commit bbbfd7f41a)
2007-10-10 12:23:34 -05:00
Michael Adam
de81984b5e 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
(This used to be commit 56f82485ec)
2007-10-10 12:23:32 -05:00