libseccomp
libseccomp copied to clipboard
RFE: Resolve SCMP_ARCH_* constants to architecture name
What about adding seccomp_arch_name
(inverse of seccomp_arch_resolve_name
) to the API ?
It would be nice (e.g to debug rule generation) if the SCMP_ARCH_* constants can be resolved to the architecture names. I noticed that this is already implemented and would require only a small amount of refactoring: https://github.com/seccomp/libseccomp/blob/3734fdc1f6a863cbef0377db1fe239791794be84/src/gen_pfc.c#L51-L95 So why not expose this in the API ? e.g.
const char * seccomp_arch_name(uint32_t arch);
Hi @r10r.
Sure, that sounds reasonable. The right thing to do would probably be to add a const char *name
field to struct arch_def
and then just leverage the existing arch_def_lookup()
to create a new API function seccomp_arch_resolve_token()
or similar. Does that sound okay to you?
@drakenclimber any thoughts?
That sounds good. Does it help when I make the changes (on top of master) and send you a pull request?
@drakenclimber any thoughts?
Yes, this sounds like a good API to add, and I think your proposed implementation should work well.
Does it help when I make the changes (on top of master) and send you a pull request?
Yes, that would be awesome! Once it's in master, we can handle getting it into the v2.5 release branch.
Thanks so much for the help :)
Once it's in master, we can handle getting it into the v2.5 release branch.
Since this is adding a new function to the API, I would suggest that this should be a candidate for v2.6.0 and not v2.5.x.