Previously an invocation like elfctl -e +feature1,feature2 file1 file2 would set both feature flags in file 1 but only feature1 in file2 due to strsep().
Reported by: jrm
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential D34283
elfctl: fix operations with multiple features on multiple files emaste on Feb 15 2022, 3:49 AM. Authored by Tags None Referenced Files
Subscribers
Details Previously an invocation like elfctl -e +feature1,feature2 file1 file2 would set both feature flags in file 1 but only feature1 in file2 due to strsep(). Reported by: jrm
Diff Detail
Event TimelineComment Actions Looks good from a testing perspective. jrm@phe /usr/obj/usr/src/amd64.amd64/usr.bin/elfctl % sudo ./elfctl -e '+noaslr,wxneeded' /usr/local/bin/ztop /usr/local/bin/zstd jrm@phe /usr/obj/usr/src/amd64.amd64/usr.bin/elfctl % ./elfctl /usr/local/bin/ztop /usr/local/bin/zstd | grep 'noaslr\|wxneeded' noaslr 'Disable ASLR' is set. wxneeded 'Requires W+X mappings' is set. noaslr 'Disable ASLR' is set. wxneeded 'Requires W+X mappings' is set. jrm@phe /usr/obj/usr/src/amd64.amd64/usr.bin/elfctl % sudo ./elfctl -e '-noaslr,wxneeded' /usr/local/bin/ztop /usr/local/bin/zstd jrm@phe /usr/obj/usr/src/amd64.amd64/usr.bin/elfctl % ./elfctl /usr/local/bin/ztop /usr/local/bin/zstd | grep 'noaslr\|wxneeded' noaslr 'Disable ASLR' is unset. wxneeded 'Requires W+X mappings' is unset. noaslr 'Disable ASLR' is unset. wxneeded 'Requires W+X mappings' is unset. There are a few minor, pre-existing whitespace issues (space inserted next to a tab) on lines 85, 409, 448. |