소스 검색

Add check for empty tracefs mounts

drewvis 2 년 전
부모
커밋
3a2c0cd1dd
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      aya/src/programs/utils.rs

+ 2 - 1
aya/src/programs/utils.rs

@@ -33,7 +33,8 @@ pub(crate) fn find_tracefs_path() -> Result<&'static Path, ProgramError> {
             ];
 
             for mount in known_mounts {
-                if mount.exists() {
+                // Check that the mount point exists and is not empty
+                if mount.exists() && mount.read_dir().ok()?.next().is_some() {
                     return Some(mount);
                 }
             }