Closed takusuman closed 1 month ago
There's a small problem with this: on the contrary of wall(1) (see #46), it can read the utmpx database perfectly, but it will not be writing to any terminal since it will always fail on not having the necessary permissions for it, failing here: https://github.com/Projeto-Pindorama/heirloom-ng/blob/ed2c5552b7f76b2813c135be28f3f60c244d7f6b/write/write.c#L121-L122 ... Or here: https://github.com/Projeto-Pindorama/heirloom-ng/blob/ed2c5552b7f76b2813c135be28f3f60c244d7f6b/write/write.c#L126-L127
Interesting at least.
This code, with all the respect and acknowledgements to the AT&T crew, also looks like a spaghetti. I mean, it looks like that at least two people programmed this in parallel. Still, it looks legible enough.
Funnily enough, when these are commented out, it writes as usual for normal users (at least from mine-to-mine), but not root
, even though messages can be written for root
on the util-linux implementation --- which is based on some BSD version and, of course, have almost completely different internals.
In any case, I'm happy just per porting this from utmp to utmpx successfully.
Another one bites the dust.