News for hackers. Stuff that matters.
Re:Varlink – IPC to replace D-Bus gradually in systemd by poettering on Monday September 30, 2024 @04:13AM (#41694732)
You are writing this as if JSON was a newly invented thing, and not a language that has become the lingua franca of the Internet when it comes to encoding structured data. Well understood, and universally handled, since 1997.

A 100 digit number cannot be encoded losslessly in D-Bus btw, nor in the far majority of IPC marshallings on this word.

Having done systems-level OS development since 25y or so I never felt the burning urge to send a 100 digit number over local IPC.

Not that 100 digit numbers aren't useful, even in IPC, but typically, that's a cryptography thing, and they generally use their own serializations anyway.

Re:Varlink – IPC to replace D-Bus gradually in systemd by orra on Monday September 30, 2024 @04:48AM (#41694923)
Honestly, the only thing that surprises me is you're being pedantic, and encoding int64s as strings.

I know you know JSON is nominally only 53-bit safe, because JS numbers are doubles. But in practice I'd wager most JSON libraries can handle 64-bit integers.

Re:Varlink – IPC to replace D-Bus gradually in systemd by gpderetta on Monday September 30, 2024 @05:06AM (#41695038)
> A 100 digit number cannot be encoded losslessly in D-Bus btw

I think the concern is that large numbers can in fact be encoded in JSON, but there is no guarantee that they will be decoded correctly by a receiver as the format is underspecified. So you have to cater for the ill defined common denominator.

Re:Varlink – IPC to replace D-Bus gradually in systemd by immibis on Monday September 30, 2024 @07:07AM (#41695778)
The format is properly specified; its mapping onto actual hardware people use is not.
Re:Varlink – IPC to replace D-Bus gradually in systemd by heavenlyblue on Monday September 30, 2024 @10:25AM (#41697445)
You should probably encode large numbers as strings.
Re:Varlink – IPC to replace D-Bus gradually in systemd by steventhedev on Monday September 30, 2024 @10:00AM (#41697171)
You are writing this as if security was a newly invented thing. Having done systems level security development for 12 years, anything that can be produced maliciously will be. By using JSON, you've invented a new vulnerability class for malicious deserialization attacks.

Actually, not new. Earliest CVE I found was from 2017, which feels a decade later than it should be. I guess no one thought of pushing JSON over trusted interfaces, and probably for good reason.