[PR #14] [MERGED] Fix parsing of /sys/block/XXX/device symlinks. #13

Open
opened 2026-01-30 21:22:21 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aaru-dps/aaruremote/pull/14
Author: @solemnwarning
Created: 10/16/2023
Status: Merged
Merged: 10/16/2023
Merged by: @claunia

Base: develHead: sys-block-xxx-parsing


📝 Commits (1)

  • c8e436b Fix parsing of /sys/block/XXX/device symlinks.

📊 Changes

1 file changed (+14 additions, -28 deletions)

View changed files

📝 linux/device.c (+14 -28)

📄 Description

As of c810bd8d07, I'm not able to use aaruremote on Linux (5.10). I've tried a few machines and they all have device sylinks like the following example from my CD dumping machine (has a mixture of SATA and IDE drives):

/sys/block/sr0/device -> ../../../0:0:0:0
/sys/block/sr1/device -> ../../../0:0:1:0
/sys/block/sr2/device -> ../../../4:0:0:0
/sys/block/sr3/device -> ../../../1:0:0:0
/sys/block/sr4/device -> ../../../3:0:0:0
/sys/block/sr5/device -> ../../../6:0:0:0

I'm not sure how many variants of this symlink exist in Linux, but from reading the existing code I think the intent was to extract the characters from the start the of last component of the filename up to the delimeter character (. or :), so I've reworked the code to do that without tripping up on the .. parts of the path.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/aaru-dps/aaruremote/pull/14 **Author:** [@solemnwarning](https://github.com/solemnwarning) **Created:** 10/16/2023 **Status:** ✅ Merged **Merged:** 10/16/2023 **Merged by:** [@claunia](https://github.com/claunia) **Base:** `devel` ← **Head:** `sys-block-xxx-parsing` --- ### 📝 Commits (1) - [`c8e436b`](https://github.com/aaru-dps/aaruremote/commit/c8e436b160d941c36fd6a52116ee2b3cb8952b7a) Fix parsing of /sys/block/XXX/device symlinks. ### 📊 Changes **1 file changed** (+14 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `linux/device.c` (+14 -28) </details> ### 📄 Description As of c810bd8d0739a8c9e17cd8fa5d73b64a2cb491d4, I'm not able to use aaruremote on Linux (5.10). I've tried a few machines and they all have device sylinks like the following example from my CD dumping machine (has a mixture of SATA and IDE drives): ``` /sys/block/sr0/device -> ../../../0:0:0:0 /sys/block/sr1/device -> ../../../0:0:1:0 /sys/block/sr2/device -> ../../../4:0:0:0 /sys/block/sr3/device -> ../../../1:0:0:0 /sys/block/sr4/device -> ../../../3:0:0:0 /sys/block/sr5/device -> ../../../6:0:0:0 ``` I'm not sure how many variants of this symlink exist in Linux, but from reading the existing code I *think* the intent was to extract the characters from the start the of last component of the filename up to the delimeter character (`.` or `:`), so I've reworked the code to do that without tripping up on the `..` parts of the path. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-30 21:22:22 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: aaru-dps/aaruremote#13