fileio: add new flag READ_FULL_FILE_VERIFY_REGULAR() that checks if file we operate on is regular

This commit is contained in:
Lennart Poettering
2025-11-02 21:14:35 +01:00
parent 1acec1c890
commit 7ecc69c33b
2 changed files with 9 additions and 1 deletions
+1
View File
@@ -30,6 +30,7 @@ typedef enum {
READ_FULL_FILE_WARN_WORLD_READABLE = 1 << 3, /* if regular file, log at LOG_WARNING level if access mode above 0700 */
READ_FULL_FILE_CONNECT_SOCKET = 1 << 4, /* if socket inode, connect to it and read off it */
READ_FULL_FILE_FAIL_WHEN_LARGER = 1 << 5, /* fail loading if file is larger than specified size */
READ_FULL_FILE_VERIFY_REGULAR = 1 << 6, /* before reading, verify this is a regular file */
} ReadFullFileFlags;
int fdopen_unlocked(int fd, const char *options, FILE **ret);