fexist: may return 0 if no permissions to read #7

Open
opened 2025-07-28 00:12:04 +02:00 by Kwarde · 0 comments
Owner

During one of my many random reviews I realized fexist() may return 0 (file does not exist) while it does actually exist.
Need to test but if user has no permissions to the file, NR_open may fail with -EACCESS. fexist currently checks if there is any error, so if the file does exist and if it does indeed return error -EACCESS, fexist will return 0 while it should return 1.

Need to test

During one of my many random reviews I realized fexist() may return 0 (file does not exist) while it does actually exist. Need to test but if user has no permissions to the file, NR_open may fail with -EACCESS. fexist currently checks if there is _any_ error, so if the file does exist and if it does indeed return error -EACCESS, fexist will return 0 while it should return 1. Need to test
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Kwarde/klibc#7
No description provided.