Deleted Added
full compact
vfs_lookup.c (42408) vfs_lookup.c (42453)
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 * $Id: vfs_lookup.c,v 1.29 1999/01/05 18:49:52 eivind Exp $
39 * $Id: vfs_lookup.c,v 1.30 1999/01/08 17:31:16 eivind Exp $
40 */
41
42#include "opt_ktrace.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/namei.h>
47#include <sys/vnode.h>

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

86 struct uio auio;
87 int error, linklen;
88 struct componentname *cnp = &ndp->ni_cnd;
89 struct proc *p = cnp->cn_proc;
90
91 ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_proc->p_ucred;
92 KASSERT(cnp->cn_cred && cnp->cn_proc, ("namei: bad cred/proc"));
93 KASSERT((cnp->cn_nameiop & (~OPMASK)) == 0,
40 */
41
42#include "opt_ktrace.h"
43
44#include <sys/param.h>
45#include <sys/systm.h>
46#include <sys/namei.h>
47#include <sys/vnode.h>

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

86 struct uio auio;
87 int error, linklen;
88 struct componentname *cnp = &ndp->ni_cnd;
89 struct proc *p = cnp->cn_proc;
90
91 ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_proc->p_ucred;
92 KASSERT(cnp->cn_cred && cnp->cn_proc, ("namei: bad cred/proc"));
93 KASSERT((cnp->cn_nameiop & (~OPMASK)) == 0,
94 ("namei: nameiop contaminated with flags"));
94 ("namei: nameiop contaminated with flags"));
95 KASSERT((cnp->cn_flags & OPMASK) == 0,
95 KASSERT((cnp->cn_flags & OPMASK) == 0,
96 ("namei: flags contaminated with nameiops"));
96 ("namei: flags contaminated with nameiops"));
97 fdp = cnp->cn_proc->p_fd;
98
99 /*
100 * Get a buffer for the name to be translated, and copy the
101 * name into the buffer.
102 */
103 if ((cnp->cn_flags & HASBUF) == 0)
104 cnp->cn_pnbuf = zalloc(namei_zone);

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

665 return (0);
666 }
667 dp = *vpp;
668
669 /*
670 * Check for symbolic link
671 */
672 KASSERT(dp->v_type != VLNK || !(cnp->cn_flags & FOLLOW),
97 fdp = cnp->cn_proc->p_fd;
98
99 /*
100 * Get a buffer for the name to be translated, and copy the
101 * name into the buffer.
102 */
103 if ((cnp->cn_flags & HASBUF) == 0)
104 cnp->cn_pnbuf = zalloc(namei_zone);

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

665 return (0);
666 }
667 dp = *vpp;
668
669 /*
670 * Check for symbolic link
671 */
672 KASSERT(dp->v_type != VLNK || !(cnp->cn_flags & FOLLOW),
673 ("relookup: symlink found.\n"));
673 ("relookup: symlink found.\n"));
674
675 /*
676 * Disallow directory write attempts on read-only file systems.
677 */
678 if (rdonly &&
679 (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) {
680 error = EROFS;
681 goto bad2;

--- 25 unchanged lines hidden ---
674
675 /*
676 * Disallow directory write attempts on read-only file systems.
677 */
678 if (rdonly &&
679 (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) {
680 error = EROFS;
681 goto bad2;

--- 25 unchanged lines hidden ---