This is an archive of the discontinued LLVM Phabricator instance.

Add new interceptors: getnetent(3) family
ClosedPublic

Authored by krytarowski on Feb 20 2018, 7:30 PM.

Details

Summary

getnetent, getnetbyaddr, getnetbyname - get network entry

Reuse them on NetBSD.

Sponsored by <The NetBSD Foundation>

Diff Detail

Event Timeline

krytarowski created this revision.Feb 20 2018, 7:30 PM
vitalybuka added inline comments.Feb 25 2018, 2:39 PM
lib/sanitizer_common/sanitizer_common_interceptors.inc
6961

Combine declaration and initialization

6969

for (char **nn = n->n_aliases; *nn, ++nn) {
}

6970

you can remove
COMMON_INTERCEPTOR_WRITE_RANGE(ctx, nn, sizeof(char **));
and count nn
and WRITE_RANGE after the loop

6983

You need READ_RANGE for "name"

7020

Don't install empty interceptors

7259

I'd remove GET from here and the test name

test/sanitizer_common/TestCases/NetBSD/getnetent.cc
16 ↗(On Diff #135189)

remove exit(1)

18 ↗(On Diff #135189)

combine declaration and initialization

96 ↗(On Diff #135189)

Could you please add test name into printf and check it here.
It will help to debug failures

This revision now requires changes to proceed.Feb 25 2018, 2:43 PM
  • apply part of the comments from review
  • apply patches from review
krytarowski edited the summary of this revision. (Show Details)Feb 26 2018, 5:54 AM
vitalybuka accepted this revision.Feb 26 2018, 9:54 AM
vitalybuka added inline comments.
test/sanitizer_common/TestCases/NetBSD/getnetent.cc
96 ↗(On Diff #135189)

you missed this one

Could you please add test name into printf and check it here. It will help to debug failures

This revision is now accepted and ready to land.Feb 26 2018, 9:54 AM
This revision was automatically updated to reflect the committed changes.