Whamcloud - gitweb
LU-2463 security: osd_mknod shouldn't alter mode after creation
authorLai Siyao <laisiyao@whamcloud.com>
Thu, 13 Dec 2012 06:38:03 +0000 (14:38 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 15 Dec 2012 06:21:00 +0000 (01:21 -0500)
osd_mknod() calls init_special_inode(), but it should use
inode->i_mode instead of the one from client.

Test-Parameters: envdefinitions=SLOW=yes testlist=posix
Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: Iee0f49dc4beef4aae6b5b6f57679de2643887e25
Reviewed-on: http://review.whamcloud.com/4820
Tested-by: Hudson
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Jian Yu <jian.yu@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c

index 4d1725e..542f4f3 100644 (file)
@@ -1645,7 +1645,8 @@ static int osd_mknod(struct osd_thread_info *info, struct osd_object *obj,
         result = osd_mkfile(info, obj, mode, hint, th);
         if (result == 0) {
                 LASSERT(obj->oo_inode != NULL);
-                init_special_inode(obj->oo_inode, mode, attr->la_rdev);
+                init_special_inode(obj->oo_inode, obj->oo_inode->i_mode,
+                                   attr->la_rdev);
         }
         LINVRNT(osd_invariant(obj));
         return result;