Giter Club home page Giter Club logo

Comments (3)

diwic avatar diwic commented on August 27, 2024

I don't think we should auto-append and auto-strip any zeros at the end of arrays of byte. That seems very unintuitive to me (and would perhaps also have a performance cost).

I have not used GDBus, but if it doesn't properly support byte arrays, then they should fix that.

from dbus-rs.

LEW21 avatar LEW21 commented on August 27, 2024

I've updated my proposal, because smcv has proven the first option is impossible (in the pydbus issue comments).

I also think that in the ideal world nobody should use \0-terminated arrays here, but there is at least one case (besides Flatpak, which is new, and can easily be changed) where they're used:

"The D-Bus core protocol has adopted this convention for the LinuxSecurityLabel value in the hash table returned by GetConnectionCredentials(), although the older GetConnectionSELinuxContext() method doesn't do it."

You might want to reply on LEW21/pydbus#27 - as I've opened issues on 8 different bindings to get their authors attention, and it's starting to get hard to keep track of all of them.

from dbus-rs.

diwic avatar diwic commented on August 27, 2024

Rust does not use zero-terminated strings and thus has no use for the extra zero anyway. Also, for now, we only know of two places where this happens so I doubt it's commonly used.

If the D-Bus specification grows some kind of annotation about autoremoval/autoadd of \0 then I'll consider supporting that in my bindings - until then, it's trivial for whoever uses dbus-rs to do that add/removal manually. It's even easier than it would be for me, considering that these zero-terminated arrays may be inside an arbitrary level of containers.

from dbus-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.