1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-18 19:17:08 +03:00

118 Commits

Author SHA1 Message Date
Michael Adam
de349bd26d 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
2008-01-03 11:30:14 +01:00
Michael Adam
a1bb47695a Make grouping in if statement more explicit.
Michael
2007-12-31 03:55:22 +01:00
Michael Adam
b4dca117c0 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
2007-12-31 03:02:39 +01:00
Michael Adam
af5218f150 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
2007-12-31 01:56:18 +01:00
Michael Adam
9b5d8f4d95 Rename libnet_smbconf_key_exists() to libnet_smbconf_share_exists()
and move it to the api section of libnet_conf.c

Michael
2007-12-31 01:14:44 +01:00
Michael Adam
332be113a7 Remove an unused variable.
Michael
2007-12-30 22:36:02 +01:00
Michael Adam
1f0122d8d4 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
2007-12-30 22:36:01 +01:00
Michael Adam
ac7baa17e8 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
2007-12-30 00:32:41 +01:00
Michael Adam
95d9981d59 Use libnet_smbconf_get_config() in net_conf_list().
This leaves only output logic in net_conf_list().

Michael
2007-12-30 00:32:41 +01:00
Michael Adam
ded60dec7d Dont return count - 1 but count from libnet_smbconf_reg_get_values().
Michael
2007-12-29 17:02:27 +01:00
Michael Adam
b7cb9b7823 Make sure libnet_smbconf_get_share_names() always lists "global" first.
And don't return count-1 but count.

Michael
2007-12-29 17:00:27 +01:00
Michael Adam
e276e48177 Fix a const warning.
Michael
2007-12-29 13:02:22 +01:00
Michael Adam
9b3b9aa7e1 Rename libnet_smbconf_getshares() to libnet_smbconf_get_share_names().
Michael
2007-12-29 12:55:42 +01:00
Michael Adam
306c7e4d9c Move functionality of net_conf_listshares() to libnet_conf.c
into new function libnet_smbconf_getshares().

Michael
2007-12-29 12:52:09 +01:00
Michael Adam
198232bd52 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
2007-12-29 12:32:16 +01:00
Michael Adam
dd6e09a65e Make the main net_conf functions static in net_conf.c
Michael
2007-12-29 02:27:20 +01:00
Michael Adam
7d0ec5bae1 Hide the registry backend from libnet_smbconf_getparm().
Return a formatted string of the value instead.

Michael
2007-12-29 02:12:33 +01:00
Michael Adam
95d5dd9bb0 Rename format_value() to libnet_smbconf_format_registry_value().
Michael
2007-12-29 01:17:39 +01:00
Michael Adam
3422a5048a Move format_value() to libnet_conf.c.
Michael
2007-12-29 00:05:58 +01:00
Michael Adam
4c0e7270c4 Rename libnet_smbconf_open_basepath() to libnet_smbconf_reg_open_basepath().
Michael
2007-12-26 01:01:14 +01:00
Michael Adam
4b0e636965 Rename libnet_smbconf_open_path() to libnet_smbconf_reg_open_path().
Michael
2007-12-26 00:58:11 +01:00
Michael Adam
4efac39c36 Add two missing free-s.
Michael
2007-12-25 03:35:00 +01:00
Michael Adam
16f1373938 Remove talloc context parameter from libnet_smbconf_delparm().
Make use of talloc stackframe internally.
This removes talloc contxt from net_conf_delparm.

Michael
2007-12-25 03:34:04 +01:00
Michael Adam
bf6031287f Add a missing free.
Michael
2007-12-25 03:29:41 +01:00
Michael Adam
efaffefc43 Remove talloc context parameter from libnet_smbconf_setparm().
Make use of talloc stackframe internally.
This removes talloc contxt from net_conf_setparm.

Michael
2007-12-25 03:29:05 +01:00
Michael Adam
aaceab1153 Remove talloc context parameter from libnet_smbconf_drop().
Make use of talloc_stackframe.

Michael
2007-12-25 03:05:06 +01:00
Michael Adam
5873e6a1f8 Rename drop_smbconf_internal() to libnet_smbconf_drop().
Michael
2007-12-25 03:01:59 +01:00
Michael Adam
4c2a3396bb Move drop_smbconf_internal() to libnet_conf.c
Michael
2007-12-25 02:55:07 +01:00
Michael Adam
1fe4ea63b1 Use the proper boolean constants in net_conf.c
Michael
2007-12-25 02:48:45 +01:00
Michael Adam
8d02a2de61 Add error reporting to net_conf_delshare().
Michael
2007-12-25 02:42:33 +01:00
Michael Adam
870d35c048 Simplify libnet_smbconf_delshare().
Remove talloc context parameter.
Remove d_printf error message.

Michael
2007-12-25 02:37:02 +01:00
Michael Adam
7d501f0d78 Rename reg_delkey_internal() to libnet_smbconf_delshare().
Michael
2007-12-25 02:24:39 +01:00
Michael Adam
c1b863fd05 Move reg_delkey_internal() to libnet/libnet_conf.c
Michael
2007-12-25 02:21:30 +01:00
Michael Adam
7e8451f2f0 Make libnet_smbconf_key_exists() use talloc_stackframe().
And not pass a talloc context.

Michael
2007-12-24 00:53:22 +01:00
Michael Adam
d3a20c4d5a Move logic of net_conf_getparm() to libnet_conf.c.
Michael
2007-12-24 00:18:35 +01:00
Michael Adam
0e7f215f54 Rename libnet_reg_createkey_internal() to libnet_smbconf_reg_createkey_internal().
Michael
2007-12-23 04:10:32 +01:00
Michael Adam
60f49b22b5 Move net_conf_setparm() to libnet_conf.c
renaming it to libnet_smbconf_setparm()

Michael
2007-12-23 04:10:32 +01:00
Michael Adam
7cb51a1d6d Move reg_setvalue_internal() to libnet_conf.c
renaming it to libnet_smbconf_setvalue_internal()

Michael
2007-12-23 04:10:31 +01:00
Michael Adam
0cff79e355 Move logic of net_smbconf_delparm() to libnet/libnet_conf.c
Logic in new function libnet_smbconf_delparm().

Michael
2007-12-23 04:10:31 +01:00
Michael Adam
ba71c68445 Move smbconf_value_exists() to libnet/net_conf.c
renaming it to libnet_smbconf_value_exists().

Michael
2007-12-23 04:10:31 +01:00
Günther Deschner
1d47247283 Some libnet and netapi build fixes.
Guenther
2007-12-21 15:29:10 +01:00
Günther Deschner
2b41ac926d Very quick conversion of net_conf functions into the libnet_conf layer.
Certainly needs cleanup later.

Guenther
2007-12-21 15:29:09 +01:00
Jeremy Allison
78dc756000 We don't need P_GSTRING or P_UGSTRING anymore.
Jeremy.
2007-12-07 12:43:10 -08:00
Volker Lendecke
31d0a846db Remove some globals 2007-12-05 14:39:07 +01: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
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
00432bcd69 r24513: Reformatting: eliminate trailing spaces, overly long lines
and adjust some formattings to standard.

Michael
2007-10-10 12:29:53 -05:00
Michael Adam
95447dde86 r24496: Add initial synonym handling to "net conf":
When storing parameters in the smbconf portion of the registry,
up to now, synonyms could be misused to store a parameter twice.
Now this is prevented by canonicalizing the paramter name first.

Also, the value for a boolean parameter checked for validity
before storing the bool in registry.

(The canonicalization should finally go into the registry smbconf
code to also prevent e.g. "regedit" or "net rpc registry" from
storing synonyms. - This is in the making.)

Michael
2007-10-10 12:29:52 -05:00
Andrew Tridgell
87c91e4362 r23801: The FSF has moved around a lot. This fixes their Mass Ave address. 2007-10-10 12:28:27 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00