mirror of
https://github.com/freemkv/libfreemkv.git
synced 2026-10-07 18:13:10 +00:00
Security - Remove the unsafe Vec::set_len over recycled sector buffers — UB reachable from safe code (GHSA-j8ww-f5fg-9pmh, low). Uses Vec::resize; pooling unchanged. CI / tooling - clippy on stable with the MSRV single-sourced from Cargo.toml; cargo-deny dependency-audit gate with first-party git sources allowed (#15); audience-based comment-guard (#17). Docs - README (keydb ownership, BD-J parser count), drive-access transport/reset notes, mux timeline module-doc links.
16 lines
724 B
Markdown
16 lines
724 B
Markdown
# Linux `sg*` device enumeration
|
|
|
|
`enumerate_sg_names` (in `src/drive/linux.rs`) lists `/dev/sgN` SCSI-generic
|
|
device names to probe for optical drives.
|
|
|
|
Linux assigns `/dev/sgN` sequentially across *all* SCSI-generic devices
|
|
(disks, tape, HBAs, optical), not just optical drives. That means a fixed
|
|
`sg0..15` range can miss an optical drive on a host with many other SCSI
|
|
targets ahead of it in enumeration order.
|
|
|
|
To avoid that, the function prefers the exact present-device list from
|
|
`/sys/class/scsi_generic/`, which enumerates only the `sg*` nodes that
|
|
actually exist. It falls back to a bounded `sg0..15` probe only when sysfs
|
|
itself is unreadable, which happens in some minimal containers that lack a
|
|
mounted `/sys`.
|