On Tue, Nov 18, 2025 at 3:50 PM Thomas Schmitt <[email protected]> wrote: > > Hi, > > jumping ahead: > > The wodim --devices bug has nothing to do with the problems of > D. R. Evans with K3B and the resulting need for the setuid bit with > wodim. > > The --devices bug is rather due to a failed attempt to rename /dev/sr > to /dev/scd about 25 years ago, plus a mistaken piece of code in wodim > which since Linux 3.0 sporadically falls back to the code for pre-2.6. > > When wodim believes to run on Linux >= 2.6 it enumerates and examines > only the /dev/scd* device files, which died out about 15 years ago. > So it fails to find any drive. > When it believes to run on Linux < 2.6 it enumerates /dev/sg* which > still exists in Linux 6.x. So the drives of such a system get found. > > Debian 12 is perceived as pre-2.6, my Sid is perveived as 2.6 or later. > Sid's wodim works and finds the emulated DVD drive after > ln -s /dev/sr0 /dev/scd0 > > > Max Nikulin wrote: > > Is there anything interesting in call stacks? > > strace -k -e trace=openat wodim --devices > > Indirectly this brought the solution for the path display problem. > It works fine for the superuser. > > With above strace run as normal user i only get an error message > together with each line: > > openat(AT_FDCWD, 0x7fff596d83e0, O_RDWR|O_EXCL|O_NONBLOCK) = -1 ENOENT (No > such file or directory) > strace: fopen: /proc/1188/maps: Permission denied > > This error message was not emitted by the previously tried runs . > > So i retried as classical superuser (su -). This gave me an > avalanche of line blocks like this > > openat(AT_FDCWD, "/dev/hda", O_RDWR|O_EXCL|O_NONBLOCK) = -1 ENOENT (No such > file or directory) > > /usr/lib/x86_64-linux-gnu/libc.so.6(__internal_syscall_cancel+0x67) > [0x8f687] > > /usr/lib/x86_64-linux-gnu/libc.so.6(__syscall_cancel+0xd) [0x8f6ad] > > /usr/lib/x86_64-linux-gnu/libc.so.6(__libc_open64+0x4d) [0x1037bd] > > /usr/bin/wodim(sg_open_excl+0x48) [0x398c8] > > /usr/bin/wodim() [0x39d2c] > > /usr/bin/wodim(usal__open+0x41) [0x32cc1] > > /usr/bin/wodim(usal_open+0x188) [0x326f8] > > /usr/bin/wodim(main+0x3c9) [0x12b49] > > /usr/lib/x86_64-linux-gnu/libc.so.6(__libc_start_call_main+0x78) [0x29ca8] > > /usr/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main_alias_2+0x85) > [0x29d65] > > /usr/bin/wodim(_start+0x21) [0x16c21] > > The stack trace tells me that i was not so wrong with usal_open() > being involved. > > The older among the readers might remember /dev/hda and its faithful > slave /dev/hdb. Back in the uncivilized days of IDE when either the > boss worked or the slave, but never both. > > The list of failed calls from strace without options is: > > access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or > directory) > prctl(PR_CAPBSET_READ, 0x30 /* CAP_??? */) = -1 EINVAL (Invalid argument) > prctl(PR_CAPBSET_READ, 0x2c /* CAP_??? */) = -1 EINVAL (Invalid argument) > prctl(PR_CAPBSET_READ, 0x2a /* CAP_??? */) = -1 EINVAL (Invalid argument) > prctl(PR_CAPBSET_READ, 0x29 /* CAP_??? */) = -1 EINVAL (Invalid argument) > openat(AT_FDCWD, "/dev/hda", O_RDWR|O_EXCL|O_NONBLOCK) = -1 ENOENT (No such > file or directory) > ... > openat(AT_FDCWD, "/dev/hdz", O_RDWR|O_EXCL|O_NONBLOCK) = -1 ENOENT (No such > file or directory) > openat(AT_FDCWD, "/dev/scd0", O_RDWR|O_EXCL|O_NONBLOCK) = -1 ENOENT (No > such file or directory) > ... > openat(AT_FDCWD, "/dev/scd255", O_RDWR|O_EXCL|O_NONBLOCK) = -1 ENOENT (No > such file or directory) > > Soon after /dev/scd255 the run ends with > > write(2, "wodim: No such file or directory"..., 34wodim: No such file or > directory. ) = 34 > write(2, "\nCannot open SCSI driver!\nFor po"..., 128 > > It looks only for two dinosaurs of optical drive device file history. > > On Debian 12 it looks for /dev/hda[a-z] and /dev/sg0 to /dev/sg255. > The emulated DVD-ROM is found as /dev/sg1. > > The source > > https://sources.debian.org/src/cdrkit/9%3A1.1.11-5/libusal/scsi-linux-sg.c#L517 > looks like the difference is the outcome of call check_linux_26(). > > My Sid is assessed as Linux >= 2.6 because of the major kernel version > 6 being larger than 1 and the minor version 16 being >= 6. > > https://sources.debian.org/src/cdrkit/9%3A1.1.11-5/libusal/scsi-linux-sg.c#L251 > $ uname -r > 6.16.5+deb14-amd64 > My Debian 12 has > 6.1.0-21-amd64 > so that the minor version is not high enough for being 2.6. > > This means that the --devices bug appears and vanishes with kernel > versions. 6.1 of Debian 12 inspects /dev/sg. 6.16 of my Sid looks for > /dev/scd. All look for /dev/hd. None looks for /dev/sr. > > This also means that the --devices bug is not related to the problems > of D. R. Evans with K3B and the resulting need for the setuid bit with > wodim. > I cannot test whether K3B would like my headless Sid's wodim without > setuid bit.
Very nice analysis. This problem comes up several times a year on the mailing list. Can you find a place to memorialize it, like <https://wiki.debian.org/>? Jeff

