+ /*
+ * If the parent directory is "sticky", then the user must
+ * own the parent directory, or the destination of the rename,
+ * otherwise the destination may not be changed (except by
+ * root). This implements append-only directories.
+ */
+ if ((dp->i_mode & ISVTX) && u.u_uid != 0 &&
+ u.u_uid != dp->i_uid && xp->i_uid != u.u_uid) {
+ error = EPERM;
+ goto bad;
+ }