1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

102 Commits

Author SHA1 Message Date
Michael Adam
65b4a93c4a net_conf: fix non-testmode import function.
Michael
(This used to be commit cd17cc745a)
2008-03-27 00:32:09 +01:00
Michael Adam
0bdcc557ee net_conf: reformat - re-indent one function call.
Michael
(This used to be commit 9ef9d4c4e7)
2008-03-26 14:55:06 +01:00
Michael Adam
3253cffced net_conf: add casts to avoid compiler warnings.
Michael
(This used to be commit 1c6b9a0ac3)
2008-03-26 14:55:06 +01:00
Michael Adam
0234cc8bdd net_conf: rename "ctx" to "mem_ctx" for clarity.
There are also smbconf contexts arount...

Michael
(This used to be commit 5171df66eb)
2008-03-26 14:55:06 +01:00
Michael Adam
c2acc30bcb net_conf: use talloc_stackframe() instead of talloc_init().
Michael
(This used to be commit ab4fd03705)
2008-03-26 14:55:06 +01:00
Michael Adam
ca2f9297c2 net_conf: fix import function by using the new text backend of smbconf.
Originally, lp_load() was used to import files to registry.
This had several bugs. Most notably, options explicitly set to
default values were silently dropped, and all parametric options
were ignored.

This new implementation reads config from the text backend and
stuffs everything verbatim in to the registry backend.

Michael
(This used to be commit e41c6650f8)
2008-03-26 14:55:06 +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
23b1d721b8 libsmbconf: rename smbconf_close() to smbconf_shutdown().
Michael
(This used to be commit 797b26ad3f)
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
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
801eeaec09 Add and modify comments in net_conf.c
Michael
(This used to be commit b3afc8391d)
2008-01-13 23:45:57 +01:00
Michael Adam
a6bf13ce97 Add explicit creation of shares to net conf import function.
It has been removed from libnet_conf_set_parameter().

Michael
(This used to be commit b5c533b06c)
2008-01-13 23:30:08 +01:00
Michael Adam
1ee6d3e1ee Introduce a libnet_conf context created by libnet_conf_open().
The libnet_conf_ctx stores the information necessary to interoperate
with the configuration. It is created by calling libnet_conf_open()
and destroyed by calling libnet_conf_close(). The context is passed
to all the libnet_conf functions. It currently stores the token to
access the registry. Later, it could store more data, e.g. the server
to connect to, credentials, and so on. For support of other backends
than registry or support of remote configuration, only the open
function will have to be changed.

In net_conf, the calls to the actual net_conf functions is wrapped
into a function that calls libnet_conf_open()/_close(). Thus an
individual variant of net_conf_runfunction2() and functable2 is
used to cope with functions being called by the wrapper with the
additional libnet_conf_ctx argument.

Michael
(This used to be commit c2a9346faa)
2008-01-13 02:14:34 +01:00
Michael Adam
517ad5318d Fix spacing - spaces mixed with tabs.
Michael
(This used to be commit a4ef828102)
2008-01-04 21:16:48 +01:00
Michael Adam
dbdaa5eeec Fix a comment.
Michael
(This used to be commit fc9c3f39b5)
2008-01-04 21:09:55 +01:00
Michael Adam
dee8e32d8d Remove the word "registry" from the help output of the "net conf" command.
Michael
(This used to be commit 8d9e3e08f3)
2008-01-04 21:05:59 +01:00
Michael Adam
34fb783965 Update the introductory comment to net_conf.c to mention linbet_conf.
Michael
(This used to be commit e166b88637)
2008-01-04 21:05:59 +01:00
Michael Adam
b1472c0956 Remove the final regdb_close() from net_conf.c
This is to hide the registry from net_conf.
Right now, it does not harm if "net conf" does not close
the registry file explicitly just before exiting.
I am working out a proper way of handling open/close
operations transparently in the libnet_conf library.

Michael
(This used to be commit 790ef78944)
2008-01-04 19:52:22 +01:00
Michael Adam
2a8722d4c3 Fix the behaviour of "net conf setparm" to create the share if necessary.
This moves functionality taken away from libnet_conf_set_parameter() to the
higher level user frontend function. (Somehow I thought I had done this
already ... :-)

Michael
(This used to be commit fc0fca980f)
2008-01-04 19:49:57 +01:00
Günther Deschner
77219ddd22 Fix build warning.
Guenther
(This used to be commit a43125d9e9)
2008-01-04 17:43:23 +01:00
Michael Adam
5470f8f638 Make libnet_conf handle opening/initialization of the registry.
Open state is currently tracked by a global variable
to avoid double initialization.

Later, this can possibly be replaced by a conf-context
created by an initialization function and passed around
to the other api functions.

Michael
(This used to be commit 77713e7764)
2008-01-03 15:33:09 +01:00
Michael Adam
2476254ccd Rename libnet_smbconf_delparm() to libnet_conf_delete_parameter().
Michael
(This used to be commit 073eeca51e)
2008-01-03 14:17:49 +01:00
Michael Adam
55771b356d Rename libnet_smbconf_getparm() to libnet_conf_get_parameter().
Michael
(This used to be commit d08556dbc7)
2008-01-03 14:17:49 +01:00
Michael Adam
b9f904b59d Rename libnet_smbconf_setparm() to libnet_conf_set_parameter().
Michael
(This used to be commit e00cb415d3)
2008-01-03 14:17:49 +01:00
Michael Adam
e89411effd Rename libnet_smbconf_delshare() to libnet_conf_delete_share().
Michael
(This used to be commit 2075baf551)
2008-01-03 14:17:49 +01:00
Michael Adam
e1aa474a32 Rename libnet_smbconf_getshare() to libnet_conf_get_share().
Michael
(This used to be commit 1575612f19)
2008-01-03 14:17:49 +01:00
Michael Adam
3f3a29ed50 Rename libnet_smbconf_create_share() to libnet_conf_create_share().
Michael
(This used to be commit 6bc4ee2108)
2008-01-03 14:17:49 +01:00
Michael Adam
630de5f555 Rename libnet_smbconf_share_exists() to libnet_conf_share_exists().
Michael
(This used to be commit 3258758e5c)
2008-01-03 14:17:49 +01:00
Michael Adam
daf1a460c8 Rename libnet_smbconf_get_share_names() to libnet_conf_get_share_names().
Michael
(This used to be commit 2e4beee66b)
2008-01-03 14:17:49 +01:00
Michael Adam
90837d048b Rename libnet_smbconf_get_config() to libnet_conf_get_config().
Michael
(This used to be commit e8f7c07699)
2008-01-03 14:17:49 +01:00
Michael Adam
05ff62cf78 Rename libnet_smbconf_drop() to libnet_conf_drop().
Michael
(This used to be commit 42ae33a962)
2008-01-03 14:17:49 +01:00
Michael Adam
78acbddbd5 Happy new year again.
Michael
(This used to be commit e568f42e21)
2008-01-03 14:17:48 +01:00
Michael Adam
fd597c7e6d Add libnet_conf API function libnet_smbconf_create_share().
And make libnet_smbconf_setparm() return error if the share
does not already exist. Adapt net_conf_addshare to this new
situation.

Michael
(This used to be commit de349bd26d)
2008-01-03 11:30:14 +01:00
Michael Adam
4c7ef1c03e Make grouping in if statement more explicit.
Michael
(This used to be commit a1bb47695a)
2007-12-31 03:55:22 +01:00
Michael Adam
8d9fb62a45 Change net_conf_import() to only use libnet_conf API functions.
More precisely, only import_process_service() is changed.
This removes all references to registry code from net_conf.c.

net_conf_import() is currently -- like net_conf_addshare() -- also
considered a high-level add-on, not an API function.

Michael
(This used to be commit b4dca117c0)
2007-12-31 03:02:39 +01:00
Michael Adam
01f8fd55a7 Rewrite net_conf_addshare() to only use libnet_conf API functions.
Also exit on error if the share already exists.

net_conf_addshare() is considered a high level utility function.
It should not be an libnet_conf API function in itself since it is
kind of arbitrary.

Michael
(This used to be commit af5218f150)
2007-12-31 01:56:18 +01:00
Michael Adam
e8a680cdf3 Rename libnet_smbconf_key_exists() to libnet_smbconf_share_exists()
and move it to the api section of libnet_conf.c

Michael
(This used to be commit 9b5d8f4d95)
2007-12-31 01:14:44 +01:00
Michael Adam
a74de0c7eb Remove an unused variable.
Michael
(This used to be commit 332be113a7)
2007-12-30 22:36:02 +01:00
Michael Adam
80957726b6 Remove all d_fprintf-s from libnet_conf.c
Replacing them buy DEBUG statements and filling in
d_fprintfs in callers in net_conf.c.

Michael
(This used to be commit 1f0122d8d4)
2007-12-30 22:36:01 +01:00
Michael Adam
59128c7837 Remove list_values() from net_conf.c - it is not needed any more.
Also make libnet.c:libnet_smbconf_format_registry_value() static.
(There are nor more external callers.)

Michael
(This used to be commit ac7baa17e8)
2007-12-30 00:32:41 +01:00
Michael Adam
9c14495944 Use libnet_smbconf_get_config() in net_conf_list().
This leaves only output logic in net_conf_list().

Michael
(This used to be commit 95d9981d59)
2007-12-30 00:32:41 +01:00
Michael Adam
a6d6fbb73d Dont return count - 1 but count from libnet_smbconf_reg_get_values().
Michael
(This used to be commit ded60dec7d)
2007-12-29 17:02:27 +01:00
Michael Adam
e8cb7cecf2 Make sure libnet_smbconf_get_share_names() always lists "global" first.
And don't return count-1 but count.

Michael
(This used to be commit b7cb9b7823)
2007-12-29 17:00:27 +01:00
Michael Adam
0b7aafff11 Fix a const warning.
Michael
(This used to be commit e276e48177)
2007-12-29 13:02:22 +01:00
Michael Adam
1c03f6b608 Rename libnet_smbconf_getshares() to libnet_smbconf_get_share_names().
Michael
(This used to be commit 9b3b9aa7e1)
2007-12-29 12:55:42 +01:00
Michael Adam
2a642a6e2b Move functionality of net_conf_listshares() to libnet_conf.c
into new function libnet_smbconf_getshares().

Michael
(This used to be commit 306c7e4d9c)
2007-12-29 12:52:09 +01:00
Michael Adam
f8c39cbb7b Move functionality of net_conf_showshare() to libnet_conf.c
The functionality is moved to a new function libnet_smbconf_getshare().
This returns the parameters of the given share as two lists: the list
of parameter names and the list of matching (formatted) parameter values.

The retrieval and formatting is done in a new internal helper function
libnet_smbconf_reg_get_values() that is to become the replacement for
list_values() from net_conf.c once functionality of net_conf_list() has
been moved to libnet_conf, too.

Michael
(This used to be commit 198232bd52)
2007-12-29 12:32:16 +01:00
Michael Adam
8093a75d6f Make the main net_conf functions static in net_conf.c
Michael
(This used to be commit dd6e09a65e)
2007-12-29 02:27:20 +01:00