diff options
author | Michael Adam <obnox@samba.org> | 2008-01-13 22:56:11 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-01-13 23:16:41 +0100 |
commit | 8fc2db5070aadee5719fd1651e86d92378927cbf (patch) | |
tree | 8b6693f1af0410cda944ab7ce591c6afe3a92d7f /source3/libnet/libnet_conf.c | |
parent | 89fb79ada6cf8cdc94ae181cdcfa9a2c0a4ffaeb (diff) | |
download | samba-8fc2db5070aadee5719fd1651e86d92378927cbf.tar.gz samba-8fc2db5070aadee5719fd1651e86d92378927cbf.tar.bz2 samba-8fc2db5070aadee5719fd1651e86d92378927cbf.zip |
Add auto-adding of [global] to libnet_conf_set_global_parameter().
Michael
(This used to be commit ad2497cfac90b2e91be6995931629453fd6ed5fa)
Diffstat (limited to 'source3/libnet/libnet_conf.c')
-rw-r--r-- | source3/libnet/libnet_conf.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/libnet/libnet_conf.c b/source3/libnet/libnet_conf.c index 11dc1639ad..3934f2c476 100644 --- a/source3/libnet/libnet_conf.c +++ b/source3/libnet/libnet_conf.c @@ -887,6 +887,17 @@ done: WERROR libnet_conf_set_global_parameter(struct libnet_conf_ctx *ctx, const char *param, const char *val) { - return libnet_conf_set_parameter(ctx, GLOBAL_NAME, param, val); + 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_set_parameter(ctx, GLOBAL_NAME, param, val); + +done: + return werr; } |