From owner-p4-projects@FreeBSD.ORG Sat Nov 8 08:14:45 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4CCA01065678; Sat, 8 Nov 2008 08:14:45 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F8631065670 for ; Sat, 8 Nov 2008 08:14:45 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 002EF8FC17 for ; Sat, 8 Nov 2008 08:14:44 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mA88EiNb033401 for ; Sat, 8 Nov 2008 08:14:44 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mA88Ei0l033399 for perforce@freebsd.org; Sat, 8 Nov 2008 08:14:44 GMT (envelope-from trasz@freebsd.org) Date: Sat, 8 Nov 2008 08:14:44 GMT Message-Id: <200811080814.mA88Ei0l033399@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to trasz@freebsd.org using -f From: Edward Tomasz Napierala To: Perforce Change Reviews Cc: Subject: PERFORCE change 152648 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 08:14:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=152648 Change 152648 by trasz@trasz_traszkan on 2008/11/08 08:13:47 As per discussion with rwatson@ and pjd@, bring back write check on renamed directory in UFS. Affected files ... .. //depot/projects/soc2008/trasz_nfs4acl/sys/ufs/ufs/ufs_vnops.c#23 edit Differences ... ==== //depot/projects/soc2008/trasz_nfs4acl/sys/ufs/ufs/ufs_vnops.c#23 (text+ko) ==== @@ -1198,14 +1198,19 @@ * If ".." must be changed (ie the directory gets a new * parent) then the source directory must not be in the * directory hierarchy above the target, as this would - * orphan everything below the source directory. We must - * repeat the call to namei, as the parent directory - * is unlocked by the call to checkpath(). + * orphan everything below the source directory. Also + * the user must have write permission in the source so + * as to be able to change "..". We must repeat the call + * to namei, as the parent directory is unlocked by the + * call to checkpath(). */ + error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, tcnp->cn_thread); VOP_UNLOCK(fvp, 0); if (oldparent != dp->i_number) newparent = dp->i_number; if (doingdirectory && newparent) { + if (error) /* write access check above */ + goto bad; if (xp != NULL) vput(tvp); error = ufs_checkpath(ip, dp, tcnp->cn_cred);