summaryrefslogtreecommitdiff
path: root/source3/libnet/libnet_join.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libnet/libnet_join.c')
-rw-r--r--source3/libnet/libnet_join.c54
1 files changed, 38 insertions, 16 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 5f7f93e087..ef0d5d0850 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -1467,30 +1467,49 @@ static WERROR do_join_modify_vals_config(struct libnet_JoinCtx *r)
if (!(r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_TYPE)) {
- werr = smbconf_set_global_parameter(ctx, "security", "user");
- W_ERROR_NOT_OK_GOTO_DONE(werr);
+ err = smbconf_set_global_parameter(ctx, "security", "user");
+ if (!SBC_ERROR_IS_OK(err)) {
+ werr = WERR_NO_SUCH_SERVICE;
+ goto done;
+ }
- werr = smbconf_set_global_parameter(ctx, "workgroup",
- r->in.domain_name);
+ err = smbconf_set_global_parameter(ctx, "workgroup",
+ r->in.domain_name);
+ if (!SBC_ERROR_IS_OK(err)) {
+ werr = WERR_NO_SUCH_SERVICE;
+ goto done;
+ }
smbconf_delete_global_parameter(ctx, "realm");
goto done;
}
- werr = smbconf_set_global_parameter(ctx, "security", "domain");
- W_ERROR_NOT_OK_GOTO_DONE(werr);
+ err = smbconf_set_global_parameter(ctx, "security", "domain");
+ if (!SBC_ERROR_IS_OK(err)) {
+ werr = WERR_NO_SUCH_SERVICE;
+ goto done;
+ }
- werr = smbconf_set_global_parameter(ctx, "workgroup",
- r->out.netbios_domain_name);
- W_ERROR_NOT_OK_GOTO_DONE(werr);
+ err = smbconf_set_global_parameter(ctx, "workgroup",
+ r->out.netbios_domain_name);
+ if (!SBC_ERROR_IS_OK(err)) {
+ werr = WERR_NO_SUCH_SERVICE;
+ goto done;
+ }
if (r->out.domain_is_ad) {
- werr = smbconf_set_global_parameter(ctx, "security", "ads");
- W_ERROR_NOT_OK_GOTO_DONE(werr);
+ err = smbconf_set_global_parameter(ctx, "security", "ads");
+ if (!SBC_ERROR_IS_OK(err)) {
+ werr = WERR_NO_SUCH_SERVICE;
+ goto done;
+ }
- werr = smbconf_set_global_parameter(ctx, "realm",
- r->out.dns_domain_name);
- W_ERROR_NOT_OK_GOTO_DONE(werr);
+ err = smbconf_set_global_parameter(ctx, "realm",
+ r->out.dns_domain_name);
+ if (!SBC_ERROR_IS_OK(err)) {
+ werr = WERR_NO_SUCH_SERVICE;
+ goto done;
+ }
}
done:
@@ -1515,8 +1534,11 @@ static WERROR do_unjoin_modify_vals_config(struct libnet_UnjoinCtx *r)
if (r->in.unjoin_flags & WKSSVC_JOIN_FLAGS_JOIN_TYPE) {
- werr = smbconf_set_global_parameter(ctx, "security", "user");
- W_ERROR_NOT_OK_GOTO_DONE(werr);
+ err = smbconf_set_global_parameter(ctx, "security", "user");
+ if (!SBC_ERROR_IS_OK(err)) {
+ werr = WERR_NO_SUCH_SERVICE;
+ goto done;
+ }
werr = smbconf_delete_global_parameter(ctx, "workgroup");
W_ERROR_NOT_OK_GOTO_DONE(werr);