diff options
author | marius <marius@FreeBSD.org> | 2006-08-24 18:52:28 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2006-08-24 18:52:28 +0000 |
commit | 604b84193c5a9267b648e183dac19af7ef3fc9eb (patch) | |
tree | 47c11eabc997b886e1489f25c7a36e1b9c098192 /sys/kern/vfs_mount.c | |
parent | 1b5c41598b1b79953afc203f1e08638b5ecf6d39 (diff) | |
download | FreeBSD-src-604b84193c5a9267b648e183dac19af7ef3fc9eb.zip FreeBSD-src-604b84193c5a9267b648e183dac19af7ef3fc9eb.tar.gz |
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.
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r-- | sys/kern/vfs_mount.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index cd725ba..546ee26 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -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); } } |