News for hackers. Stuff that matters.
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by Jasper_ on Friday March 29, 2024 @12:53PM (#39866254)
That is all the protocol is. From https://www.freedesktop.org/software/systemd/man/latest/sd_n...:

> These functions send a single datagram with the state string as payload to the socket referenced in the $NOTIFY_SOCKET environment variable.

The simplest implementation (pseudocode, no error handling, not guaranteed to compile), is something like:

    const char *addrstr = getenv("NOTIFY_SOCKET");
    if (addrstr) {
        int fd = socket(AF_UNIX, SOCK_DGRAM, 0);
        struct sockaddr_un addr = { .sun_family = AF_UNIX };
        strncpy(addr.sun_path, sizeof(addr.sun_path), addrstr);
        connect(fd, (struct sockaddr*) &addr);
        write(fd, "READY=1");
        close(fd);
    }
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by iforgotpassword on Friday March 29, 2024 @02:52PM (#39867621)
This is what I did for a daemon I'm maintaining. Type=notify support was requested but I'm really allergic to adding new libs to a project until they really do some heavy lifting and add enough value. I was pleasantly surprised the protocol was that simple and implemented it myself. I think systemd should just provide a simple standalone reference implementation and encourage people to copy it into their project directly. (But maybe they already do, I did that almost a decade ago IIRC when the feature was relatively new.)
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by throwaway71271 on Friday March 29, 2024 @02:01PM (#39867092)
goddamnit leftpad got us too :)
Re:Backdoor in upstream xz/liblzma leading to SSH server com... by Repulsion9513 on Friday March 29, 2024 @10:26PM (#39871284)
Whoops, you forgot `vsock:`, `@`, `SO_PASSCRED` (I think)... oh and where is that example provided? But yep that's all the protocol is for sure (and forever)!