From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750925AbbCTECI (ORCPT ); Fri, 20 Mar 2015 00:02:08 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:34022 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750764AbbCTECF (ORCPT ); Fri, 20 Mar 2015 00:02:05 -0400 From: Taesoo Kim To: ericvh@gmail.com, rminnich@sandia.gov, lucho@ionkov.net, v9fs-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org Cc: taesoo@gatech.edu, changwoo@gatech.edu, sanidhya@gatech.edu, blee@gatech.edu, csong84@gatech.edu, Taesoo Kim Subject: [PATCH 1/1] 9p: correctly check empty xattr key Date: Fri, 20 Mar 2015 00:01:56 -0400 Message-Id: <1426824116-22920-1-git-send-email-tsgatesv@gmail.com> X-Mailer: git-send-email 2.3.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When xattr name (key) is empty (""), correctly return -EINVAL error. Not sure how previous xattr_set_acl() performs with any xattr key for get/set(). Signed-off-by: Taesoo Kim --- fs/9p/acl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/9p/acl.c b/fs/9p/acl.c index 8482f2d..295bf25 100644 --- a/fs/9p/acl.c +++ b/fs/9p/acl.c @@ -237,7 +237,7 @@ static int v9fs_xattr_get_acl(struct dentry *dentry, const char *name, struct posix_acl *acl; int error; - if (strcmp(name, "") != 0) + if (strcmp(name, "") == 0) return -EINVAL; v9ses = v9fs_dentry2v9ses(dentry); @@ -287,7 +287,7 @@ static int v9fs_xattr_set_acl(struct dentry *dentry, const char *name, struct v9fs_session_info *v9ses; struct inode *inode = dentry->d_inode; - if (strcmp(name, "") != 0) + if (strcmp(name, "") == 0) return -EINVAL; v9ses = v9fs_dentry2v9ses(dentry); -- 2.3.3