android: su fails with "No daemon is currently running!" because the shell sandbox does not bind /debug_ramdisk
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- android, kotlin
- Lĩnh vực
- infrastructure, mobile
Hướng nghiên cứu
Tìm cấu hình sandbox Android shell tạo các đối số bind của proot và kiểm tra cách cấu hình xử lý các đường dẫn host tùy chọn. Trước tiên, hãy tìm các bind hiện có của /system, /vendor và /apex, sau đó lần theo nơi kiểm thử các đối số đó. Công việc hoàn tất khi /debug_ramdisk được bind nếu nó tồn tại và su trong shell có thể truy cập daemon của Magisk; các thiết bị chưa root vẫn phải tiếp tục hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
On a Magisk-rooted Android device, su from the agent shell always fails:
$ su -c id
No daemon is currently running! # exit 1
$ magisk -c
28.1:MAGISK:R (28100) # client binary is fine
$ magisk --path
(empty) # tmp dir not discoverable
Root is healthy: in Termux on the same device su -c id returns uid=0(root), and the device mount table has magisk on /debug_ramdisk type tmpfs, magisk on /system/bin type tmpfs, magisk on /system/lib64/libzygisk.so type tmpfs.
Cause: Magisk 28.1 keeps magiskd at %s/.magisk/device/socket (format string is in the client binary), where %s is /debug_ramdisk. The Android shell runs under proot with root /data/user/0/com.opencode/files and binds only:
-b /system:/system -b /vendor:/vendor -b /apex:/apex -b /storage:/storage
-b /proc:/proc -b /dev:/dev -b <prefix>:/usr,/bin,/lib,/etc,/share,/tmp,/var,/home
-b /data/app/.../lib/arm64:/opt/oc-lib
/debug_ramdisk is missing, so the client cannot reach the socket. /proc/self/mountinfo inside the sandbox also shows no magisk mounts, consistent with magisk --path being empty.
Plugins
none
OpenCode version
2.0.27 (bootstrap 3, tools 6)
Steps to reproduce
- On a Magisk-rooted device, run
su -c idin the agent shell. - Observe
No daemon is currently running!. - Run the same in Termux: works (
uid=0).
Operating System
Android 13 (SDK 33), Realme RMX3834, arm64-v8a; shell runs as u:r:untrusted_app_27:s0
Terminal
app PTY, TERM=xterm-256color, shell oc-shell (bash)
Additional context
Fix: bind /debug_ramdisk into the sandbox when it exists (no-op on unrooted devices):
if (File("/debug_ramdisk").exists()) {
args += listOf("-b", "/debug_ramdisk:/debug_ramdisk")
}
Optionally also bind /sbin when present (older Magisk / KernelSU < 1.0). /data/adb is not needed for su and should stay out of the sandbox.
Workaround: run root commands in Termux, or start the shell with -b /debug_ramdisk:/debug_ramdisk.
- Ngôn ngữ chính
- TypeScript
- Star
- 221k
- Fork
- 29.6k
- Merge trung bình
- 5 giờ 32 phút
- Pull request đã merge (30 ngày)
- 492
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của anomalyco/opencode
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anomalyco/opencode#60174 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
anomalyco/opencode#60143 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
anomalyco/opencode#60121 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
anomalyco/opencode#59973 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
anomalyco/opencode#59886 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của anomalyco/opencode
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
marmelab/react-admin#11431 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
db-ux-design-system/core-web#8655 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
stripe/react-stripe-js#728 ·
-
[Upload Grade C dataset] the pop-up changes it's size while uploading the document => Jumping effectĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
epam/statgpt-admin-frontend#305 ·
Maintainer thường phản hồi trong vòng 1 ngày