aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_uid16.c
diff options
context:
space:
mode:
authorDmitry Chagin <dchagin@FreeBSD.org>2023-05-29 08:16:46 +0000
committerDmitry Chagin <dchagin@FreeBSD.org>2023-05-29 08:16:46 +0000
commitfd745e1db6b561900b8e5e9caa4ed05cf15398b3 (patch)
tree70a8872a57c71fc4bbf7818c5c5c51db03d2c836 /sys/compat/linux/linux_uid16.c
parent3d2fec7db856c67e1a94a87a846d8ffe6f48b61f (diff)
linux(4): Use pwd_altroot() to tell namei() about ABI root path
PR: 72920 Differential Revision: https://reviews.freebsd.org/D40090 MFC after: 2 month
Diffstat (limited to 'sys/compat/linux/linux_uid16.c')
-rw-r--r--sys/compat/linux/linux_uid16.c43
1 files changed, 4 insertions, 39 deletions
diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c
index 181ecd2c7e12..7b7dc8e0f0bb 100644
--- a/sys/compat/linux/linux_uid16.c
+++ b/sys/compat/linux/linux_uid16.c
@@ -72,52 +72,17 @@ DUMMY(getresgid16);
int
linux_chown16(struct thread *td, struct linux_chown16_args *args)
{
- char *path;
- int error;
-
- if (!LUSECONVPATH(td) && !SDT_PROBES_ENABLED()) {
- error = kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE,
- CAST_NOCHG(args->uid), CAST_NOCHG(args->gid), 0);
- } else {
- LCONVPATHEXIST(args->path, &path);
- /*
- * The DTrace probes have to be after the LCONVPATHEXIST, as
- * LCONVPATHEXIST may return on its own and we do not want to
- * have a stray entry without the corresponding return.
- */
- LIN_SDT_PROBE1(uid16, linux_chown16, conv_path, path);
- error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE,
- CAST_NOCHG(args->uid), CAST_NOCHG(args->gid), 0);
- LFREEPATH(path);
- }
- return (error);
+ return (kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE,
+ CAST_NOCHG(args->uid), CAST_NOCHG(args->gid), 0));
}
int
linux_lchown16(struct thread *td, struct linux_lchown16_args *args)
{
- char *path;
- int error;
- if (!LUSECONVPATH(td) && !SDT_PROBES_ENABLED()) {
- error = kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE,
- CAST_NOCHG(args->uid), CAST_NOCHG(args->gid), AT_SYMLINK_NOFOLLOW);
- } else {
- LCONVPATHEXIST(args->path, &path);
-
- /*
- * The DTrace probes have to be after the LCONVPATHEXIST, as
- * LCONVPATHEXIST may return on its own and we do not want to
- * have a stray entry without the corresponding return.
- */
- LIN_SDT_PROBE1(uid16, linux_lchown16, conv_path, path);
-
- error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE,
- CAST_NOCHG(args->uid), CAST_NOCHG(args->gid), AT_SYMLINK_NOFOLLOW);
- LFREEPATH(path);
- }
- return (error);
+ return (kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE,
+ CAST_NOCHG(args->uid), CAST_NOCHG(args->gid), AT_SYMLINK_NOFOLLOW));
}
int