systemd FTBFS on bionic containers due to test-fs-util

Bug #2077176 reported by Heitor Alves de Siqueira
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Pro
Status tracked in 18.04
18.04
In Progress
High
Heitor Alves de Siqueira
systemd (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

On Ubuntu 18.04 containers, systemd can FTBFS due to test-fs-util failing. When test-fs-util attempts to chmod a symbolic link, this can fail with EOPNOTSUPP depending on multiple factors (kernel versions, syscall support, underlying file system).

To fix and make systemd's behavior consistent, we backport the following chmod() and chown() related patches from upstream:
  4dfaa528d451 fs-util: introduce fchmod_opath()
  b8da477eaf6c fs-util: introduce fchmod_and_chown()
  de321f522829 fs-util: beef up chmod_and_chown() a bit
  30ff18d8a2cd fs-util: change chmod_and_chown() to not complain if stat data already matches
  2dbb7e94af4f fs-util: rewrite chmod_and_chown()
  71ec74d19332 fs-util: no need for fchmod_and_chown() to access /proc/self/fd directly
  4b3b5bc71b79 tree-wide: port various places over to use chmod_and_chown()
  f63383a31fa4 test-fs-util: don't validate mode of symlinks

This ensures the following:
- systemd will be aware and respect syscall behavior from chmod variants (e.g. fchmod on a symlink with O_PATH)
- systemd's touch_file() will not exhibit different chmod/chown behavior across different filesystems (e.g. ZFS vs ext4)
- systemd won't be hamstringed by libc changing the syscalls depending on what's available in the host kernel (e.g. fchmodat2())
- enforce that symlink permissions are disregarded (as per symlink(2)/POSIX.1-2001), even if we're using /proc/<pid>/fd/<num> for the symlink handle

Revision history for this message
Heitor Alves de Siqueira (halves) wrote :

Since this does not seem to affect any releases newer than 18.04, I've marked this as Fix Released. This does need to be fixed for Ubuntu Pro 18.04, in any case.

summary: - FTBFS on bionic containers due to test-fs-util
+ systemd FTBFS on bionic containers due to test-fs-util
Changed in systemd (Ubuntu):
importance: Undecided → Medium
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.