1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-29 15:42:04 +03:00

s4-dsdb: fixed use after free of sasl mechanisms opaque

the supportedSASLMechanisms opaque must live for at least as long as
the ldb, or we can crash when the first connection is torn down

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andrew Tridgell
2010-06-30 13:49:05 +10:00
parent 2671b5aeb0
commit f9022a1a30

View File

@ -219,6 +219,12 @@ NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn)
}
}
talloc_unlink(conn, ops);
/* ldb can have a different lifetime to conn, so we
need to ensure that sasl_mechs lives as long as the
ldb does */
talloc_steal(conn->ldb, sasl_mechs);
ldb_set_opaque(conn->ldb, "supportedSASLMechanisms", sasl_mechs);
}