about summary refs log tree commit diff
path: root/shared/systemd/src/basic/fileio.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2020-10-05 22:28:16 +0200
committerMichael Biebl <biebl@debian.org>2020-10-05 22:28:16 +0200
commit47a2114d6f697a31d84c8874c49e94dd04119d75 (patch)
treee3022686ff1956d7f17f1f7cdf7022ce980b7a5c /shared/systemd/src/basic/fileio.h
parent9d722f3d3492e31c0b3e4bcba603ffd65309c621 (diff)
parentaafc1dbe4712c86189bbc1d4d54ad8cb4c69be7e (diff)
Update upstream source from tag 'upstream/1.27.90'
Update to upstream version '1.27.90'
with Debian dir 72a0791efa5966be1724a82dfcac90f6cd22bd1b
Diffstat (limited to 'shared/systemd/src/basic/fileio.h')
-rw-r--r--shared/systemd/src/basic/fileio.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/shared/systemd/src/basic/fileio.h b/shared/systemd/src/basic/fileio.h
index e2830b79..9cba5a90 100644
--- a/shared/systemd/src/basic/fileio.h
+++ b/shared/systemd/src/basic/fileio.h
@@ -32,9 +32,11 @@ typedef enum {
 } WriteStringFileFlags;
 
 typedef enum {
-        READ_FULL_FILE_SECURE   = 1 << 0,
-        READ_FULL_FILE_UNBASE64 = 1 << 1,
-        READ_FULL_FILE_UNHEX    = 1 << 2,
+        READ_FULL_FILE_SECURE              = 1 << 0, /* erase any buffers we employ internally, after use */
+        READ_FULL_FILE_UNBASE64            = 1 << 1, /* base64 decode what we read */
+        READ_FULL_FILE_UNHEX               = 1 << 2, /* hex decode what we read */
+        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 */
 } ReadFullFileFlags;
 
 int fopen_unlocked(const char *path, const char *options, FILE **ret);
@@ -79,6 +81,14 @@ int xfopenat(int dir_fd, const char *path, const char *mode, int flags, FILE **r
 int search_and_fopen(const char *path, const char *mode, const char *root, const char **search, FILE **_f);
 int search_and_fopen_nulstr(const char *path, const char *mode, const char *root, const char *search, FILE **_f);
 
+int chase_symlinks_and_fopen_unlocked(
+                const char *path,
+                const char *root,
+                unsigned chase_flags,
+                const char *open_flags,
+                FILE **ret_file,
+                char **ret_path);
+
 int fflush_and_check(FILE *f);
 int fflush_sync_and_check(FILE *f);