Do not assume layout of msghdr and iovec structure
ClosedPublic

Authored by chinmoyr on Mar 4 2018, 7:27 AM.

Details

Summary

Class FDMessageHeader assumes the layout of msghdr and iovec structure in its constructor. This assumption is wrong
because as per POSIX standards both may contain more members than usual. This patch fixes the issue.

BUG: 391367

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
chinmoyr created this revision.Mar 4 2018, 7:27 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptMar 4 2018, 7:27 AM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
chinmoyr requested review of this revision.Mar 4 2018, 7:27 AM

I can confirm that this patch does fix the build on musl. Thank you!

awilcox accepted this revision.Mar 4 2018, 8:12 AM
This revision is now accepted and ready to land.Mar 4 2018, 8:12 AM

I can confirm that this patch does fix the build on musl. Thank you!

I will push this after David's review. I hope it's not a problem?

That's fine with me.

dfaure added inline comments.Mar 4 2018, 9:27 AM
src/ioslaves/file/sharefd_p.h
85

Looks good, it's just a bit inconsistent that iov_base points to io_buf (without &) and msg_control points to &cmsg_buf (with &), both members being char [N]. It turns out that both work, but why not use the same syntax both times?

dfaure accepted this revision.EditedMar 4 2018, 10:49 AM

Thanks, this is good to go in. In fact I'll put it in 5.44 since it fixes a compilation error, once you push it to master (please do today).

This revision was automatically updated to reflect the committed changes.