-
Notifications
You must be signed in to change notification settings - Fork 541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MinGW: use namless unions in ext_ad_group_acl #2004
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not know enough to review this at low level, but please make the following PR title/description adjustments:
- Fix PR title spelling
- Please use "MinGW" variant (at least in PR title):
% git log --oneline | grep -c MinGW
58
% git log --oneline | grep -c mingw
2
Whenever you are writing a new PR title, please watch out for spelling and naming consistency bugs. They are quite frequent...
The examples given below are just for illustration purposes. They are probably wrong on several levels. Please do not spend time criticizing/discussing them. Again, I do not know enough to write correct examples here and am not going to defend any of the requests below.
- In PR description, please mention what this change does at higher/admin level (e.g., "ext_ad_group_acl fails to build (and has to be disabled at ./configure time) without this fix"). Assume mingw scope.
- In PR description, please quote a compiler error message (or equivalent) that one would get without these changes. Abridge as needed. If there was no error, rephrase PR description to express the same "now required" idea differently.
- In PR description: If possible without heroic efforts, please mention what has changed outside of Squid that prompted these Squid changes (e.g., "newer Windows headers no longer provide legacy APIs that ext_ad_group_acl was using").
@@ -181,9 +181,9 @@ Get_primaryGroup(IADs * pUser) | |||
VariantInit(&var); | |||
|
|||
/* Get the primaryGroupID property */ | |||
hr = pUser->lpVtbl->Get(pUser, L"primaryGroupID", &var); | |||
hr = pUser->Get(BSTR(L"primaryGroupID"), &var); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own edification, what error do you get if this explicit BSTR conversion is removed? Please ignore this question if it takes too long to answer.
hr = pUser->Get(BSTR(L"primaryGroupID"), &var); | |
hr = pUser->Get(L"primaryGroupID", &var); |
This optional question is not requesting any PR changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
../../../../../src/acl/external/AD_group/ext_ad_group_acl.cc: In function 'HRESULT Recursive_Memberof(IADs*)':
../../../../../src/acl/external/AD_group/ext_ad_group_acl.cc:429:20: error: ISO C++ forbids converting a string constant to 'BSTR' {aka 'wchar_t*'} [-Werror=write-strings]
429 | hr = pObj->Get(L"memberOf", &var);
| ^~~~~~~~~~~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Using that error, I found an article that, AFAICT, claims that the changes proposed by this PR are buggy: "This code builds (compiles and links) correctly, but it will not function properly because the string does not have a length prefix."
I still do not know enough to be certain that this PR is buggy, but I believe this concern has to be addressed, so I have to block this PR.
Examples of errors this fixes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Fix PR title spelling
The title was changed, but the above request remains valid. FWIW, I recommend using good text editors for writing PR title/descriptions, but most browsers will also spellcheck text fields for you if you enable that feature for single-line text fields.
@@ -181,9 +181,9 @@ Get_primaryGroup(IADs * pUser) | |||
VariantInit(&var); | |||
|
|||
/* Get the primaryGroupID property */ | |||
hr = pUser->lpVtbl->Get(pUser, L"primaryGroupID", &var); | |||
hr = pUser->Get(BSTR(L"primaryGroupID"), &var); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Using that error, I found an article that, AFAICT, claims that the changes proposed by this PR are buggy: "This code builds (compiles and links) correctly, but it will not function properly because the string does not have a length prefix."
I still do not know enough to be certain that this PR is buggy, but I believe this concern has to be addressed, so I have to block this PR.
I copied that info to the PR description, addressing one of my earlier requests. |
ext_ad_group_acl was written working
around missing support for nameless unions
which are now required to build it.