mirror of
https://github.com/ps5-payload-dev/ftpsrv.git
synced 2026-10-19 02:10:54 -05:00
fix dir listing containing block devices
This commit is contained in:
1 parent
99c2508696
commit
01ef48270c
1 file changed
+8
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user