]> git.ipfire.org Git - thirdparty/systemd.git/commit
tmpfiles: if we get ENOENT when opening /proc/self/fd/, check if /proc is mounted 15564/head
authorLennart Poettering <lennart@poettering.net>
Thu, 23 Apr 2020 12:52:10 +0000 (14:52 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 Apr 2020 12:52:10 +0000 (14:52 +0200)
commitf8606626ed3c2582e06543550d58fe9886cdca5f
tree82bb10d2f456eaf67c29aeccbaa76e4038b86e00
parent883fff25f4841bcaec88ef49078b3512ce6eb07c
tmpfiles: if we get ENOENT when opening /proc/self/fd/, check if /proc is mounted

let's return ENOSYS in that case, to make things a bit less confusng.

Previously we'd just propagate ENOENT, which people might mistake as
applying to the object being modified rather than /proc/ just not being
there.

Let's return ENOSYS instead, i.e. an error clearly indicating that some
kernel API is not available. This hopefully should put people on a
better track.

Note that we only do the procfs check in the error path, which hopefully
means it's the less likely path.

We probably can add similar bits to more suitable codepaths dealing with
/proc/self/fd, but for now, let's pick to the ones noticed in #14745.

Fixes: #14745
src/basic/fd-util.c
src/basic/fs-util.c
src/tmpfiles/tmpfiles.c