linux: remove the always curthread argument from lconvpath
This commit is contained in:
parent
b11e6fd75b
commit
af4051d250
@ -111,7 +111,7 @@ linux_execve(struct thread *td, struct linux_execve_args *args)
|
|||||||
error = exec_copyin_args(&eargs, args->path, UIO_USERSPACE,
|
error = exec_copyin_args(&eargs, args->path, UIO_USERSPACE,
|
||||||
args->argp, args->envp);
|
args->argp, args->envp);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp,
|
error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp,
|
||||||
args->envp);
|
args->envp);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
|
@ -134,7 +134,7 @@ linux_execve(struct thread *td, struct linux_execve_args *args)
|
|||||||
char *path;
|
char *path;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
|
|
||||||
error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE,
|
error = freebsd32_exec_copyin_args(&eargs, path, UIO_SYSSPACE,
|
||||||
args->argp, args->envp);
|
args->argp, args->envp);
|
||||||
|
@ -74,7 +74,7 @@ linux_execve(struct thread *td, struct linux_execve_args *uap)
|
|||||||
error = exec_copyin_args(&eargs, uap->path, UIO_USERSPACE,
|
error = exec_copyin_args(&eargs, uap->path, UIO_USERSPACE,
|
||||||
uap->argp, uap->envp);
|
uap->argp, uap->envp);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, uap->path, &path);
|
LCONVPATHEXIST(uap->path, &path);
|
||||||
error = exec_copyin_args(&eargs, path, UIO_SYSSPACE,
|
error = exec_copyin_args(&eargs, path, UIO_SYSSPACE,
|
||||||
uap->argp, uap->envp);
|
uap->argp, uap->envp);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
|
@ -238,9 +238,8 @@ linux_exec_imgact_try(struct image_params *imgp)
|
|||||||
* alternate path is found, use our stringspace to store it.
|
* alternate path is found, use our stringspace to store it.
|
||||||
*/
|
*/
|
||||||
if ((error = exec_shell_imgact(imgp)) == 0) {
|
if ((error = exec_shell_imgact(imgp)) == 0) {
|
||||||
linux_emul_convpath(FIRST_THREAD_IN_PROC(imgp->proc),
|
linux_emul_convpath(imgp->interpreter_name, UIO_SYSSPACE,
|
||||||
imgp->interpreter_name, UIO_SYSSPACE, &rpath, 0,
|
&rpath, 0, AT_FDCWD);
|
||||||
AT_FDCWD);
|
|
||||||
if (rpath != NULL)
|
if (rpath != NULL)
|
||||||
imgp->args->fname_buf =
|
imgp->args->fname_buf =
|
||||||
imgp->interpreter_name = rpath;
|
imgp->interpreter_name = rpath;
|
||||||
|
@ -115,7 +115,7 @@ linux_creat(struct thread *td, struct linux_creat_args *args)
|
|||||||
return (kern_openat(td, AT_FDCWD, args->path, UIO_USERSPACE,
|
return (kern_openat(td, AT_FDCWD, args->path, UIO_USERSPACE,
|
||||||
O_WRONLY | O_CREAT | O_TRUNC, args->mode));
|
O_WRONLY | O_CREAT | O_TRUNC, args->mode));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE,
|
error = kern_openat(td, AT_FDCWD, path, UIO_SYSSPACE,
|
||||||
O_WRONLY | O_CREAT | O_TRUNC, args->mode);
|
O_WRONLY | O_CREAT | O_TRUNC, args->mode);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
@ -234,9 +234,9 @@ linux_openat(struct thread *td, struct linux_openat_args *args)
|
|||||||
args->mode, UIO_USERSPACE));
|
args->mode, UIO_USERSPACE));
|
||||||
}
|
}
|
||||||
if (args->flags & LINUX_O_CREAT)
|
if (args->flags & LINUX_O_CREAT)
|
||||||
LCONVPATH_AT(td, args->filename, &path, 1, dfd);
|
LCONVPATH_AT(args->filename, &path, 1, dfd);
|
||||||
else
|
else
|
||||||
LCONVPATH_AT(td, args->filename, &path, 0, dfd);
|
LCONVPATH_AT(args->filename, &path, 0, dfd);
|
||||||
|
|
||||||
error = linux_common_open(td, dfd, path, args->flags, args->mode,
|
error = linux_common_open(td, dfd, path, args->flags, args->mode,
|
||||||
UIO_SYSSPACE);
|
UIO_SYSSPACE);
|
||||||
@ -256,9 +256,9 @@ linux_open(struct thread *td, struct linux_open_args *args)
|
|||||||
args->mode, UIO_USERSPACE));
|
args->mode, UIO_USERSPACE));
|
||||||
}
|
}
|
||||||
if (args->flags & LINUX_O_CREAT)
|
if (args->flags & LINUX_O_CREAT)
|
||||||
LCONVPATHCREAT(td, args->path, &path);
|
LCONVPATHCREAT(args->path, &path);
|
||||||
else
|
else
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
|
|
||||||
error = linux_common_open(td, AT_FDCWD, path, args->flags, args->mode,
|
error = linux_common_open(td, AT_FDCWD, path, args->flags, args->mode,
|
||||||
UIO_SYSSPACE);
|
UIO_SYSSPACE);
|
||||||
@ -299,7 +299,7 @@ linux_name_to_handle_at(struct thread *td,
|
|||||||
} else {
|
} else {
|
||||||
char *path;
|
char *path;
|
||||||
|
|
||||||
LCONVPATH_AT(td, args->name, &path, 0, fd);
|
LCONVPATH_AT(args->name, &path, 0, fd);
|
||||||
error = kern_getfhat(td, bsd_flags, fd, path, UIO_SYSSPACE,
|
error = kern_getfhat(td, bsd_flags, fd, path, UIO_SYSSPACE,
|
||||||
&fh, UIO_SYSSPACE);
|
&fh, UIO_SYSSPACE);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
@ -665,7 +665,7 @@ linux_access(struct thread *td, struct linux_access_args *args)
|
|||||||
error = kern_accessat(td, AT_FDCWD, args->path, UIO_USERSPACE, 0,
|
error = kern_accessat(td, AT_FDCWD, args->path, UIO_USERSPACE, 0,
|
||||||
args->amode);
|
args->amode);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = kern_accessat(td, AT_FDCWD, path, UIO_SYSSPACE, 0,
|
error = kern_accessat(td, AT_FDCWD, path, UIO_SYSSPACE, 0,
|
||||||
args->amode);
|
args->amode);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
@ -690,7 +690,7 @@ linux_do_accessat(struct thread *td, int ldfd, const char *filename,
|
|||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
error = kern_accessat(td, dfd, filename, UIO_USERSPACE, flags, amode);
|
error = kern_accessat(td, dfd, filename, UIO_USERSPACE, flags, amode);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST_AT(td, filename, &path, dfd);
|
LCONVPATHEXIST_AT(filename, &path, dfd);
|
||||||
error = kern_accessat(td, dfd, path, UIO_SYSSPACE, flags, amode);
|
error = kern_accessat(td, dfd, path, UIO_SYSSPACE, flags, amode);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
}
|
}
|
||||||
@ -747,7 +747,7 @@ linux_unlink(struct thread *td, struct linux_unlink_args *args)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = kern_funlinkat(td, AT_FDCWD, path, FD_NONE, UIO_SYSSPACE, 0, 0);
|
error = kern_funlinkat(td, AT_FDCWD, path, FD_NONE, UIO_SYSSPACE, 0, 0);
|
||||||
if (error == EPERM) {
|
if (error == EPERM) {
|
||||||
/* Introduce POSIX noncompliant behaviour of Linux */
|
/* Introduce POSIX noncompliant behaviour of Linux */
|
||||||
@ -797,7 +797,7 @@ linux_unlinkat(struct thread *td, struct linux_unlinkat_args *args)
|
|||||||
return (linux_unlinkat_impl(td, UIO_USERSPACE, args->pathname,
|
return (linux_unlinkat_impl(td, UIO_USERSPACE, args->pathname,
|
||||||
dfd, args));
|
dfd, args));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST_AT(td, args->pathname, &path, dfd);
|
LCONVPATHEXIST_AT(args->pathname, &path, dfd);
|
||||||
error = linux_unlinkat_impl(td, UIO_SYSSPACE, path, dfd, args);
|
error = linux_unlinkat_impl(td, UIO_SYSSPACE, path, dfd, args);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -811,7 +811,7 @@ linux_chdir(struct thread *td, struct linux_chdir_args *args)
|
|||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
return (kern_chdir(td, args->path, UIO_USERSPACE));
|
return (kern_chdir(td, args->path, UIO_USERSPACE));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = kern_chdir(td, path, UIO_SYSSPACE);
|
error = kern_chdir(td, path, UIO_SYSSPACE);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -828,7 +828,7 @@ linux_chmod(struct thread *td, struct linux_chmod_args *args)
|
|||||||
return (kern_fchmodat(td, AT_FDCWD, args->path, UIO_USERSPACE,
|
return (kern_fchmodat(td, AT_FDCWD, args->path, UIO_USERSPACE,
|
||||||
args->mode, 0));
|
args->mode, 0));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = kern_fchmodat(td, AT_FDCWD, path, UIO_SYSSPACE, args->mode, 0);
|
error = kern_fchmodat(td, AT_FDCWD, path, UIO_SYSSPACE, args->mode, 0);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -846,7 +846,7 @@ linux_fchmodat(struct thread *td, struct linux_fchmodat_args *args)
|
|||||||
return (kern_fchmodat(td, dfd, args->filename, UIO_USERSPACE,
|
return (kern_fchmodat(td, dfd, args->filename, UIO_USERSPACE,
|
||||||
args->mode, 0));
|
args->mode, 0));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST_AT(td, args->filename, &path, dfd);
|
LCONVPATHEXIST_AT(args->filename, &path, dfd);
|
||||||
error = kern_fchmodat(td, dfd, path, UIO_SYSSPACE, args->mode, 0);
|
error = kern_fchmodat(td, dfd, path, UIO_SYSSPACE, args->mode, 0);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -862,7 +862,7 @@ linux_mkdir(struct thread *td, struct linux_mkdir_args *args)
|
|||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
return (kern_mkdirat(td, AT_FDCWD, args->path, UIO_USERSPACE, args->mode));
|
return (kern_mkdirat(td, AT_FDCWD, args->path, UIO_USERSPACE, args->mode));
|
||||||
}
|
}
|
||||||
LCONVPATHCREAT(td, args->path, &path);
|
LCONVPATHCREAT(args->path, &path);
|
||||||
error = kern_mkdirat(td, AT_FDCWD, path, UIO_SYSSPACE, args->mode);
|
error = kern_mkdirat(td, AT_FDCWD, path, UIO_SYSSPACE, args->mode);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -879,7 +879,7 @@ linux_mkdirat(struct thread *td, struct linux_mkdirat_args *args)
|
|||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
return (kern_mkdirat(td, dfd, args->pathname, UIO_USERSPACE, args->mode));
|
return (kern_mkdirat(td, dfd, args->pathname, UIO_USERSPACE, args->mode));
|
||||||
}
|
}
|
||||||
LCONVPATHCREAT_AT(td, args->pathname, &path, dfd);
|
LCONVPATHCREAT_AT(args->pathname, &path, dfd);
|
||||||
error = kern_mkdirat(td, dfd, path, UIO_SYSSPACE, args->mode);
|
error = kern_mkdirat(td, dfd, path, UIO_SYSSPACE, args->mode);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -896,7 +896,7 @@ linux_rmdir(struct thread *td, struct linux_rmdir_args *args)
|
|||||||
return (kern_frmdirat(td, AT_FDCWD, args->path, FD_NONE,
|
return (kern_frmdirat(td, AT_FDCWD, args->path, FD_NONE,
|
||||||
UIO_USERSPACE, 0));
|
UIO_USERSPACE, 0));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = kern_frmdirat(td, AT_FDCWD, path, FD_NONE, UIO_SYSSPACE, 0);
|
error = kern_frmdirat(td, AT_FDCWD, path, FD_NONE, UIO_SYSSPACE, 0);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -912,9 +912,9 @@ linux_rename(struct thread *td, struct linux_rename_args *args)
|
|||||||
return (kern_renameat(td, AT_FDCWD, args->from, AT_FDCWD,
|
return (kern_renameat(td, AT_FDCWD, args->from, AT_FDCWD,
|
||||||
args->to, UIO_USERSPACE));
|
args->to, UIO_USERSPACE));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->from, &from);
|
LCONVPATHEXIST(args->from, &from);
|
||||||
/* Expand LCONVPATHCREATE so that `from' can be freed on errors */
|
/* Expand LCONVPATHCREATE so that `from' can be freed on errors */
|
||||||
error = linux_emul_convpath(td, args->to, UIO_USERSPACE, &to, 1, AT_FDCWD);
|
error = linux_emul_convpath(args->to, UIO_USERSPACE, &to, 1, AT_FDCWD);
|
||||||
if (to == NULL) {
|
if (to == NULL) {
|
||||||
LFREEPATH(from);
|
LFREEPATH(from);
|
||||||
return (error);
|
return (error);
|
||||||
@ -973,9 +973,9 @@ linux_renameat2(struct thread *td, struct linux_renameat2_args *args)
|
|||||||
return (kern_renameat(td, olddfd, args->oldname, newdfd,
|
return (kern_renameat(td, olddfd, args->oldname, newdfd,
|
||||||
args->newname, UIO_USERSPACE));
|
args->newname, UIO_USERSPACE));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST_AT(td, args->oldname, &from, olddfd);
|
LCONVPATHEXIST_AT(args->oldname, &from, olddfd);
|
||||||
/* Expand LCONVPATHCREATE so that `from' can be freed on errors */
|
/* Expand LCONVPATHCREATE so that `from' can be freed on errors */
|
||||||
error = linux_emul_convpath(td, args->newname, UIO_USERSPACE, &to, 1, newdfd);
|
error = linux_emul_convpath(args->newname, UIO_USERSPACE, &to, 1, newdfd);
|
||||||
if (to == NULL) {
|
if (to == NULL) {
|
||||||
LFREEPATH(from);
|
LFREEPATH(from);
|
||||||
return (error);
|
return (error);
|
||||||
@ -997,9 +997,9 @@ linux_symlink(struct thread *td, struct linux_symlink_args *args)
|
|||||||
return (kern_symlinkat(td, args->path, AT_FDCWD, args->to,
|
return (kern_symlinkat(td, args->path, AT_FDCWD, args->to,
|
||||||
UIO_USERSPACE));
|
UIO_USERSPACE));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
/* Expand LCONVPATHCREATE so that `path' can be freed on errors */
|
/* Expand LCONVPATHCREATE so that `path' can be freed on errors */
|
||||||
error = linux_emul_convpath(td, args->to, UIO_USERSPACE, &to, 1, AT_FDCWD);
|
error = linux_emul_convpath(args->to, UIO_USERSPACE, &to, 1, AT_FDCWD);
|
||||||
if (to == NULL) {
|
if (to == NULL) {
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -1022,9 +1022,9 @@ linux_symlinkat(struct thread *td, struct linux_symlinkat_args *args)
|
|||||||
return (kern_symlinkat(td, args->oldname, dfd, args->newname,
|
return (kern_symlinkat(td, args->oldname, dfd, args->newname,
|
||||||
UIO_USERSPACE));
|
UIO_USERSPACE));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->oldname, &path);
|
LCONVPATHEXIST(args->oldname, &path);
|
||||||
/* Expand LCONVPATHCREATE so that `path' can be freed on errors */
|
/* Expand LCONVPATHCREATE so that `path' can be freed on errors */
|
||||||
error = linux_emul_convpath(td, args->newname, UIO_USERSPACE, &to, 1, dfd);
|
error = linux_emul_convpath(args->newname, UIO_USERSPACE, &to, 1, dfd);
|
||||||
if (to == NULL) {
|
if (to == NULL) {
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -1046,7 +1046,7 @@ linux_readlink(struct thread *td, struct linux_readlink_args *args)
|
|||||||
return (kern_readlinkat(td, AT_FDCWD, args->name, UIO_USERSPACE,
|
return (kern_readlinkat(td, AT_FDCWD, args->name, UIO_USERSPACE,
|
||||||
args->buf, UIO_USERSPACE, args->count));
|
args->buf, UIO_USERSPACE, args->count));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->name, &name);
|
LCONVPATHEXIST(args->name, &name);
|
||||||
error = kern_readlinkat(td, AT_FDCWD, name, UIO_SYSSPACE,
|
error = kern_readlinkat(td, AT_FDCWD, name, UIO_SYSSPACE,
|
||||||
args->buf, UIO_USERSPACE, args->count);
|
args->buf, UIO_USERSPACE, args->count);
|
||||||
LFREEPATH(name);
|
LFREEPATH(name);
|
||||||
@ -1065,7 +1065,7 @@ linux_readlinkat(struct thread *td, struct linux_readlinkat_args *args)
|
|||||||
return (kern_readlinkat(td, dfd, args->path, UIO_USERSPACE,
|
return (kern_readlinkat(td, dfd, args->path, UIO_USERSPACE,
|
||||||
args->buf, UIO_USERSPACE, args->bufsiz));
|
args->buf, UIO_USERSPACE, args->bufsiz));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST_AT(td, args->path, &name, dfd);
|
LCONVPATHEXIST_AT(args->path, &name, dfd);
|
||||||
error = kern_readlinkat(td, dfd, name, UIO_SYSSPACE, args->buf,
|
error = kern_readlinkat(td, dfd, name, UIO_SYSSPACE, args->buf,
|
||||||
UIO_USERSPACE, args->bufsiz);
|
UIO_USERSPACE, args->bufsiz);
|
||||||
LFREEPATH(name);
|
LFREEPATH(name);
|
||||||
@ -1081,7 +1081,7 @@ linux_truncate(struct thread *td, struct linux_truncate_args *args)
|
|||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
return (kern_truncate(td, args->path, UIO_USERSPACE, args->length));
|
return (kern_truncate(td, args->path, UIO_USERSPACE, args->length));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = kern_truncate(td, path, UIO_SYSSPACE, args->length);
|
error = kern_truncate(td, path, UIO_SYSSPACE, args->length);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -1104,7 +1104,7 @@ linux_truncate64(struct thread *td, struct linux_truncate64_args *args)
|
|||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
return (kern_truncate(td, args->path, UIO_USERSPACE, length));
|
return (kern_truncate(td, args->path, UIO_USERSPACE, length));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = kern_truncate(td, path, UIO_SYSSPACE, length);
|
error = kern_truncate(td, path, UIO_SYSSPACE, length);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -1145,9 +1145,9 @@ linux_link(struct thread *td, struct linux_link_args *args)
|
|||||||
return (kern_linkat(td, AT_FDCWD, AT_FDCWD, args->path, args->to,
|
return (kern_linkat(td, AT_FDCWD, AT_FDCWD, args->path, args->to,
|
||||||
UIO_USERSPACE, AT_SYMLINK_FOLLOW));
|
UIO_USERSPACE, AT_SYMLINK_FOLLOW));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
/* Expand LCONVPATHCREATE so that `path' can be freed on errors */
|
/* Expand LCONVPATHCREATE so that `path' can be freed on errors */
|
||||||
error = linux_emul_convpath(td, args->to, UIO_USERSPACE, &to, 1, AT_FDCWD);
|
error = linux_emul_convpath(args->to, UIO_USERSPACE, &to, 1, AT_FDCWD);
|
||||||
if (to == NULL) {
|
if (to == NULL) {
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -1179,9 +1179,9 @@ linux_linkat(struct thread *td, struct linux_linkat_args *args)
|
|||||||
return (kern_linkat(td, olddfd, newdfd, args->oldname,
|
return (kern_linkat(td, olddfd, newdfd, args->oldname,
|
||||||
args->newname, UIO_USERSPACE, flag));
|
args->newname, UIO_USERSPACE, flag));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST_AT(td, args->oldname, &path, olddfd);
|
LCONVPATHEXIST_AT(args->oldname, &path, olddfd);
|
||||||
/* Expand LCONVPATHCREATE so that `path' can be freed on errors */
|
/* Expand LCONVPATHCREATE so that `path' can be freed on errors */
|
||||||
error = linux_emul_convpath(td, args->newname, UIO_USERSPACE, &to, 1, newdfd);
|
error = linux_emul_convpath(args->newname, UIO_USERSPACE, &to, 1, newdfd);
|
||||||
if (to == NULL) {
|
if (to == NULL) {
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
return (error);
|
return (error);
|
||||||
@ -1775,7 +1775,7 @@ linux_chown(struct thread *td, struct linux_chown_args *args)
|
|||||||
return (kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE,
|
return (kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE,
|
||||||
args->uid, args->gid, 0));
|
args->uid, args->gid, 0));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE, args->uid,
|
error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE, args->uid,
|
||||||
args->gid, 0);
|
args->gid, 0);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
@ -1805,7 +1805,7 @@ linux_fchownat(struct thread *td, struct linux_fchownat_args *args)
|
|||||||
return (kern_fchownat(td, dfd, args->filename, UIO_USERSPACE,
|
return (kern_fchownat(td, dfd, args->filename, UIO_USERSPACE,
|
||||||
args->uid, args->gid, flag));
|
args->uid, args->gid, flag));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST_AT(td, args->filename, &path, dfd);
|
LCONVPATHEXIST_AT(args->filename, &path, dfd);
|
||||||
error = kern_fchownat(td, dfd, path, UIO_SYSSPACE, args->uid, args->gid,
|
error = kern_fchownat(td, dfd, path, UIO_SYSSPACE, args->uid, args->gid,
|
||||||
flag);
|
flag);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
@ -1823,7 +1823,7 @@ linux_lchown(struct thread *td, struct linux_lchown_args *args)
|
|||||||
return (kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE, args->uid,
|
return (kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE, args->uid,
|
||||||
args->gid, AT_SYMLINK_NOFOLLOW));
|
args->gid, AT_SYMLINK_NOFOLLOW));
|
||||||
}
|
}
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE, args->uid, args->gid,
|
error = kern_fchownat(td, AT_FDCWD, path, UIO_SYSSPACE, args->uid, args->gid,
|
||||||
AT_SYMLINK_NOFOLLOW);
|
AT_SYMLINK_NOFOLLOW);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
|
@ -279,7 +279,7 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args)
|
|||||||
UIO_USERSPACE, args->library, td);
|
UIO_USERSPACE, args->library, td);
|
||||||
error = namei(&ni);
|
error = namei(&ni);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->library, &library);
|
LCONVPATHEXIST(args->library, &library);
|
||||||
NDINIT(&ni, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | AUDITVNODE1,
|
NDINIT(&ni, LOOKUP, ISOPEN | FOLLOW | LOCKLEAF | AUDITVNODE1,
|
||||||
UIO_SYSSPACE, library, td);
|
UIO_SYSSPACE, library, td);
|
||||||
error = namei(&ni);
|
error = namei(&ni);
|
||||||
@ -759,7 +759,7 @@ linux_utime(struct thread *td, struct linux_utime_args *args)
|
|||||||
error = kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE,
|
error = kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE,
|
||||||
tvp, UIO_SYSSPACE);
|
tvp, UIO_SYSSPACE);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->fname, &fname);
|
LCONVPATHEXIST(args->fname, &fname);
|
||||||
error = kern_utimesat(td, AT_FDCWD, fname, UIO_SYSSPACE, tvp,
|
error = kern_utimesat(td, AT_FDCWD, fname, UIO_SYSSPACE, tvp,
|
||||||
UIO_SYSSPACE);
|
UIO_SYSSPACE);
|
||||||
LFREEPATH(fname);
|
LFREEPATH(fname);
|
||||||
@ -791,7 +791,7 @@ linux_utimes(struct thread *td, struct linux_utimes_args *args)
|
|||||||
error = kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE,
|
error = kern_utimesat(td, AT_FDCWD, args->fname, UIO_USERSPACE,
|
||||||
tvp, UIO_SYSSPACE);
|
tvp, UIO_SYSSPACE);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->fname, &fname);
|
LCONVPATHEXIST(args->fname, &fname);
|
||||||
error = kern_utimesat(td, AT_FDCWD, fname, UIO_SYSSPACE,
|
error = kern_utimesat(td, AT_FDCWD, fname, UIO_SYSSPACE,
|
||||||
tvp, UIO_SYSSPACE);
|
tvp, UIO_SYSSPACE);
|
||||||
LFREEPATH(fname);
|
LFREEPATH(fname);
|
||||||
@ -859,7 +859,7 @@ linux_common_utimensat(struct thread *td, int ldfd, const char *pathname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pathname != NULL)
|
if (pathname != NULL)
|
||||||
LCONVPATHEXIST_AT(td, pathname, &path, dfd);
|
LCONVPATHEXIST_AT(pathname, &path, dfd);
|
||||||
else if (lflags != 0)
|
else if (lflags != 0)
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
|
|
||||||
@ -978,7 +978,7 @@ linux_futimesat(struct thread *td, struct linux_futimesat_args *args)
|
|||||||
error = kern_utimesat(td, dfd, args->filename, UIO_USERSPACE,
|
error = kern_utimesat(td, dfd, args->filename, UIO_USERSPACE,
|
||||||
tvp, UIO_SYSSPACE);
|
tvp, UIO_SYSSPACE);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST_AT(td, args->filename, &fname, dfd);
|
LCONVPATHEXIST_AT(args->filename, &fname, dfd);
|
||||||
error = kern_utimesat(td, dfd, fname, UIO_SYSSPACE,
|
error = kern_utimesat(td, dfd, fname, UIO_SYSSPACE,
|
||||||
tvp, UIO_SYSSPACE);
|
tvp, UIO_SYSSPACE);
|
||||||
LFREEPATH(fname);
|
LFREEPATH(fname);
|
||||||
@ -1152,7 +1152,7 @@ linux_mknod(struct thread *td, struct linux_mknod_args *args)
|
|||||||
path = args->path;
|
path = args->path;
|
||||||
seg = UIO_USERSPACE;
|
seg = UIO_USERSPACE;
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHCREAT(td, args->path, &path);
|
LCONVPATHCREAT(args->path, &path);
|
||||||
seg = UIO_SYSSPACE;
|
seg = UIO_SYSSPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1208,7 +1208,7 @@ linux_mknodat(struct thread *td, struct linux_mknodat_args *args)
|
|||||||
path = __DECONST(char *, args->filename);
|
path = __DECONST(char *, args->filename);
|
||||||
seg = UIO_USERSPACE;
|
seg = UIO_USERSPACE;
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHCREAT_AT(td, args->filename, &path, dfd);
|
LCONVPATHCREAT_AT(args->filename, &path, dfd);
|
||||||
seg = UIO_SYSSPACE;
|
seg = UIO_SYSSPACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ linux_newstat(struct thread *td, struct linux_newstat_args *args)
|
|||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
error = linux_kern_stat(td, args->path, UIO_USERSPACE, &buf);
|
error = linux_kern_stat(td, args->path, UIO_USERSPACE, &buf);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = linux_kern_stat(td, path, UIO_SYSSPACE, &buf);
|
error = linux_kern_stat(td, path, UIO_SYSSPACE, &buf);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ linux_newlstat(struct thread *td, struct linux_newlstat_args *args)
|
|||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
error = linux_kern_lstat(td, args->path, UIO_USERSPACE, &sb);
|
error = linux_kern_lstat(td, args->path, UIO_USERSPACE, &sb);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = linux_kern_lstat(td, path, UIO_SYSSPACE, &sb);
|
error = linux_kern_lstat(td, path, UIO_SYSSPACE, &sb);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
}
|
}
|
||||||
@ -323,7 +323,7 @@ linux_stat(struct thread *td, struct linux_stat_args *args)
|
|||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
error = linux_kern_stat(td, args->path, UIO_USERSPACE, &buf);
|
error = linux_kern_stat(td, args->path, UIO_USERSPACE, &buf);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = linux_kern_stat(td, path, UIO_SYSSPACE, &buf);
|
error = linux_kern_stat(td, path, UIO_SYSSPACE, &buf);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
}
|
}
|
||||||
@ -343,7 +343,7 @@ linux_lstat(struct thread *td, struct linux_lstat_args *args)
|
|||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
error = linux_kern_lstat(td, args->path, UIO_USERSPACE, &buf);
|
error = linux_kern_lstat(td, args->path, UIO_USERSPACE, &buf);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
error = linux_kern_lstat(td, path, UIO_SYSSPACE, &buf);
|
error = linux_kern_lstat(td, path, UIO_SYSSPACE, &buf);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
}
|
}
|
||||||
@ -455,7 +455,7 @@ linux_statfs(struct thread *td, struct linux_statfs_args *args)
|
|||||||
bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
|
bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
|
||||||
error = kern_statfs(td, args->path, UIO_USERSPACE, bsd_statfs);
|
error = kern_statfs(td, args->path, UIO_USERSPACE, bsd_statfs);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
|
bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
|
||||||
error = kern_statfs(td, path, UIO_SYSSPACE, bsd_statfs);
|
error = kern_statfs(td, path, UIO_SYSSPACE, bsd_statfs);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
@ -503,7 +503,7 @@ linux_statfs64(struct thread *td, struct linux_statfs64_args *args)
|
|||||||
bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
|
bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
|
||||||
error = kern_statfs(td, args->path, UIO_USERSPACE, bsd_statfs);
|
error = kern_statfs(td, args->path, UIO_USERSPACE, bsd_statfs);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
|
bsd_statfs = malloc(sizeof(struct statfs), M_STATFS, M_WAITOK);
|
||||||
error = kern_statfs(td, path, UIO_SYSSPACE, bsd_statfs);
|
error = kern_statfs(td, path, UIO_SYSSPACE, bsd_statfs);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
@ -617,7 +617,7 @@ linux_stat64(struct thread *td, struct linux_stat64_args *args)
|
|||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
error = linux_kern_stat(td, args->filename, UIO_USERSPACE, &buf);
|
error = linux_kern_stat(td, args->filename, UIO_USERSPACE, &buf);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->filename, &filename);
|
LCONVPATHEXIST(args->filename, &filename);
|
||||||
error = linux_kern_stat(td, filename, UIO_SYSSPACE, &buf);
|
error = linux_kern_stat(td, filename, UIO_SYSSPACE, &buf);
|
||||||
LFREEPATH(filename);
|
LFREEPATH(filename);
|
||||||
}
|
}
|
||||||
@ -636,7 +636,7 @@ linux_lstat64(struct thread *td, struct linux_lstat64_args *args)
|
|||||||
if (!LUSECONVPATH(td)) {
|
if (!LUSECONVPATH(td)) {
|
||||||
error = linux_kern_lstat(td, args->filename, UIO_USERSPACE, &sb);
|
error = linux_kern_lstat(td, args->filename, UIO_USERSPACE, &sb);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->filename, &filename);
|
LCONVPATHEXIST(args->filename, &filename);
|
||||||
error = linux_kern_lstat(td, filename, UIO_SYSSPACE, &sb);
|
error = linux_kern_lstat(td, filename, UIO_SYSSPACE, &sb);
|
||||||
LFREEPATH(filename);
|
LFREEPATH(filename);
|
||||||
}
|
}
|
||||||
@ -681,7 +681,7 @@ linux_fstatat64(struct thread *td, struct linux_fstatat64_args *args)
|
|||||||
error = linux_kern_statat(td, flag, dfd, args->pathname,
|
error = linux_kern_statat(td, flag, dfd, args->pathname,
|
||||||
UIO_USERSPACE, &buf);
|
UIO_USERSPACE, &buf);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST_AT(td, args->pathname, &path, dfd);
|
LCONVPATHEXIST_AT(args->pathname, &path, dfd);
|
||||||
error = linux_kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf);
|
error = linux_kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
}
|
}
|
||||||
@ -716,7 +716,7 @@ linux_newfstatat(struct thread *td, struct linux_newfstatat_args *args)
|
|||||||
error = linux_kern_statat(td, flag, dfd, args->pathname,
|
error = linux_kern_statat(td, flag, dfd, args->pathname,
|
||||||
UIO_USERSPACE, &buf);
|
UIO_USERSPACE, &buf);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST_AT(td, args->pathname, &path, dfd);
|
LCONVPATHEXIST_AT(args->pathname, &path, dfd);
|
||||||
error = linux_kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf);
|
error = linux_kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
}
|
}
|
||||||
@ -790,7 +790,7 @@ linux_statx(struct thread *td, struct linux_statx_args *args)
|
|||||||
error = linux_kern_statat(td, flags, dirfd, args->pathname,
|
error = linux_kern_statat(td, flags, dirfd, args->pathname,
|
||||||
UIO_USERSPACE, &buf);
|
UIO_USERSPACE, &buf);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST_AT(td, args->pathname, &path, dirfd);
|
LCONVPATHEXIST_AT(args->pathname, &path, dirfd);
|
||||||
error = linux_kern_statat(td, flags, dirfd, path, UIO_SYSSPACE, &buf);
|
error = linux_kern_statat(td, flags, dirfd, path, UIO_SYSSPACE, &buf);
|
||||||
LFREEPATH(path);
|
LFREEPATH(path);
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ linux_chown16(struct thread *td, struct linux_chown16_args *args)
|
|||||||
error = kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE,
|
error = kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE,
|
||||||
CAST_NOCHG(args->uid), CAST_NOCHG(args->gid), 0);
|
CAST_NOCHG(args->uid), CAST_NOCHG(args->gid), 0);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
/*
|
/*
|
||||||
* The DTrace probes have to be after the LCONVPATHEXIST, as
|
* The DTrace probes have to be after the LCONVPATHEXIST, as
|
||||||
* LCONVPATHEXIST may return on its own and we do not want to
|
* LCONVPATHEXIST may return on its own and we do not want to
|
||||||
@ -109,7 +109,7 @@ linux_lchown16(struct thread *td, struct linux_lchown16_args *args)
|
|||||||
error = kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE,
|
error = kern_fchownat(td, AT_FDCWD, args->path, UIO_USERSPACE,
|
||||||
CAST_NOCHG(args->uid), CAST_NOCHG(args->gid), AT_SYMLINK_NOFOLLOW);
|
CAST_NOCHG(args->uid), CAST_NOCHG(args->gid), AT_SYMLINK_NOFOLLOW);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->path, &path);
|
LCONVPATHEXIST(args->path, &path);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The DTrace probes have to be after the LCONVPATHEXIST, as
|
* The DTrace probes have to be after the LCONVPATHEXIST, as
|
||||||
|
@ -90,12 +90,12 @@ SYSCTL_STRING(_compat_linux, OID_AUTO, emul_path, CTLFLAG_RWTUN,
|
|||||||
* named file, i.e. we check if the directory it should be in exists.
|
* named file, i.e. we check if the directory it should be in exists.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
linux_emul_convpath(struct thread *td, const char *path, enum uio_seg pathseg,
|
linux_emul_convpath(const char *path, enum uio_seg pathseg,
|
||||||
char **pbuf, int cflag, int dfd)
|
char **pbuf, int cflag, int dfd)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
retval = kern_alternate_path(td, linux_emul_path, path, pathseg, pbuf,
|
retval = kern_alternate_path(curthread, linux_emul_path, path, pathseg, pbuf,
|
||||||
cflag, dfd);
|
cflag, dfd);
|
||||||
|
|
||||||
return (retval);
|
return (retval);
|
||||||
|
@ -51,27 +51,27 @@ MALLOC_DECLARE(M_EPOLL);
|
|||||||
extern char linux_emul_path[];
|
extern char linux_emul_path[];
|
||||||
extern int linux_use_emul_path;
|
extern int linux_use_emul_path;
|
||||||
|
|
||||||
int linux_emul_convpath(struct thread *, const char *, enum uio_seg, char **, int, int);
|
int linux_emul_convpath(const char *, enum uio_seg, char **, int, int);
|
||||||
|
|
||||||
#define LUSECONVPATH(td) atomic_load_int(&linux_use_emul_path)
|
#define LUSECONVPATH(td) atomic_load_int(&linux_use_emul_path)
|
||||||
|
|
||||||
#define LCONVPATH_AT(td, upath, pathp, i, dfd) \
|
#define LCONVPATH_AT(upath, pathp, i, dfd) \
|
||||||
do { \
|
do { \
|
||||||
int _error; \
|
int _error; \
|
||||||
\
|
\
|
||||||
_error = linux_emul_convpath(td, upath, UIO_USERSPACE, \
|
_error = linux_emul_convpath(upath, UIO_USERSPACE, \
|
||||||
pathp, i, dfd); \
|
pathp, i, dfd); \
|
||||||
if (*(pathp) == NULL) \
|
if (*(pathp) == NULL) \
|
||||||
return (_error); \
|
return (_error); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define LCONVPATH(td, upath, pathp, i) \
|
#define LCONVPATH(upath, pathp, i) \
|
||||||
LCONVPATH_AT(td, upath, pathp, i, AT_FDCWD)
|
LCONVPATH_AT(upath, pathp, i, AT_FDCWD)
|
||||||
|
|
||||||
#define LCONVPATHEXIST(td, upath, pathp) LCONVPATH(td, upath, pathp, 0)
|
#define LCONVPATHEXIST(upath, pathp) LCONVPATH(upath, pathp, 0)
|
||||||
#define LCONVPATHEXIST_AT(td, upath, pathp, dfd) LCONVPATH_AT(td, upath, pathp, 0, dfd)
|
#define LCONVPATHEXIST_AT(upath, pathp, dfd) LCONVPATH_AT(upath, pathp, 0, dfd)
|
||||||
#define LCONVPATHCREAT(td, upath, pathp) LCONVPATH(td, upath, pathp, 1)
|
#define LCONVPATHCREAT(upath, pathp) LCONVPATH(upath, pathp, 1)
|
||||||
#define LCONVPATHCREAT_AT(td, upath, pathp, dfd) LCONVPATH_AT(td, upath, pathp, 1, dfd)
|
#define LCONVPATHCREAT_AT(upath, pathp, dfd) LCONVPATH_AT(upath, pathp, 1, dfd)
|
||||||
#define LFREEPATH(path) free(path, M_TEMP)
|
#define LFREEPATH(path) free(path, M_TEMP)
|
||||||
|
|
||||||
#define DUMMY(s) \
|
#define DUMMY(s) \
|
||||||
|
@ -108,7 +108,7 @@ linux_execve(struct thread *td, struct linux_execve_args *args)
|
|||||||
error = exec_copyin_args(&eargs, args->path, UIO_USERSPACE,
|
error = exec_copyin_args(&eargs, args->path, UIO_USERSPACE,
|
||||||
args->argp, args->envp);
|
args->argp, args->envp);
|
||||||
} else {
|
} else {
|
||||||
LCONVPATHEXIST(td, args->path, &newpath);
|
LCONVPATHEXIST(args->path, &newpath);
|
||||||
error = exec_copyin_args(&eargs, newpath, UIO_SYSSPACE,
|
error = exec_copyin_args(&eargs, newpath, UIO_SYSSPACE,
|
||||||
args->argp, args->envp);
|
args->argp, args->envp);
|
||||||
LFREEPATH(newpath);
|
LFREEPATH(newpath);
|
||||||
|
Loading…
Reference in New Issue
Block a user