Fix a bug introduced with rev. 1.204; in vfs_donmount() use

copyout(9) instead of copystr(9) for copying the errmsg from
kernel- to user-space. This fixes a panic on sparc64 when
using the nmount(2)-converted mountd(8).
While at it, use bcopy(3) instead of strncpy(3) in the kernel-
to kernel-space case for consistency with vfs_buildopts() and
between kernel- to user-space and kernel- to kernel-space case.
This commit is contained in:
marius 2006-08-24 18:52:28 +00:00
parent 1b5c41598b
commit 604b84193c

View File

@ -693,14 +693,13 @@ bail:
if (errmsg_pos != -1 && ((2 * errmsg_pos + 1) < fsoptions->uio_iovcnt)
&& errmsg_len > 0 && errmsg != NULL) {
if (fsoptions->uio_segflg == UIO_SYSSPACE) {
strncpy(fsoptions->uio_iov[2 * errmsg_pos + 1].iov_base,
errmsg,
bcopy(errmsg,
fsoptions->uio_iov[2 * errmsg_pos + 1].iov_base,
fsoptions->uio_iov[2 * errmsg_pos + 1].iov_len);
} else {
copystr(errmsg,
copyout(errmsg,
fsoptions->uio_iov[2 * errmsg_pos + 1].iov_base,
fsoptions->uio_iov[2 * errmsg_pos + 1].iov_len,
NULL);
fsoptions->uio_iov[2 * errmsg_pos + 1].iov_len);
}
}