/* Initialize the context and establish reasonable defaults */
ZERO_STRUCTP(context->internal);
+ context->internal->lp_ctx = loadparm_init_s3(NULL,
+ loadparm_s3_helpers());
+ if (context->internal->lp_ctx == NULL) {
+ SAFE_FREE(context->internal);
+ SAFE_FREE(context);
+ TALLOC_FREE(frame);
+ errno = ENOMEM;
+ return NULL;
+ }
+
smbc_setDebug(context, 0);
smbc_setTimeout(context, 20000);
smbc_setPort(context, 0);
/* Free any DFS auth context. */
TALLOC_FREE(context->internal->creds);
+ TALLOC_FREE(context->internal->lp_ctx);
SAFE_FREE(context->internal);
SAFE_FREE(context);
const char *user,
const char *password)
{
- struct loadparm_context *lp_ctx = NULL;
struct cli_credentials *creds = NULL;
enum credentials_use_kerberos kerberos_state =
CRED_USE_KERBEROS_DISABLED;
return;
}
- lp_ctx = loadparm_init_s3(creds, loadparm_s3_helpers());
- if (lp_ctx == NULL) {
- TALLOC_FREE(creds);
- return;
- }
-
- cli_credentials_set_conf(creds, lp_ctx);
+ cli_credentials_set_conf(creds, context->internal->lp_ctx);
if (smbc_getOptionUseKerberos(context)) {
kerberos_state = CRED_USE_KERBEROS_REQUIRED;
#define __LIBSMBCLIENT_INTERNAL__
#include "libsmbclient.h"
#include "libsmb_internal.h"
+#include "lib/param/param.h"
/** Get the netbios name used for making connections */
TALLOC_CTX *frame = talloc_stackframe();
snprintf(buf, sizeof(buf), "%d", debug);
c->debug = debug;
- lp_set_cmdline("log level", buf);
+ lpcfg_set_cmdline(c->internal->lp_ctx, "log level", buf);
TALLOC_FREE(frame);
}
bool ok = true;
if (min_proto != NULL) {
- ok = lp_set_cmdline("client min protocol", min_proto);
+ ok = lpcfg_set_cmdline(c->internal->lp_ctx,
+ "client min protocol",
+ min_proto);
}
if (max_proto != NULL) {
- ok &= lp_set_cmdline("client max protocol", max_proto);
+ ok &= lpcfg_set_cmdline(c->internal->lp_ctx,
+ "client max protocol",
+ max_proto);
}
return ok;