Code Monkey home page Code Monkey logo

Comments (8)

ManaSugi avatar ManaSugi commented on May 20, 2024 1

We need to decide the function name carefully to avoid under score(_) hell.

from libseccomp-rs.

rusty-snake avatar rusty-snake commented on May 20, 2024 1

Looks like there's no perfect solution either, so do what you want.

My idea would be to directly map the C constants like "SCMP_FLTATR_*".strip("^SCMP_FLTATR_").to_lower():

get_act_default()
{get,set}_act_badarch()
{get,set}_ctl_nnp()
{get,set}_ctl_tsync()
{get,set}_api_tskip()
{get,set}_ctl_log()
{get,set}_ctl_ssb()
{get,set}_ctl_optimize()
{get,set}_api_sysrawrc()

from libseccomp-rs.

rusty-snake avatar rusty-snake commented on May 20, 2024 1

IMHO we should keep it as deprecated alias even if we bump to 0.3.0.

Generally I think it is the best to just keep deprecated stuff unless it is a security risk or blocks future development.
Good examples would be
https://mesonbuild.com/Reference-manual_builtin_meson.html
https://docs.rs/clap/latest/clap/struct.Arg.html
https://doc.rust-lang.org/std/index.html

from libseccomp-rs.

ManaSugi avatar ManaSugi commented on May 20, 2024

I'd like to change the name of {get,set}_no_new_privs_bit() to {get,set}_nnp.
In case of {get,set}_ssb, If we unify the functions to full name like {get,set}_no_new_privs, we have to define {get,set}_speculative_store_bypass that is a very long name (so is get,set}_no_new_privs_bit()).
Hence, I propose the new function names as follows:

get_default_action()
{get,set}_badarch_action()
{get,set}_nnp()
{get,set}_log()
{get,set}_ssb()
{get,set}_optimize()
{get,set}_rawrc()
{get,set}_tskip()
{get,set}_tsync()

@rusty-snake Could you give me your thoughts?

Ref. https://man7.org/linux/man-pages/man3/seccomp_attr_set.3.html

from libseccomp-rs.

ManaSugi avatar ManaSugi commented on May 20, 2024

It's nice for me. Thank you.

from libseccomp-rs.

ManaSugi avatar ManaSugi commented on May 20, 2024

@rusty-snake
Regarding rename of {get,set}_no_new_privs_bit, Which would be better, we make the current function deprecated or bump the version to 0.3.0 without deprecated to avoid many deprecated functions?

from libseccomp-rs.

ManaSugi avatar ManaSugi commented on May 20, 2024

Thank you for your suggestion and the information.
I thought that I'd like to avoid generating many deprecated functions , but I agree with your thoughts.
I'll create a PR to rename it with making it deprecated.
Wow, clap has many deprecated functions :)

from libseccomp-rs.

ManaSugi avatar ManaSugi commented on May 20, 2024

I'll decide whether we should support {get,set}_api_tskip() after seccomp/libseccomp#368 (comment) is solved.

from libseccomp-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.