3 ms·
Why would that need root? Is it not up to your terminal emulator to interpret the \7 and trigger the actual beep?
by Retr0spectrum 9y ago
Why would that need root? Is it not up to your terminal emulator to interpret the \7 and trigger the actual beep?
- rnhmjoj 9y agoSee the "A note about ioctl" section of the README: https://github.com/johnath/beep https://github.com/johnath/beep
- DCoder 9y agoThat section says: > there's only one file opening, and while there is a potential race condition there, it's with /dev/console. If someone can exploit this race by replacing /dev/console, you've got bigger problems. :) However, by reading the source one can see that you can now tell beep where it should direct its output (-e, which is not documented anywhere), so the note above is no longer accurate. I would guess that this is the crux of the problem – the patch that fixes the security issue basically changes "open the output device once for each beep" to "open the output device on startup", greatly reducing the number of races. (It also zeroes out the buffer that's being written to certain output devices, but I have no idea if that is also to patch this security hole or to proactively prevent uninitialized bytes from leaking.)
- jwilk 9y agoBut echo doesn't do any ioctls. The only thing it does is writing bytes on stdout.