summaryrefslogtreecommitdiff
path: root/src/basic/fs-util.h
diff options
context:
space:
mode:
authorNeilBrown <neil@brown.name>2017-09-04 23:35:07 +1000
committerSven Eden <yamakuzure@gmx.net>2017-09-04 23:35:07 +1000
commit5c61c6352ad14bf0b392a5af2588e3ed319ad86b (patch)
treec0ae9b1072e4a46a20f3eb5db42ed1a03a6920c0 /src/basic/fs-util.h
parent4b9303ec2924f73180408479a0f160868165f756 (diff)
tmpfiles: silently ignore any path that passes through autofs (#6506)
If a path passes though an autofs filesystem, then accessing the path might trigger and automount. As elogind-tmpfiles is run before the network is up, and as automounts are often used for networked filesystems, this can cause a deadlock. So chase_symlinks is enhance to accept a new flag which tells it to check for autofs, and return -EREMOTE if autofs is found. tmpfiles is changed to check just before acting on a path so that it can avoid autofs even if a symlink was created earlier by tmpfiles that would send this path through an autofs. This fixes a deadlock that happens when /home is listed in /etc/fstab as x-elogind.automount for an NFS directory.
Diffstat (limited to 'src/basic/fs-util.h')
-rw-r--r--src/basic/fs-util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h
index 4c6bb659a..a9ec7611d 100644
--- a/src/basic/fs-util.h
+++ b/src/basic/fs-util.h
@@ -96,6 +96,7 @@ int inotify_add_watch_fd(int fd, int what, uint32_t mask);
enum {
CHASE_PREFIX_ROOT = 1, /* If set, the specified path will be prefixed by the specified root before beginning the iteration */
CHASE_NONEXISTENT = 2, /* If set, it's OK if the path doesn't actually exist. */
+ CHASE_NO_AUTOFS = 4, /* If set, return -EREMOTE if autofs mount point found */
};
int chase_symlinks(const char *path_with_prefix, const char *root, unsigned flags, char **ret);