This will allow s3 to specify modules to use as a list, rather than
needing to start the individual module with gensec_start_mech_by_ops()
Andrew Bartlett
struct gensec_settings {
struct loadparm_context *lp_ctx;
const char *target_hostname;
+
+ /* this allows callers to specify a specific set of ops that
+ * should be used, rather than those loaded by the plugin
+ * mechanism */
+ struct gensec_security_ops **backends;
};
struct gensec_security_ops {
TALLOC_CTX *mem_ctx)
{
struct gensec_security_ops **backends;
- backends = gensec_security_all();
if (!gensec_security) {
+ backends = gensec_security_all();
if (!talloc_reference(mem_ctx, backends)) {
return NULL;
}
return backends;
} else {
struct cli_credentials *creds = gensec_get_credentials(gensec_security);
+ if (gensec_security->settings->backends) {
+ backends = gensec_security->settings->backends;
+ } else {
+ backends = gensec_security_all();
+ }
if (!creds) {
if (!talloc_reference(mem_ctx, backends)) {
return NULL;
struct gensec_settings *lpcfg_gensec_settings(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx)
{
- struct gensec_settings *settings = talloc(mem_ctx, struct gensec_settings);
+ struct gensec_settings *settings = talloc_zero(mem_ctx, struct gensec_settings);
if (settings == NULL)
return NULL;
SMB_ASSERT(lp_ctx != NULL);