[PATCH 0/5] Thread-specific file system attributes and credentials
enh
enh@google.com
Tue Dec 9 17:55:39 GMT 2025
does it make sense to have multiple functions (as here), or would
generic functions with multiple arguments make more sense? (it's a lot
less boilerplate if nothing else.)
On Tue, Dec 9, 2025 at 12:30 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> This functionality is already in use via unshare or direct system calls
> in file servers such as Samba and nfs-ganesha. I think it makes sense
> to provide a glibc implementation, to document that this is a supported
> scenario.
>
> This is a repost of a very old patch series.
>
> Thanks,
> Florian
>
> Florian Weimer (5):
> support: Add xfchdir
> support: Add xgetresgid and xgetresuid
> Linux: Implement per-thread file system attributes
> Linux: Implement per-thread user and group IDs
> nptl: Add test nptl/tst-pthread-perthread-inherit
>
> NEWS | 10 +
> manual/threads.texi | 148 +++++
> nptl/Makefile | 10 +
> nptl/Versions | 4 +
> nptl/nptl_setxid.c | 20 +-
> nptl/pthread_attr_getperthreadfs_np.c | 32 ++
> nptl/pthread_attr_getperthreadids_np.c | 32 ++
> nptl/pthread_attr_setperthreadfs_np.c | 39 ++
> nptl/pthread_attr_setperthreadids_np.c | 39 ++
> nptl/pthread_create.c | 20 +-
> nptl/tst-pthread-perthread-inherit.c | 220 +++++++
> nptl/tst-pthread-perthreadfs-chroot.c | 255 +++++++++
> nptl/tst-pthread-perthreadfs.c | 322 +++++++++++
> nptl/tst-pthread-perthreadids.c | 541 ++++++++++++++++++
> support/Makefile | 3 +
> support/xfchdir.c | 28 +
> support/xgetresgid.c | 27 +
> support/xgetresuid.c | 27 +
> support/xunistd.h | 4 +
> sysdeps/nptl/internaltypes.h | 13 +
> sysdeps/nptl/pthread.h | 44 +-
> sysdeps/nptl/pthreadP.h | 8 +
> sysdeps/nptl/setxid.h | 2 +-
> sysdeps/unix/sysv/linux/aarch64/libc.abilist | 4 +
> sysdeps/unix/sysv/linux/alpha/libc.abilist | 4 +
> sysdeps/unix/sysv/linux/arc/libc.abilist | 4 +
> sysdeps/unix/sysv/linux/arm/be/libc.abilist | 4 +
> sysdeps/unix/sysv/linux/arm/le/libc.abilist | 4 +
> sysdeps/unix/sysv/linux/csky/libc.abilist | 4 +
> sysdeps/unix/sysv/linux/hppa/libc.abilist | 4 +
> sysdeps/unix/sysv/linux/i386/libc.abilist | 4 +
> .../sysv/linux/loongarch/lp64/libc.abilist | 4 +
> .../sysv/linux/m68k/coldfire/libc.abilist | 4 +
> .../unix/sysv/linux/m68k/m680x0/libc.abilist | 4 +
> .../sysv/linux/microblaze/be/libc.abilist | 4 +
> .../sysv/linux/microblaze/le/libc.abilist | 4 +
> .../sysv/linux/mips/mips32/fpu/libc.abilist | 4 +
> .../sysv/linux/mips/mips32/nofpu/libc.abilist | 4 +
> .../sysv/linux/mips/mips64/n32/libc.abilist | 4 +
> .../sysv/linux/mips/mips64/n64/libc.abilist | 4 +
> sysdeps/unix/sysv/linux/or1k/libc.abilist | 4 +
> .../linux/powerpc/powerpc32/fpu/libc.abilist | 4 +
> .../powerpc/powerpc32/nofpu/libc.abilist | 4 +
> .../linux/powerpc/powerpc64/be/libc.abilist | 4 +
> .../linux/powerpc/powerpc64/le/libc.abilist | 4 +
> .../unix/sysv/linux/riscv/rv32/libc.abilist | 4 +
> .../unix/sysv/linux/riscv/rv64/libc.abilist | 4 +
> .../unix/sysv/linux/s390/s390-32/libc.abilist | 4 +
> .../unix/sysv/linux/s390/s390-64/libc.abilist | 4 +
> sysdeps/unix/sysv/linux/sh/be/libc.abilist | 4 +
> sysdeps/unix/sysv/linux/sh/le/libc.abilist | 4 +
> .../sysv/linux/sparc/sparc32/libc.abilist | 4 +
> .../sysv/linux/sparc/sparc64/libc.abilist | 4 +
> .../unix/sysv/linux/x86_64/64/libc.abilist | 4 +
> .../unix/sysv/linux/x86_64/x32/libc.abilist | 4 +
> 55 files changed, 1960 insertions(+), 16 deletions(-)
> create mode 100644 nptl/pthread_attr_getperthreadfs_np.c
> create mode 100644 nptl/pthread_attr_getperthreadids_np.c
> create mode 100644 nptl/pthread_attr_setperthreadfs_np.c
> create mode 100644 nptl/pthread_attr_setperthreadids_np.c
> create mode 100644 nptl/tst-pthread-perthread-inherit.c
> create mode 100644 nptl/tst-pthread-perthreadfs-chroot.c
> create mode 100644 nptl/tst-pthread-perthreadfs.c
> create mode 100644 nptl/tst-pthread-perthreadids.c
> create mode 100644 support/xfchdir.c
> create mode 100644 support/xgetresgid.c
> create mode 100644 support/xgetresuid.c
>
>
> base-commit: 0f0a5cd338998f4b603f52f3ce2163df0db7b814
> --
> 2.52.0
>
More information about the Libc-alpha
mailing list