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:
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user