VOP_LOOKUP.9 (0640e9e01b3e93e057629a848b7870f30427c609) | VOP_LOOKUP.9 (dc7bf98cd1bf496f42b940b88556070376995baf) |
---|---|
1.\" -*- nroff -*- 2.\" 3.\" Copyright (c) 1996 Doug Rabson 4.\" 5.\" All rights reserved. 6.\" 7.\" This program is free software. 8.\" --- 48 unchanged lines hidden (view full) --- 57is a pointer to a componentname structure defined as follows: 58.Bd -literal 59struct componentname { 60 /* 61 * Arguments to lookup. 62 */ 63 u_long cn_nameiop; /* namei operation */ 64 u_long cn_flags; /* flags to namei */ | 1.\" -*- nroff -*- 2.\" 3.\" Copyright (c) 1996 Doug Rabson 4.\" 5.\" All rights reserved. 6.\" 7.\" This program is free software. 8.\" --- 48 unchanged lines hidden (view full) --- 57is a pointer to a componentname structure defined as follows: 58.Bd -literal 59struct componentname { 60 /* 61 * Arguments to lookup. 62 */ 63 u_long cn_nameiop; /* namei operation */ 64 u_long cn_flags; /* flags to namei */ |
65 struct proc *cn_proc; /* process requesting lookup */ | 65 struct thread *cn_thread; /* process requesting lookup */ |
66 struct ucred *cn_cred; /* credentials */ 67 /* 68 * Shared between lookup and commit routines. 69 */ 70 char *cn_pnbuf; /* pathname buffer */ 71 char *cn_nameptr; /* pointer to looked up name */ 72 long cn_namelen; /* length of looked up component */ 73 u_long cn_hash; /* hash value of looked up name */ --- 97 unchanged lines hidden (view full) --- 171 struct vnode *vp = NULL; 172 173 /* 174 * Check accessibility of directory. 175 */ 176 if (dvp->v_type != VDIR) 177 return ENOTDIR; 178 | 66 struct ucred *cn_cred; /* credentials */ 67 /* 68 * Shared between lookup and commit routines. 69 */ 70 char *cn_pnbuf; /* pathname buffer */ 71 char *cn_nameptr; /* pointer to looked up name */ 72 long cn_namelen; /* length of looked up component */ 73 u_long cn_hash; /* hash value of looked up name */ --- 97 unchanged lines hidden (view full) --- 171 struct vnode *vp = NULL; 172 173 /* 174 * Check accessibility of directory. 175 */ 176 if (dvp->v_type != VDIR) 177 return ENOTDIR; 178 |
179 error = VOP_ACCESS(dvp, VEXEC, cred, cnp->cn_proc); | 179 error = VOP_ACCESS(dvp, VEXEC, cred, cnp->cn_thread); |
180 if (error) 181 return (error); 182 183 if (islastcn && (dvp->v_mount->mnt_flag & MNT_RDONLY) && 184 (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) 185 return (EROFS); 186 187 /* --- 103 unchanged lines hidden (view full) --- 291 * which can be used to remove file. If the wantparent flag 292 * isn't set, we return only the directory, otherwise we go on 293 * and lock the inode, being careful with ".". 294 */ 295 if (nameiop == DELETE && islastcn) { 296 /* 297 * Check for write access on directory. 298 */ | 180 if (error) 181 return (error); 182 183 if (islastcn && (dvp->v_mount->mnt_flag & MNT_RDONLY) && 184 (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) 185 return (EROFS); 186 187 /* --- 103 unchanged lines hidden (view full) --- 291 * which can be used to remove file. If the wantparent flag 292 * isn't set, we return only the directory, otherwise we go on 293 * and lock the inode, being careful with ".". 294 */ 295 if (nameiop == DELETE && islastcn) { 296 /* 297 * Check for write access on directory. 298 */ |
299 error = VOP_ACCESS(dvp, VWRITE, cred, cnp->cn_proc); | 299 error = VOP_ACCESS(dvp, VWRITE, cred, cnp->cn_thread); |
300 if (error) 301 return (error); 302 303 if (found entry is same as dvp) { 304 VREF(dvp); 305 *vpp = dvp; 306 return 0; 307 } --- 18 unchanged lines hidden (view full) --- 326 327 /* 328 * If rewriting (RENAME), return the inode and the 329 * information required to rewrite the present directory 330 * Must get inode of directory entry to verify it's a 331 * regular file, or empty directory. 332 */ 333 if (nameiop == RENAME && wantparent && islastcn) { | 300 if (error) 301 return (error); 302 303 if (found entry is same as dvp) { 304 VREF(dvp); 305 *vpp = dvp; 306 return 0; 307 } --- 18 unchanged lines hidden (view full) --- 326 327 /* 328 * If rewriting (RENAME), return the inode and the 329 * information required to rewrite the present directory 330 * Must get inode of directory entry to verify it's a 331 * regular file, or empty directory. 332 */ 333 if (nameiop == RENAME && wantparent && islastcn) { |
334 error = VOP_ACCESS(dvp, VWRITE, cred, cnp->cn_proc); | 334 error = VOP_ACCESS(dvp, VWRITE, cred, cnp->cn_thread); |
335 if (error) 336 return (error); 337 338 /* 339 * Check for "." 340 */ 341 if (found entry is same as dvp) 342 return EISDIR; --- 108 unchanged lines hidden --- | 335 if (error) 336 return (error); 337 338 /* 339 * Check for "." 340 */ 341 if (found entry is same as dvp) 342 return EISDIR; --- 108 unchanged lines hidden --- |