p4-projects@freebsd.org
[Top] [All Lists]

PERFORCE change 152648 for review

Subject: PERFORCE change 152648 for review
From: Edward Tomasz Napierala
Date: Sat, 8 Nov 2008 08:14:44 GMT
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);
_______________________________________________
p4-projects@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "p4-projects-unsubscribe@xxxxxxxxxxx"

<Prev in Thread] Current Thread [Next in Thread>
  • PERFORCE change 152648 for review, Edward Tomasz Napierala <=