Fix symlinkat() which use the newdfd argument to look up the old path,

while it should use it for the new path instead.

Reported by:	trasz@
MFC after:	1 month
This commit is contained in:
Dmitry Chagin 2017-04-30 05:56:57 +00:00
parent 07ff474a68
commit c4f2941e0b

View File

@ -826,7 +826,7 @@ linux_symlinkat(struct thread *td, struct linux_symlinkat_args *args)
int error, dfd;
dfd = (args->newdfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->newdfd;
LCONVPATHEXIST_AT(td, args->oldname, &path, dfd);
LCONVPATHEXIST(td, args->oldname, &path);
/* Expand LCONVPATHCREATE so that `path' can be freed on errors */
error = linux_emul_convpath(td, args->newname, UIO_USERSPACE, &to, 1, dfd);
if (to == NULL) {