Deleted Added
full compact
vfs_lookup.c (105479) vfs_lookup.c (109623)
1/*
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94
1/*
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94
39 * $FreeBSD: head/sys/kern/vfs_lookup.c 105479 2002-10-19 21:25:51Z rwatson $
39 * $FreeBSD: head/sys/kern/vfs_lookup.c 109623 2003-01-21 08:56:16Z alfred $
40 */
41
42#include "opt_ktrace.h"
43#include "opt_mac.h"
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/kernel.h>

--- 67 unchanged lines hidden (view full) ---

115 ("namei: flags contaminated with nameiops"));
116 fdp = p->p_fd;
117
118 /*
119 * Get a buffer for the name to be translated, and copy the
120 * name into the buffer.
121 */
122 if ((cnp->cn_flags & HASBUF) == 0)
40 */
41
42#include "opt_ktrace.h"
43#include "opt_mac.h"
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/kernel.h>

--- 67 unchanged lines hidden (view full) ---

115 ("namei: flags contaminated with nameiops"));
116 fdp = p->p_fd;
117
118 /*
119 * Get a buffer for the name to be translated, and copy the
120 * name into the buffer.
121 */
122 if ((cnp->cn_flags & HASBUF) == 0)
123 cnp->cn_pnbuf = uma_zalloc(namei_zone, M_WAITOK);
123 cnp->cn_pnbuf = uma_zalloc(namei_zone, 0);
124 if (ndp->ni_segflg == UIO_SYSSPACE)
125 error = copystr(ndp->ni_dirp, cnp->cn_pnbuf,
126 MAXPATHLEN, (size_t *)&ndp->ni_pathlen);
127 else
128 error = copyinstr(ndp->ni_dirp, cnp->cn_pnbuf,
129 MAXPATHLEN, (size_t *)&ndp->ni_pathlen);
130
131 /*

--- 87 unchanged lines hidden (view full) ---

219 if ((cnp->cn_flags & NOMACCHECK) == 0) {
220 error = mac_check_vnode_readlink(td->td_ucred,
221 ndp->ni_vp);
222 if (error)
223 break;
224 }
225#endif
226 if (ndp->ni_pathlen > 1)
124 if (ndp->ni_segflg == UIO_SYSSPACE)
125 error = copystr(ndp->ni_dirp, cnp->cn_pnbuf,
126 MAXPATHLEN, (size_t *)&ndp->ni_pathlen);
127 else
128 error = copyinstr(ndp->ni_dirp, cnp->cn_pnbuf,
129 MAXPATHLEN, (size_t *)&ndp->ni_pathlen);
130
131 /*

--- 87 unchanged lines hidden (view full) ---

219 if ((cnp->cn_flags & NOMACCHECK) == 0) {
220 error = mac_check_vnode_readlink(td->td_ucred,
221 ndp->ni_vp);
222 if (error)
223 break;
224 }
225#endif
226 if (ndp->ni_pathlen > 1)
227 cp = uma_zalloc(namei_zone, M_WAITOK);
227 cp = uma_zalloc(namei_zone, 0);
228 else
229 cp = cnp->cn_pnbuf;
230 aiov.iov_base = cp;
231 aiov.iov_len = MAXPATHLEN;
232 auio.uio_iov = &aiov;
233 auio.uio_iovcnt = 1;
234 auio.uio_offset = 0;
235 auio.uio_rw = UIO_READ;

--- 552 unchanged lines hidden ---
228 else
229 cp = cnp->cn_pnbuf;
230 aiov.iov_base = cp;
231 aiov.iov_len = MAXPATHLEN;
232 auio.uio_iov = &aiov;
233 auio.uio_iovcnt = 1;
234 auio.uio_offset = 0;
235 auio.uio_rw = UIO_READ;

--- 552 unchanged lines hidden ---