summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-23 14:54:07 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-23 14:54:07 +1100
commit0b624d9effa950e1e7ba95866a37b84bb74be772 (patch)
treea4ff8d4e61aa7293beee189c10e280242abab83a /source4
parent890e7719cf679108e7a74a660f20a40a32d7d552 (diff)
downloadsamba-0b624d9effa950e1e7ba95866a37b84bb74be772.tar.gz
samba-0b624d9effa950e1e7ba95866a37b84bb74be772.tar.bz2
samba-0b624d9effa950e1e7ba95866a37b84bb74be772.zip
s4-samdb: make sure the static credentials are never freed
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/samdb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/samdb.c b/source4/dsdb/samdb/samdb.c
index c56782bb49..70f0409c3d 100644
--- a/source4/dsdb/samdb/samdb.c
+++ b/source4/dsdb/samdb/samdb.c
@@ -73,6 +73,14 @@ char *samdb_relative_path(struct ldb_context *ldb,
}
/*
+ 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;
}