diff options
author | Michael Adam <obnox@samba.org> | 2008-01-13 23:12:27 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-01-13 23:16:42 +0100 |
commit | c4899fec9f3957c52d3a856000631d59a3346ac0 (patch) | |
tree | 4bd99968bc1d2ed50853c89486768329cb226c6e /source3 | |
parent | d042a6409225f17b9d8665477fffb08c311512d9 (diff) | |
download | samba-c4899fec9f3957c52d3a856000631d59a3346ac0.tar.gz samba-c4899fec9f3957c52d3a856000631d59a3346ac0.tar.bz2 samba-c4899fec9f3957c52d3a856000631d59a3346ac0.zip |
Add a function libnet_conf_get_global_parameter() to libnet_conf.c
It creates the [global] section if it does not yet exist.
Michael
(This used to be commit 627a29b690c30f1096a4746186089cd9a1c92407)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libnet/libnet_conf.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source3/libnet/libnet_conf.c b/source3/libnet/libnet_conf.c index 858c4a06b4..37e05b9fe9 100644 --- a/source3/libnet/libnet_conf.c +++ b/source3/libnet/libnet_conf.c @@ -868,6 +868,31 @@ done: } /** + * Get the value of a global parameter. + * + * Create [global] if it does not exist. + */ +WERROR libnet_conf_get_global_parameter(TALLOC_CTX *mem_ctx, + struct libnet_conf_ctx *ctx, + const char *param, + char **valstr) +{ + WERROR werr; + + if (!libnet_conf_share_exists(ctx, GLOBAL_NAME)) { + werr = libnet_conf_create_share(ctx, GLOBAL_NAME); + if (!W_ERROR_IS_OK(werr)) { + goto done; + } + } + werr = libnet_conf_get_parameter(mem_ctx, ctx, GLOBAL_NAME, param, + valstr); + +done: + return werr; +} + +/** * delete a parameter from configuration */ WERROR libnet_conf_delete_parameter(struct libnet_conf_ctx *ctx, |