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

169 Commits

Author SHA1 Message Date
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
Michael Adam
eb356fbafc Hide the registry backend from libnet_smbconf_getparm().
Return a formatted string of the value instead.

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

Michael
(This used to be commit 16f1373938)
2007-12-25 03:34:04 +01:00
Michael Adam
726f32b672 Add a missing free.
Michael
(This used to be commit bf6031287f)
2007-12-25 03:29:41 +01:00
Michael Adam
f3b0469b4a Remove talloc context parameter from libnet_smbconf_setparm().
Make use of talloc stackframe internally.
This removes talloc contxt from net_conf_setparm.

Michael
(This used to be commit efaffefc43)
2007-12-25 03:29:05 +01:00
Michael Adam
e5a87c2543 Remove talloc context parameter from libnet_smbconf_drop().
Make use of talloc_stackframe.

Michael
(This used to be commit aaceab1153)
2007-12-25 03:05:06 +01:00
Michael Adam
2764f5a0a6 Rename drop_smbconf_internal() to libnet_smbconf_drop().
Michael
(This used to be commit 5873e6a1f8)
2007-12-25 03:01:59 +01:00
Michael Adam
8e53343a74 Move drop_smbconf_internal() to libnet_conf.c
Michael
(This used to be commit 4c2a3396bb)
2007-12-25 02:55:07 +01:00
Michael Adam
9626fffe14 Use the proper boolean constants in net_conf.c
Michael
(This used to be commit 1fe4ea63b1)
2007-12-25 02:48:45 +01:00
Michael Adam
734ddacc91 Add error reporting to net_conf_delshare().
Michael
(This used to be commit 8d02a2de61)
2007-12-25 02:42:33 +01:00
Michael Adam
86486fcc98 Simplify libnet_smbconf_delshare().
Remove talloc context parameter.
Remove d_printf error message.

Michael
(This used to be commit 870d35c048)
2007-12-25 02:37:02 +01:00
Michael Adam
9c20b9a731 Rename reg_delkey_internal() to libnet_smbconf_delshare().
Michael
(This used to be commit 7d501f0d78)
2007-12-25 02:24:39 +01:00
Michael Adam
c9f65929b7 Move reg_delkey_internal() to libnet/libnet_conf.c
Michael
(This used to be commit c1b863fd05)
2007-12-25 02:21:30 +01:00
Michael Adam
c74579f491 Make libnet_smbconf_key_exists() use talloc_stackframe().
And not pass a talloc context.

Michael
(This used to be commit 7e8451f2f0)
2007-12-24 00:53:22 +01:00
Michael Adam
8f163d5c5a Move logic of net_conf_getparm() to libnet_conf.c.
Michael
(This used to be commit d3a20c4d5a)
2007-12-24 00:18:35 +01:00
Michael Adam
d1c2280cd4 Rename libnet_reg_createkey_internal() to libnet_smbconf_reg_createkey_internal().
Michael
(This used to be commit 0e7f215f54)
2007-12-23 04:10:32 +01:00
Michael Adam
62f08d3dd9 Move net_conf_setparm() to libnet_conf.c
renaming it to libnet_smbconf_setparm()

Michael
(This used to be commit 60f49b22b5)
2007-12-23 04:10:32 +01:00
Michael Adam
31d436e54c Move reg_setvalue_internal() to libnet_conf.c
renaming it to libnet_smbconf_setvalue_internal()

Michael
(This used to be commit 7cb51a1d6d)
2007-12-23 04:10:31 +01:00
Michael Adam
b04708866f Move logic of net_smbconf_delparm() to libnet/libnet_conf.c
Logic in new function libnet_smbconf_delparm().

Michael
(This used to be commit 0cff79e355)
2007-12-23 04:10:31 +01:00
Michael Adam
ec3e8587ec Move smbconf_value_exists() to libnet/net_conf.c
renaming it to libnet_smbconf_value_exists().

Michael
(This used to be commit ba71c68445)
2007-12-23 04:10:31 +01:00
Günther Deschner
41410c86cc Some libnet and netapi build fixes.
Guenther
(This used to be commit 1d47247283)
2007-12-21 15:29:10 +01:00
Günther Deschner
1b5c1ae742 Very quick conversion of net_conf functions into the libnet_conf layer.
Certainly needs cleanup later.

Guenther
(This used to be commit 2b41ac926d)
2007-12-21 15:29:09 +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
Volker Lendecke
78c6ee0090 Remove some globals
(This used to be commit 31d0a846db)
2007-12-05 14:39:07 +01: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
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
8b0b1408a0 r24513: Reformatting: eliminate trailing spaces, overly long lines
and adjust some formattings to standard.

Michael
(This used to be commit 00432bcd69)
2007-10-10 12:29:53 -05:00
Michael Adam
53f5c4adfb 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
(This used to be commit 95447dde86)
2007-10-10 12:29:52 -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
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
d4f1b08c93 r23760: Untangle use of strrchr_m and strequal and add some checks
for the validity of the given registry key name.

Michael
(This used to be commit 4b4ba7724e)
2007-10-10 12:23:53 -05:00
Michael Adam
a5946cb46a r23750: Change the behaviour of net conf import when there is a global section
in the current registry and there is no global section in the input
file (or only global options with default values):
In that case the existing global section is now not touched. Before, it
would have been deleted and recreated empty. The new behaviour is how
other shares are treated too.

Note that since the input file is parsed by lp_load, there is currently
no way to distinguish between a section with only default parameters
and a non-existing section in net conf import.

Michael

PS: A couple of trailing white-spaces have been eliminated
and a line was broken to be not longer than 80 chars, too.
(This used to be commit ec21a0cf9f)
2007-10-10 12:23:52 -05:00
Michael Adam
1bea19c127 r23749: Simplify prototype of reg_setvalue_internal:
eliminate "type" parameter since we store only REG_SZ.

Michael
(This used to be commit 65ce463317)
2007-10-10 12:23:52 -05:00
Michael Adam
cba898808e r23748: Clean use of talloc in import_process_service:
create a temporary talloc ctx for the function.

Michael
(This used to be commit 39df7faaa9)
2007-10-10 12:23:51 -05:00
Michael Adam
c2c96bccda r23747: Move formatting of a parameter's value into a value string
to a function of its own. (for storing it in registry),
Eliminate the valtype variable : store everything as "sz".
Eliminate some trailing white spaces on the way.

Michael
(This used to be commit 76f4f224aa)
2007-10-10 12:23:51 -05:00
Michael Adam
feff1fcfd8 r23746: Fix missing assignments to target string of asprintf in import function.
Michael
(This used to be commit 6b1bf7c1f4)
2007-10-10 12:23:51 -05:00
Michael Adam
f7b8a3782a r23745: Fix: Check whether top subkeyname instead of whole registry key name
is equal to GLOBAL_NAME.

Michael
(This used to be commit fdcdcacf0a)
2007-10-10 12:23:51 -05:00
Michael Adam
ea78cb941a r23744: Remove TODO-comment. lp_load returns False if opening
of the config file fails. That's enough of checking for
existence and readbility to my taste.

Michael
(This used to be commit 204f4f1a94)
2007-10-10 12:23:51 -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
96c4bf4a1c r23655: Fix a comment and adjust some code formatting.
Michael
(This used to be commit b294bc707c)
2007-10-10 12:23:42 -05:00
Michael Adam
3163aff376 r23652: Use the recursive delete function instead of the original one
when deleting a share. Just to be sure...

Michael
(This used to be commit 91770e153d)
2007-10-10 12:23:41 -05:00
Michael Adam
cc4f37f928 r23585: Add a "drop" function to "net conf" that clears the
whole configuration stored in registry.

Michael
(This used to be commit 6d8973762e)
2007-10-10 12:23:32 -05:00
Michael Adam
3b9e5d0b4f r23549: Make "net conf setparm" always use registry data type "sz".
This simplifies the usage of this command from
"net conf setparm <section> <param> <type> <value>"
to
"net conf setparm <section> <param> <value>".

Micheal
(This used to be commit 41a8f8ec5f)
2007-10-10 12:23:27 -05:00
Michael Adam
ac1a7e2f96 r23543: Adjust comments.
(This used to be commit ec22c30581)
2007-10-10 12:23:27 -05:00
Michael Adam
6090601c8b r23485: This checkin consists mostly of refactorings in preparation of the
activation of global registry options in loadparm.c, mainly to
extract functionality from net_conf.c to be made availabel elsewhere
and to minimize linker dependencies.

In detail:

* move functions registry_push/pull_value from lib/util_reg.c to new file
  lib/util_reg_api.c

* create a fake user token consisting of builtin administrators sid and
  se_disk_operators privilege by hand instead of using get_root_nt_token()
  to minimize linker deps for bin/net.

  + new function registry_create_admin_token() in new lib/util_reg_smbconf.c
  + move dup_nt_token from auth/token_util.c to new file lib/util_nttoken.c
  + adapt net_conf.c and Makefile.in accordingly.

* split lib/profiles.c into two parts: new file lib/profiles_basic.c
  takes all the low level mask manipulation and format conversion functions
  (se_priv, privset, luid). the privs array is completely hidden from
  profiles.c by adding some access-functions. some mask-functions are not
  static anymore.

  Generally, SID- and LUID-related stuff that has more dependencies
  is kept in lib/profiles.c

* Move initialization of regdb from net_conf.c into a function
  registry_init_regdb() in lib/util_reg_smbconf.c.

Michael
(This used to be commit efd3e2bfb7)
2007-10-10 12:23:21 -05:00
Volker Lendecke
a40df6f92d r22135: Check in most of Michael Adam's net conf utility. A good share of this patch
is moving functions around to fix some linker dependencies for the registry.

Michael, I've renamed your auth_utils2.c to token_utils.c.

Thanks!

Volker
(This used to be commit 9de16f25c1)
2007-10-10 12:19:16 -05:00