xen: don't drop NX bit
[safe/jmp/linux-2.6] / fs / cifs / dir.c
index 05afe33..fb69c1f 100644 (file)
@@ -260,7 +260,9 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
                                                 buf, inode->i_sb, xid,
                                                 &fileHandle);
                        if (newinode) {
-                               newinode->i_mode = mode;
+                               if (cifs_sb->mnt_cifs_flags &
+                                   CIFS_MOUNT_DYNPERM)
+                                       newinode->i_mode = mode;
                                if ((oplock & CIFS_CREATE_ACTION) &&
                                    (cifs_sb->mnt_cifs_flags &
                                     CIFS_MOUNT_SET_UID)) {
@@ -608,7 +610,7 @@ static int cifs_ci_compare(struct dentry *dentry, struct qstr *a,
                 * case take precedence.  If a is not a negative dentry, this
                 * should have no side effects
                 */
-               memcpy(a->name, b->name, a->len);
+               memcpy((void *)a->name, b->name, a->len);
                return 0;
        }
        return 1;