Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/ufs/ufs/ufs_lookup.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/ufs/ufs/ufs_lookup.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.73.4.3 retrieving revision 1.74 diff -u -p -r1.73.4.3 -r1.74 --- src/sys/ufs/ufs/ufs_lookup.c 2006/06/01 22:39:44 1.73.4.3 +++ src/sys/ufs/ufs/ufs_lookup.c 2006/03/30 12:40:06 1.74 @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_lookup.c,v 1.73.4.3 2006/06/01 22:39:44 kardel Exp $ */ +/* $NetBSD: ufs_lookup.c,v 1.74 2006/03/30 12:40:06 yamt Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ufs_lookup.c,v 1.73.4.3 2006/06/01 22:39:44 kardel Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ufs_lookup.c,v 1.74 2006/03/30 12:40:06 yamt Exp $"); #ifdef _KERNEL_OPT #include "opt_ffs.h" @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: ufs_lookup.c #include #include #include -#include #include #include @@ -134,7 +133,7 @@ ufs_lookup(void *v) int namlen, error; struct vnode **vpp = ap->a_vpp; struct componentname *cnp = ap->a_cnp; - kauth_cred_t cred = cnp->cn_cred; + struct ucred *cred = cnp->cn_cred; int flags; int nameiop = cnp->cn_nameiop; struct ufsmount *ump = dp->i_ump; @@ -286,7 +285,6 @@ searchloop: * directory. Complete checks can be run by patching * "dirchk" to be true. */ - KASSERT(bp != NULL); ep = (struct direct *)((char *)bp->b_data + entryoffsetinblock); if (ep->d_reclen == 0 || (dirchk && ufs_dirbadentry(vdp, ep, entryoffsetinblock))) { @@ -547,9 +545,9 @@ found: * implements append-only directories. */ if ((dp->i_mode & ISVTX) && - kauth_cred_geteuid(cred) != 0 && - kauth_cred_geteuid(cred) != dp->i_uid && - VTOI(tdp)->i_uid != kauth_cred_geteuid(cred)) { + cred->cr_uid != 0 && + cred->cr_uid != dp->i_uid && + VTOI(tdp)->i_uid != cred->cr_uid) { vput(tdp); return (EPERM); } @@ -758,7 +756,7 @@ int ufs_direnter(struct vnode *dvp, struct vnode *tvp, struct direct *dirp, struct componentname *cnp, struct buf *newdirbp) { - kauth_cred_t cr; + struct ucred *cr; struct lwp *l; int newentrysize; struct inode *dp; @@ -841,7 +839,7 @@ ufs_direnter(struct vnode *dvp, struct v if (softdep_setup_directory_add(bp, dp, dp->i_offset, ufs_rw32(dirp->d_ino, needswap), newdirbp, 1) == 0) { bdwrite(bp); - getnanotime(&ts); + nanotime(&ts); return UFS_UPDATE(dvp, &ts, &ts, UPDATE_DIROP); } /* We have just allocated a directory block in an @@ -859,14 +857,14 @@ ufs_direnter(struct vnode *dvp, struct v return (error); if (tvp != NULL) VOP_UNLOCK(tvp, 0); - error = VOP_FSYNC(dvp, l->l_proc->p_cred, FSYNC_WAIT, 0, 0, l); + error = VOP_FSYNC(dvp, l->l_proc->p_ucred, FSYNC_WAIT, 0, 0, l); if (tvp != 0) vn_lock(tvp, LK_EXCLUSIVE | LK_RETRY); return (error); } else { error = VOP_BWRITE(bp); } - getnanotime(&ts); + nanotime(&ts); ret = UFS_UPDATE(dvp, &ts, &ts, UPDATE_DIROP); if (error == 0) return (ret); @@ -1183,7 +1181,7 @@ ufs_dirrewrite(struct inode *dp, struct * NB: does not handle corrupted directories. */ int -ufs_dirempty(struct inode *ip, ino_t parentino, kauth_cred_t cred) +ufs_dirempty(struct inode *ip, ino_t parentino, struct ucred *cred) { doff_t off; struct dirtemplate dbuf; @@ -1247,7 +1245,7 @@ ufs_dirempty(struct inode *ip, ino_t par * The target is always vput before returning. */ int -ufs_checkpath(struct inode *source, struct inode *target, kauth_cred_t cred) +ufs_checkpath(struct inode *source, struct inode *target, struct ucred *cred) { struct vnode *vp = ITOV(target); int error, rootino, namlen;