[PATCH 0/5] Linux: lchmod and AT_SYMLINK_NOFOLLOW support for fchmodat
Florian Weimer
fweimer@redhat.com
Tue Jul 21 09:54:38 GMT 2020
* Andreas Schwab:
> On Jan 22 2020, Florian Weimer wrote:
>
>> These patches use the O_PATH hack to implement a fairly close
>> approximation of fchmodat in AT_SYMLINK_NOFOLLOW mode.
>
> This means that cp -a now fails when /proc is not mounted.
>
> <https://build.opensuse.org/package/live_build_log/home:Andreas_Schwab:glibc:rebuild/installation-images:openSUSE/f/x86_64>
>
> running "cp -a /var/lib/ca-certificates var/lib"
> cp: setting permissions for 'var/lib/ca-certificates/pem': Operation not supported
> cp: setting permissions for 'var/lib/ca-certificates/openssl': Operation not supported
>
> newfstatat(AT_FDCWD, "/var/lib/ca-certificates/pem", {st_mode=S_IFDIR|0500, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
> mkdir("var/lib/ca-certificates/pem", 0500) = 0
> lstat("var/lib/ca-certificates/pem", {st_mode=S_IFDIR|0500, st_size=4096, ...}) = 0
> openat(AT_FDCWD, "var/lib/ca-certificates/pem", O_RDONLY|O_NOFOLLOW|O_CLOEXEC|O_PATH) = 3
> newfstatat(3, "", {st_mode=S_IFDIR|0500, st_size=4096, ...}, AT_EMPTY_PATH) = 0
> chmod("/proc/self/fd/3", 040700) = -1 ENOENT (No such file or directory)
> close(3) = 0
> write(2, "cp: ", 4) = 4
> write(2, "setting permissions for 'var/lib"..., 53) = 53
> write(2, ": Operation not supported", 25) = 25
> write(2, "\n", 1) = 1
Yes, it's a known issue.
I have not been able to convince the kernel developers to add the
required system call. Maybe you will have more luck with that?
Thanks,
Florian
More information about the Libc-alpha
mailing list