1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

185 Commits

Author SHA1 Message Date
Volker Lendecke
16f61a6f90 Speed up "net conf list"
For 1000 shares this speeds up net conf list from .6 to .25 seconds on my box

Signed-off-by: Michael Adam <obnox@samba.org>
2009-02-26 11:05:21 +01:00
Volker Lendecke
26f238466c Speed up "net conf list"
With 1000 shares in the registry, this changed the time of "net conf list" from
1.1 seconds to .6 seconds.

Signed-off-by: Michael Adam <obnox@samba.org>
2009-02-26 11:05:21 +01:00
Stefan Metzmacher
50db8ede23 s3:smbconftort: don't use reserved words ('test:', 'failure:', 'success:')
Temporary results printfs should not contain reserved subunit words.

metze
2009-01-30 19:47:59 +01:00
Michael Adam
a868d2f3d5 libsmbconf: move the non-registry parts of libsmbconf to top level
Michael
2009-01-21 18:40:58 +01:00
Michael Adam
85447ac747 s3:libsmbconf: include smbconf headers with lib/smbconf prefix
Michael
2009-01-21 18:40:57 +01:00
Michael Adam
7ac06f1609 s3:libsmbconf: use talloc_free instead of TALLOC_FREE in reg backend
Michael
2009-01-21 18:40:57 +01:00
Michael Adam
1ed0cc7c9b s3:libsmbconf: use talloc_free instead of TALLOC_FREE in txt backend
Michael
2009-01-21 18:40:56 +01:00
Michael Adam
d0a8c356fb s3:libsmbconf: use talloc_free instead of TALLOC_FREE in smbconf_init
Michael
2009-01-21 18:40:56 +01:00
Michael Adam
f0f5029fd7 s3:libsmbconf: use talloc_free instead of TALLOC_FREE in testsuite
Michael
2009-01-21 18:40:56 +01:00
Michael Adam
53ea574255 s3:libsmbconf: use talloc_free instead of TALLOC_FREE in smbconf_util.c
Michael
2009-01-21 18:40:55 +01:00
Michael Adam
c94fd054ca s3:libsmbconf: use talloc_free instead of TALLOC_FREE in smbconf.c
Michael
2009-01-21 18:40:55 +01:00
Michael Adam
9f3c67e80c s3:libsmbconf: remove the init headers from smbconf.h
give the smbconf_init() dispatcher and the backends
(smbconf_reg and smbconf_txt) a header of their own each.

This allows to use the basic infrastructure and
single backends individually.

Michael
2009-01-21 18:40:54 +01:00
Michael Adam
52b77c928c s3:libsmbconf: remove unused function smbconf_is_writeable_bystring()
Michael
2009-01-21 18:40:54 +01:00
Jelmer Vernooij
ddcab787c4 Rename dos_errstr() to win_errstr() for consistency with Samba 4. 2008-11-01 17:19:26 +01:00
Michael Adam
e4fe3320ec [s3]libsmbconf: add utility function smbconf_is_writeable_bystring()
This checks the writeability of a config source specified by the
config source name.

Michael
2008-10-27 13:02:41 +01:00
Michael Adam
3a06201086 [s3]libsmbconf: add method is_writeable() and wrapper smbconf_is_writeable()
This allows for per-config-source checking of write support.

Michael
2008-10-27 13:02:40 +01:00
Michael Adam
9c09d545bf [s3]libsmbconf: create text config in smbconftort
Michael
2008-10-27 13:02:40 +01:00
Michael Adam
b23106745c [s3]libsmbconf: return WERR_BADFILE when no path to text backend is provided.
Michael
2008-10-27 13:02:39 +01:00
Michael Adam
64ab71d2d7 [s3]libsmbconf: fall back to file backend when no valid backend was found
Interpret the source string as a file name when it contains
a ':' sign but the initial part is not a known backend.
This might occur even implicitly when "%T" is used in an
include file name (even though this is not realistic..).

Michael
2008-10-27 13:02:39 +01:00
Michael Adam
e453bf70c9 [s3]libsmbconf: fix comment typo.
Michael
2008-10-27 13:02:38 +01:00
Michael Adam
9299d53ef9 [s3]libsmbconf: add backend_requires_messaging() method to libsmbconf.
In a clustered environment, the registry backend needs messaging
to be set up since ctdb requires this.

Michael
2008-10-27 13:02:38 +01:00
Michael Adam
0ee8992331 [s3]libsmbconf: remove unused define.
Michael
2008-10-27 13:02:37 +01:00
Jelmer Vernooij
f9fb9436ae Use WERR_FILE_EXISTS which is the equivalent of WERR_ALREADY_EXISTS
previously present in Samba 3.
2008-10-23 15:37:39 +02:00
Jelmer Vernooij
2d89b52be8 Use separate make variables for libutil and libcrypto. 2008-10-18 14:28:40 +02:00
Jeremy Allison
570d5ecdbd Jim Brown <jim.brown@miami.edu> was right, this needs to be a signed int or
the loop never terminates.
Jeremy.
(This used to be commit 80e547665d)
2008-07-01 15:51:54 -07:00
Jeremy Allison
4a8b39974b Fix problem noticed by Jim Brown <jim.brown@miami.edu>. When reverse searching decrement index,
not increment. Michael please check !
Jeremy.
(This used to be commit d89f9d404f)
2008-07-01 15:28:13 -07:00
Michael Adam
1ef07a6686 libsmbconf: add "includes" to the forbidden_valnames[].
This removes the warning messages 'Unknown parameter encountered: "includes"'.

Michael
(This used to be commit b20019ceaa)
2008-06-23 11:11:59 +02:00
Michael Adam
cb5f5eac38 libsmbconf: fastpaths first in smbconf_reg_valname_valid().
Before dropping into lp_parameter_is_valid().

Michael
(This used to be commit 59beb7acd7)
2008-06-23 11:11:59 +02:00
Volker Lendecke
82e36e083d Increase level of debug msg when a regkey is not found
This is a pretty normal situation if you have "include=registry" set but no
configuration options have been set there yet.
(This used to be commit 727127f1dc)
2008-04-23 11:12:25 +02:00
Michael Adam
0ff2168bb6 libsmbconf: remove unnecessary talloc success check from smbconf_txt.c
talloc_stackframe() panics on NOMEM.

Michael
(This used to be commit dee57ad025)
2008-04-23 01:49:11 +02:00
Michael Adam
21e82d7afc libsmbconf: remove unnecessary talloc success checks from smbconf_reg.c
talloc_stackframe panics on NOMEM.

Michael
(This used to be commit 03fd30eef8)
2008-04-23 01:48:26 +02:00
Michael Adam
8cf78fd594 libsmbconf: remove unnecessary talloc success checks from smbconf.c
talloc_stackframe() panics on NOMEM.

Michael
(This used to be commit be4f8447cc)
2008-04-23 01:47:33 +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
5dd54c58b4 libsmbconf: add a struct smbconf_service to hold the parameter names + values.
Michael
(This used to be commit 8118a8348f)
2008-04-22 23:46:13 +02:00
Michael Adam
a376e2bf49 libsmbconf: fix comment headers in smbconf.h
Michael
(This used to be commit 54c0461679)
2008-04-22 16:32:31 +02:00
Michael Adam
03a9ee1520 libsmbconf: text backend remove comment references to "simple".
Michael
(This used to be commit 640b8ae7ad)
2008-04-22 16:11:38 +02:00
Michael Adam
b2425f88fa libsmbconf: rename smbconf_init_txt_simple() to smbconf_init_txt().
...for consistency.

Michael
(This used to be commit 3d1da73f66)
2008-04-22 16:11:37 +02:00
Michael Adam
9188c8e381 libsmbconf: rename text backend smbconf_txt_simple to smbconf_txt.
Michael
(This used to be commit dd9fe5aec4)
2008-04-22 16:11:37 +02:00
Michael Adam
4a9e0e6034 libsmbconf: fix segfault in listing share names / config.
Discovered by Günther while giving a talk. - Sorry Günther!

Michael
(This used to be commit 518f4d4e66)
2008-04-16 22:44:04 +02:00
Michael Adam
bcaac7fa36 libmsbconf: add handling of NULL share parameters to registry backend.
Michael
(This used to be commit 6c1181fda2)
2008-04-15 17:40:28 +02:00
Michael Adam
be504b9d32 libsmbconf: don't complain with WERR_ALREADY_EXISTS for NULL share in smbconf_create_share().
These are values stored inside the base key for registry.
This is not getting deleted.

Michael
(This used to be commit aa167de825)
2008-04-15 17:40:28 +02:00
Michael Adam
747d4a8f04 libsmbconf: make sure to always list the NULL section first in text backend.
Michael
(This used to be commit b50fdf321d)
2008-04-15 17:40:27 +02:00
Michael Adam
34e8ec54ce libsmbconf: default to the NULL section when a parameter is encountered w/o section
Michael
(This used to be commit e1b98f1cbc)
2008-04-15 17:40:27 +02:00
Michael Adam
e700800720 libsmbconf: allow NULL sharename in smbconf_share_exists().
Michael
(This used to be commit cb23052b20)
2008-04-15 17:40:27 +02:00
Michael Adam
0e7497936c libsmbconf: add handling of NULL strings to smbconf_find_in_array().
Michael
(This used to be commit a5923bafe9)
2008-04-15 17:40:27 +02:00
Michael Adam
b396ad07d1 libsmbconf: add handling of "NULL" strings to smbconf_add_string_to_array()
Michael
(This used to be commit aba261a914)
2008-04-15 17:40:27 +02:00
Michael Adam
4eab3d3cf0 libsmbconf: add a smbconf init dispatcher smbconf_init().
The dispatcher takes a config source argument in the form
of "backend:path" where backend can (currently) be one of
"txt" (aka "file") or "reg" (aka "registry").

When the path is omitted, it is up to the backend to provide
a default path.

When there is no separator ":" and the string is not a recognized
backend, then file backend is assumed and the string is passed
in as the path argument.

Michael
(This used to be commit cc613a60eb)
2008-04-13 20:04:44 +02:00
Michael Adam
09c6c38deb libsmbconf: move setting of verbatim variable into a more internal function.
Michael
(This used to be commit 9efd7b5151)
2008-04-13 20:04:44 +02:00
Michael Adam
935b99c84c libsmbconf: add a check for talloc failure to smbconf_txt_init().
Michael
(This used to be commit f76ec7d87e)
2008-04-13 20:04:44 +02:00
Michael Adam
35d6068f25 libsmbconf: remove the bool verbatim parameter from txt backend init function.
Always be verbatim for now. Backend config options may be added later
via some private data pointer.

Michael
(This used to be commit e8bafcfbf4)
2008-04-13 20:04:43 +02:00
Michael Adam
611b6bfa3b libsmbconf: rename smbconf_init() to smbconf_init_internal().
smbconf_init should be the name of the dispatcher (to be written)

Michael
(This used to be commit 3fb95ab757)
2008-04-13 20:04:43 +02:00
Michael Adam
6c66d5d019 registry: change registry_init_smbconf() to return WERROR instead of bool
Michael
(This used to be commit 7c343c6057)
2008-04-13 15:33:48 +02:00
Michael Adam
bcb19766d6 registry: make registry_init_smbconf() hook the registry ops onto given key.
This still defaults to HKLM\Software\Samba\smbconf, but is interchangeable now.
This allows us to open the libsmbconf registry backend on different registry keys.

Michael
(This used to be commit 8fe1a2f567)
2008-04-13 15:33:47 +02:00
Michael Adam
a3f1b5f150 libsmbconf: don't mark the API as "subject to change" any longer.
At least I hope it won't need many changes anymore...

Michael
(This used to be commit c4e1439ede)
2008-04-11 15:40:02 +02:00
Michael Adam
3201155e00 libsmbconf: testsuite: add test for delete_includes
Michael
(This used to be commit 757601ec83)
2008-04-10 01:29:01 +02:00
Michael Adam
30fedf2855 libsmbconf: return success and count 0 from get_includes when no includes present.
Michael
(This used to be commit 182433be5b)
2008-04-10 01:29:01 +02:00
Michael Adam
87ca447231 libsmbconf: add delete_includes mehtod to the api (and backend implementations)
Michael
(This used to be commit daef50e54d)
2008-04-10 01:29:01 +02:00
Michael Adam
1321dda51b libsmbconf: let set_includes delete the includes paramter when given an empty list
instead of complaining

Michael
(This used to be commit 0dc1fd6859)
2008-04-10 01:29:01 +02:00
Michael Adam
9a3fe1943e libsmbconf: fix crashbug - correctly check for existence of file.
Michael
(This used to be commit dd543cd30c)
2008-04-10 01:29:01 +02:00
Michael Adam
bb91ab6116 libsmbconf: prevent getting/deleting value "includes".
This has to be handled differently (by using get_includes / set_includes)

Michael
(This used to be commit 5a880c6a2f)
2008-04-10 01:29:01 +02:00
Michael Adam
d26daa0234 libsmbconf: consider "include" a forbidden parameter in regisry config again.
It is now taken care of by the special includes handling.

Michael
(This used to be commit 2c8c65d690)
2008-04-10 01:29:00 +02:00
Michael Adam
7bf407c711 libsmbconf: add includes at the end of parameter list in reg_get_share().
Michael
(This used to be commit 9bd06d5737)
2008-04-10 01:29:00 +02:00
Michael Adam
bb39d5c14b libsmbconf: add function smbconf_reg_valname_valid() and use it in get_values()
so "includes" doesn't get listed as a parameter

Michael
(This used to be commit 01c4bd0730)
2008-04-10 01:29:00 +02:00
Michael Adam
1da629537c libsmbconf: refactor get_includes on opened key into smbconf_reg_get_includes_internal()
Michael
(This used to be commit 072a3228a4)
2008-04-10 01:29:00 +02:00
Michael Adam
a7e06ad625 libsmbconf: rename registry_smbconf_valname_forbidden() to smbconf_reg_valname_forbidden()
Michael
(This used to be commit 23fb33fd33)
2008-04-10 01:29:00 +02:00
Michael Adam
b91cdf7183 libsmbconf: make registry_smbconf_valname_forbidden() static
Michael
(This used to be commit 798808174d)
2008-04-10 01:29:00 +02:00
Michael Adam
e06e8084c6 libsmbconf: move registry_smbconf_valname_forbidden() to the registry backend
from util_reg.c - no other callers left

Michael
(This used to be commit 98151fd3e1)
2008-04-10 01:29:00 +02:00
Michael Adam
7f0127a903 libsmbconf: more sanely print multi_sz values in registry backend
Michael
(This used to be commit 382c623948)
2008-04-10 01:28:59 +02:00
Michael Adam
40c60b0917 libsmbconf: testsuite: fix handling of error message/overall status
Michael
(This used to be commit c2d3d56d62)
2008-04-10 01:28:59 +02:00
Michael Adam
70bb9a919b libsmbconf: testsuite: add test_set_get_includes() and use it in registry test
Michael
(This used to be commit 1f64a1b2b4)
2008-04-10 01:28:59 +02:00
Michael Adam
097a056df9 libsmbconf: testsuite: refactor printing of string lists out.
Michael
(This used to be commit 828c729724)
2008-04-10 01:28:59 +02:00
Michael Adam
56c0f28a50 libsmbconf: implement get_includes() and set_includes() for registry backend.
includes are stored per share in a special registry value "includes"
of type multi_sz.

Michael
(This used to be commit 3fee0d79cc)
2008-04-10 01:28:59 +02:00
Michael Adam
8c091a60d4 libsmbconf: testsuite: test get_includes for registry backend
Michael
(This used to be commit 31e68cbe5b)
2008-04-10 01:28:59 +02:00
Michael Adam
07d038652c libsmbconf: testsuite: use the get_global_includes in get_includes test.
Michael
(This used to be commit 2a4b71b105)
2008-04-10 01:28:58 +02:00
Michael Adam
d399778acc libsmbconf: add "_global_" wrappers for get/set_includes.
These use the usual global_check like the other global wrappers.

Michael
(This used to be commit ce1b2f5508)
2008-04-10 01:28:58 +02:00
Michael Adam
f4de1c6ac7 libsmbconf: testsuite: add test for "get_includes" and use it in the text backend test.
Michael
(This used to be commit 1ca5afe58c)
2008-04-10 01:28:58 +02:00
Michael Adam
dde53e5d68 libsmbconf: fill get_includes() in text backed to retrieve includes from cache.
Michael
(This used to be commit 5e253e10b7)
2008-04-10 01:28:58 +02:00
Michael Adam
893ed44762 libsmbconf: testsuite: set the debufg fd to stderr.
...so that we see some debug output

Michael
(This used to be commit 7cfec55ed4)
2008-04-10 01:28:58 +02:00
Michael Adam
e724bfae7a libsmbconf: testsuite: use POPT_COMMON_SAMBA instead of POPT_COMMON_CONFIGFILE
so we can for instance set the debug level on the command line.

Michael
(This used to be commit 94a1923462)
2008-04-10 01:28:58 +02:00
Michael Adam
869e011e0f libsmbconf: testsuite: add talloc_stackframe to main().
Michael
(This used to be commit 8c631ac2f4)
2008-04-10 01:28:58 +02:00
Michael Adam
e251327b5b libsmbconf: testsuite: add support for "--configfile" option.
Michael
(This used to be commit 9f6c909f46)
2008-04-10 01:28:57 +02:00
Michael Adam
b7377c33a3 libsmbconf: add testsuite to the library.
Currently only the init function is tested, more tests to come...

Michael
(This used to be commit bc8dc8626c)
2008-04-10 01:28:57 +02:00
Michael Adam
f5aac0a8d0 libsmbconf: add talloc context to the get_includes methods.
Michael
(This used to be commit ed535b6b30)
2008-04-10 01:28:57 +02:00
Michael Adam
8e97662899 libsmbconf: add get_includes() and set_includes() to the API.
Includes have to get a special treatment, at least for registry.
Includes are not like other smbconf parameters: they are some kind
of metainformation. "include" has two effects when stated twice so
it can not be stored boldly into registry, since there can only be
one value named "include" in registry per key.

I will provide special handling for includes for the registry backend.

This patch provides the necessary methods in the smbconf API.

Michael
(This used to be commit e86eb375d9)
2008-04-10 01:28:57 +02:00
Michael Adam
df6b68b073 libsmbconf: activate the verbatim-flag in text backend: store parameters as they come.
with verbatim == true, parameters are stored as they come from the input file,
duplicates are listed multiple times, etc.

Michael
(This used to be commit c65575f831)
2008-04-10 01:28:57 +02:00
Michael Adam
101587eb6e libsmbconf: pass txt_private_data instead of only cache to do_parameter/section
in preparation of using the verbatim flag.

Michael
(This used to be commit c68cd2477c)
2008-04-10 01:28:57 +02:00
Michael Adam
a01e840814 libsmbconf: load file after special initialization
otherwise verbatim parameter can have no effect.

Michael
(This used to be commit 2ff0b693d7)
2008-04-10 01:28:56 +02:00
Michael Adam
3d38f143df libsmbconf: add a "verbatim" parameter to smbconf_init_txt_simple().
Michael
(This used to be commit b9e72b402d)
2008-04-10 01:28:56 +02:00
Michael Adam
0acf338503 libsmbconf: reformat smbconf_format_registry_value() - indentations/tabs
Michael
(This used to be commit b79a33eb2f)
2008-04-10 01:28:56 +02:00
Michael Adam
ec12f0a25a libsmbconf: untangle assignment and test in for-loop condition.
Michael
(This used to be commit 4339caff09)
2008-04-10 01:28:56 +02:00
Michael Adam
3c40c2d7d3 libsmbconf: fix a comment
Michael
(This used to be commit bc1a5bdbd3)
2008-04-10 01:28:56 +02:00
Michael Adam
8c85c10f8a libsmbconf: search from the back when getting parameter from text backend
so we make sure to always deliver the value last read.

Michael
(This used to be commit 2eb5a681e9)
2008-04-10 01:28:56 +02:00
Michael Adam
862608ca1f libsmbconf: add smbconf_reverse_find_in_array() to find last occurence of a string.
Michael
(This used to be commit 25e0fd8478)
2008-04-10 01:28:55 +02:00
Michael Adam
498e5f99d2 libsmbconf: move smbconf_find_in_array() to smbconf_util.c
Michael
(This used to be commit 7af79e60a3)
2008-04-10 01:28:55 +02:00
Michael Adam
015e424bf1 libsmbconf: reorder prototypes in smbconf_private.h
Michael
(This used to be commit 0e932a0981)
2008-04-10 01:28:55 +02:00
Michael Adam
77fce35417 libsmbconf: rename smbconf_txt_find_in_array() to smbconf_find_in_array()
Michael
(This used to be commit 9890f43726)
2008-04-10 01:28:55 +02:00
Michael Adam
36ede8ae54 libsmbconf: move utility functions from main module to new smbconf_util.c
Michael
(This used to be commit e0f6a9d50c)
2008-04-10 01:28:55 +02:00
Michael Adam
24c54ee4fb libsmbconf: move initialization of registry value down after error checks.
Michael
(This used to be commit 2a8029985f)
2008-04-03 15:43:04 +02:00
Michael Adam
3d8727343b libsmbconf: text - pass the cache instead of all private data to pm_process.
Michael
(This used to be commit ee46f0eca6)
2008-03-27 00:32:09 +01:00
Michael Adam
916b30d502 libsmbconf: text - change the cache to be talloced
instead of having it directly as a member in the private data struct.
This makes it easier to flush and initialize the cache.

Michael
(This used to be commit 03efb72b46)
2008-03-27 00:32:09 +01:00