diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/lib/netapi/serverinfo.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/lib/netapi/serverinfo.c')
-rw-r--r-- | source3/lib/netapi/serverinfo.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/source3/lib/netapi/serverinfo.c b/source3/lib/netapi/serverinfo.c index 22c7df69d1..4b11339f94 100644 --- a/source3/lib/netapi/serverinfo.c +++ b/source3/lib/netapi/serverinfo.c @@ -36,9 +36,9 @@ static WERROR NetServerGetInfo_l_101(struct libnetapi_ctx *ctx, struct SERVER_INFO_101 i; i.sv101_platform_id = PLATFORM_ID_NT; - i.sv101_name = global_myname(); - i.sv101_version_major = lp_major_announce_version(); - i.sv101_version_minor = lp_minor_announce_version(); + i.sv101_name = lp_netbios_name(); + i.sv101_version_major = SAMBA_MAJOR_NBT_ANNOUNCE_VERSION; + i.sv101_version_minor = SAMBA_MINOR_NBT_ANNOUNCE_VERSION; i.sv101_type = lp_default_server_announce(); i.sv101_comment = lp_serverstring(); @@ -540,7 +540,8 @@ WERROR NetServerGetInfo_r(struct libnetapi_ctx *ctx, static WERROR NetServerSetInfo_l_1005(struct libnetapi_ctx *ctx, struct NetServerSetInfo *r) { - WERROR werr; + WERROR werr = WERR_OK; + sbcErr err; struct smbconf_ctx *conf_ctx; struct srvsvc_NetSrvInfo1005 *info1005; @@ -563,13 +564,24 @@ static WERROR NetServerSetInfo_l_1005(struct libnetapi_ctx *ctx, return WERR_NOT_SUPPORTED; } - werr = smbconf_init_reg(ctx, &conf_ctx, NULL); - if (!W_ERROR_IS_OK(werr)) { + err = smbconf_init_reg(ctx, &conf_ctx, NULL); + if (!SBC_ERROR_IS_OK(err)) { + libnetapi_set_error_string(ctx, + "Could not initialize backend: %s", + sbcErrorString(err)); + werr = WERR_NO_SUCH_SERVICE; goto done; } - werr = smbconf_set_global_parameter(conf_ctx, "server string", + err = smbconf_set_global_parameter(conf_ctx, "server string", info1005->comment); + if (!SBC_ERROR_IS_OK(err)) { + libnetapi_set_error_string(ctx, + "Could not set global parameter: %s", + sbcErrorString(err)); + werr = WERR_NO_SUCH_SERVICE; + goto done; + } done: smbconf_shutdown(conf_ctx); |