[Webkit-unassigned] [Bug 239513] [macOS] The function getpwnam can sometimes fail
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Apr 26 10:43:53 PDT 2022
https://bugs.webkit.org/show_bug.cgi?id=239513
--- Comment #13 from Darin Adler <darin at apple.com> ---
Comment on attachment 458276
--> https://bugs.webkit.org/attachment.cgi?id=458276
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=458276&action=review
>>> Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm:826
>>> + char buffer[4096];
>>
>> Might need a comment saying why 4096 is the right number to use here.
>
> Looking at the man page for getpwuid_r, it seems the correct thing to do is to use the size returned from sysconf(_SC_GETPW_R_SIZE_MAX). So far, I have not changed this, since I believe a size of 4096 should be sufficient. PATH_MAX is 1024 according to sys limits.h. If you'd like, I can change this to use sysconf(_SC_GETPW_R_SIZE_MAX).
I saw that same man page and did not push you to use sysconf because it seemed like overkill given this is Apple-only code and doesn’t need to be portable to super-unusual configurations. On the other hand, I would be OK doing this entirely "by the book". Of course, since we are calling this to trigger a side effect, it’s kind of an "off-label" use anyway. I won’t push for further change, but do think a comment is good.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220426/3f74d9a4/attachment-0001.htm>
More information about the webkit-unassigned
mailing list