tmpfiles: silently ignore any path that passes through autofs (#6506)
authorNeilBrown <neil@brown.name>
Mon, 4 Sep 2017 13:35:07 +0000 (23:35 +1000)
committerLennart Poettering <lennart@poettering.net>
Mon, 4 Sep 2017 13:35:07 +0000 (15:35 +0200)
commit655f2da0790d0f8670f7a4c7da1833786ce0137e
tree65a2823ca293bafefcf9080bb58d840e91ee8dd0
parentee905de0d60f05c99fb49f71d1c4af2d7e3f3134
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 systemd-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-systemd.automount for an NFS directory.
src/basic/fs-util.c
src/basic/fs-util.h
src/tmpfiles/tmpfiles.c