All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] 9p: correctly check empty xattr key
@ 2015-03-20  4:01 Taesoo Kim
  2015-03-23 14:54 ` Aneesh Kumar K.V
  0 siblings, 1 reply; 2+ messages in thread
From: Taesoo Kim @ 2015-03-20  4:01 UTC (permalink / raw)
  To: ericvh, rminnich, lucho, v9fs-developer, linux-kernel
  Cc: taesoo, changwoo, sanidhya, blee, csong84, Taesoo Kim

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 <tsgatesv@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] 9p: correctly check empty xattr key
  2015-03-20  4:01 [PATCH 1/1] 9p: correctly check empty xattr key Taesoo Kim
@ 2015-03-23 14:54 ` Aneesh Kumar K.V
  0 siblings, 0 replies; 2+ messages in thread
From: Aneesh Kumar K.V @ 2015-03-23 14:54 UTC (permalink / raw)
  To: Taesoo Kim, ericvh, rminnich, lucho, v9fs-developer, linux-kernel
  Cc: taesoo, changwoo, sanidhya, blee, csong84, Taesoo Kim

Taesoo Kim <tsgatesv@gmail.com> writes:

> 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().

Did you test this ?

>
> Signed-off-by: Taesoo Kim <tsgatesv@gmail.com>
> ---
>  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;

We get the name in get_acl callback after xattr_resolve_name. ie, the
value of name is

name = strcmp_prefix(passed_name, "system.posix_acl_access");
We should find that name "" isn't it ?

>  
>  	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
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-23 14:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-20  4:01 [PATCH 1/1] 9p: correctly check empty xattr key Taesoo Kim
2015-03-23 14:54 ` Aneesh Kumar K.V

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.