1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

s4-samdb: make sure the static credentials are never freed

This commit is contained in:
Andrew Tridgell 2009-10-23 14:54:07 +11:00
parent 890e7719cf
commit 0b624d9eff

View File

@ -72,6 +72,14 @@ char *samdb_relative_path(struct ldb_context *ldb,
return full_name;
}
/*
make sure the static credentials are not freed
*/
static int samdb_credentials_destructor(struct cli_credentials *creds)
{
return -1;
}
/*
this returns a static set of system credentials. It is static so
that we always get the same pointer in ldb_wrap_connect()
@ -104,6 +112,7 @@ struct cli_credentials *samdb_credentials(struct tevent_context *event_ctx,
return NULL;
}
static_credentials = cred;
talloc_set_destructor(cred, samdb_credentials_destructor);
return cred;
}