[SERVER-51061] Rename c preprocessor macro that guards access to invariant.h header. Created: 18/Sep/20 Updated: 29/Oct/23 Resolved: 04/May/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.0-rc0 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Andy Schwerin | Assignee: | Sara Golemon |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Sprint: | Security 2021-05-03, Security 2021-05-17 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
The C preprocessor macro MONGO_INCLUDE_INVARIANT_H_WHITELISTED is used to identify headers that are allowed to directly include the file src/mongo/util/invariant.h. This ticket is to rename the macro to MONGO_ALLOW_INCLUDE_INVARIANT_H. Folding in work from similar small tickets:
|
| Comments |
| Comment by Githook User [ 04/May/21 ] |
|
Author: {'name': 'Sara Golemon', 'email': 'sara.golemon@mongodb.com', 'username': 'sgolemon'}Message: |
| Comment by Billy Donahue [ 03/May/21 ] |
|
Ok. If it doesn't simplify your life, forget it. |
| Comment by Sara Golemon [ 03/May/21 ] |
|
According to the comment in invariant.h, the restriction isn't to prevent access to the header, it's just to make the negative effects of an include cycle less problematic for unwary callers. I'll agree that we don't really need guardrails for that, but at the same time it doesn't seem to be getting in anyone's way and is potentially avoiding some issues for somebody. If you feel strongly about this then I'd recommend filing a separate ticket for discussion of removing it, while we keep this one to a simple rename which addresses the work in the epic without preventing us from going more aggressive in the future. |
| Comment by Billy Donahue [ 30/Apr/21 ] |
|
I think we should just get rid of the MONGO_INCLUDE_INVARIANT_H_WHITELISTED handshake. |