[SERVER-78833] Make LDAP connections take ownership of LDAPConnectionOptions Created: 10/Jul/23 Updated: 03/Aug/23 Resolved: 03/Aug/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Varun Ravichandran | Assignee: | Varun Ravichandran |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Sprint: | Security 2023-07-24, Security 2023-08-07 | ||||||||
| Participants: | |||||||||
| Description |
|
Currently, LDAPConnectionOptions gets copied numerous times as it is derived from the default options and propagated into a particular connection. The propagation mostly involves pass by reference into various local variables, which makes it challenging to determine ownership. It also contrasts with the updated approach used for LDAPBindOptions, which involves constructing a unique_ptr in the LDAPRunner and moving it into the eventual LDAPConnection. Adopting a similar approach for LDAPConnectionOptions would help make the code clearer and easier to follow and minimize risk of ownership/lifetime bugs seen in the past. |
| Comments |
| Comment by Varun Ravichandran [ 03/Aug/23 ] |
|
After discussion during code review, we determined that this is not necessary and introduces more risk than benefit. |