fix dir listing containing block devices

This commit is contained in:
John Törnblom committed 2026-01-06 10:48:57 +01:00
1 parent 99c2508696
commit 01ef48270c
1 file changed
+8
+8
View File
@@ -372,9 +372,17 @@ self_extract_elf(int self_fd, int elf_fd) {
int
self_is_valid(const char* path) {
self_head_t head;
struct stat st;
ssize_t n;
int fd;
if(stat(path, &st)) {
return -1;
}
if(!S_ISREG(st.st_mode)) {
return 0;
}
if((fd=open(path, O_RDONLY, 0)) < 0) {
return -1;
}