• 1 Post
  • 4 Comments
Joined 1 year ago
cake
Cake day: June 2nd, 2023

help-circle
  • the common practice is to relax the dependencies

    I found this a bit disturbing

    I find that funny that, since this is rust, this is now an issue.

    I have not dwelved in packaging in a long while, but I remember that this was already the case for C programs. You need to link against libfoo? It better work with the one the distribution ship with. What do you mean you have not tested all distributions? You better have some tests to catch those elusive ABI/API breakage. And then, you have to rely on user reported errors to figure out that there is an issue.

    On one hand, the package maintainer tend to take full ownership and will investigate issues that look like integration issue themselves. On the other hand, your program is in a buggy or non-working state until that’s sorted.

    And the usual solutions are frown upon. Vendoring the dependencies or static linking? Are you crazy? You’re not the one paying for bandwidth and storage. Which is a valid concern, but that just mean we reached a stalemate.

    Which is now being broken by

    • slower moving C/C++ projects (though the newer C++ standards did some waves a few years back) which means that even Debian is likely to have a “recent” enough version of your dependencies.
    • flatpack and the likes, which are vendoring everything and the kitchen sink
    • newer languages that static link by default (and some distributions being OK with it)

    In other words, we never figured out a proper solution for C projects that will link with a different minor than the one the developer tested.

    Well, /rant I guess. The point I’m raising does not seem to be the only one, and maybe far from the main one, for which bcachefs-tools is now orphaned. But I’ve seen very dubious arguments to try and push back against rust adoption. I feel like people have forgotten where we came from. And while there is no reason to go back per say, any new language that integrate this deep into the system will face similar challenges.


  • Enable permissions for KMS capture.

    Warning

    Capture of most Wayland-based desktop environments will fail unless this step is performed.

    Note

    cap_sys_admin may as well be root, except you don’t need to be root to run it. It is necessary to allow Sunshine to use KMS capture.

    Enable

       sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine))
    

    Disable (for Xorg/X11 only)

       sudo setcap -r $(readlink -f $(which sunshine))
    

    Their install instruction are pretty clear to me. The actual instruction is to run

    sudo setcap cap_sys_admin+p $(readlink -f $(which sunshine))

    This is vaguely equivalent to setting the setuid bit on programs such as sudo which allows you to run as root. Except that the program does not need to be owned by root. There are also some other subtleties, but as they say, it might as well be the same as running the program directly as root. For the exact details, see here: https://www.man7.org/linux/man-pages/man7/capabilities.7.html and look for CAP_SYS_ADMIN.

    In other words, the commands gives all powers to the binary. Which is why it can capture everything.

    Using KMS capture seems way overkill for the task I would say. But maybe the wayland protocol was not there yet when this came around or they need every bit of performance they can gain. Seeing the project description, I would guess on the later as a cloud provider would dedicate a machine per user and would then wipe and re-install between two sessions.


  • On the topic of exposing sequence number in APIs, this has been a security issue in the past. Here is one I remember: https://www.reuters.com/article/us-cyber-travel-idUSKBN14G1I6/

    From the article:

    Two of the three big booking systems - Amadeus and Travelport - assign booking codes sequentially, making brute-force computer guesswork easier. Of the three, Amadeus, through its web portal CheckMyTrip, is especially vulnerable, Nohl said.

    The PNRs (flight booking code) have many more security issues, but at least nowadays, their sequential aspect should no longer be exposed.

    So that’s one more reason to be careful when exposing DB id in APIs, even if converted to a natural looking key or at least something easier to remember.