From: David Howells <dhowells@redhat.com>
To: viro@ftp.linux.org.uk
Cc: kwc@citi.umich.edu, Trond.Myklebust@netapp.com,
linux-kernel@vger.kernel.org, dhowells@redhat.com
Subject: [PATCH 35/52] CRED: Make the ACL set() handler take a credentials pointer
Date: Fri, 12 Oct 2007 17:08:18 +0100 [thread overview]
Message-ID: <20071012160818.15119.28784.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20071012160519.15119.69608.stgit@warthog.procyon.org.uk>
Make the ACL set() handler take a credentials pointer.
Signed-off-by: David Howells <dhowells@redhat.com>
---
fs/ext3/acl.c | 8 ++++----
fs/ext3/xattr_security.c | 5 ++---
fs/ext3/xattr_trusted.c | 5 ++---
fs/ext3/xattr_user.c | 5 ++---
fs/xattr.c | 6 ++++--
include/linux/xattr.h | 2 +-
mm/shmem.c | 3 ++-
mm/shmem_acl.c | 4 ++--
8 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index 239efa9..3122db9 100644
--- a/fs/ext3/acl.c
+++ b/fs/ext3/acl.c
@@ -523,9 +523,9 @@ release_and_out:
static int
ext3_xattr_set_acl_access(struct inode *inode, const char *name,
- const void *value, size_t size, int flags)
+ const void *value, size_t size, int flags,
+ struct cred *cred)
{
- struct cred *cred = current->cred;
if (strcmp(name, "") != 0)
return -EINVAL;
return ext3_xattr_set_acl(inode, ACL_TYPE_ACCESS, value, size, cred);
@@ -533,9 +533,9 @@ ext3_xattr_set_acl_access(struct inode *inode, const char *name,
static int
ext3_xattr_set_acl_default(struct inode *inode, const char *name,
- const void *value, size_t size, int flags)
+ const void *value, size_t size, int flags,
+ struct cred *cred)
{
- struct cred *cred = current->cred;
if (strcmp(name, "") != 0)
return -EINVAL;
return ext3_xattr_set_acl(inode, ACL_TYPE_DEFAULT, value, size, cred);
diff --git a/fs/ext3/xattr_security.c b/fs/ext3/xattr_security.c
index 9a949e3..351bbb8 100644
--- a/fs/ext3/xattr_security.c
+++ b/fs/ext3/xattr_security.c
@@ -39,10 +39,9 @@ ext3_xattr_security_get(struct inode *inode, const char *name,
static int
ext3_xattr_security_set(struct inode *inode, const char *name,
- const void *value, size_t size, int flags)
+ const void *value, size_t size, int flags,
+ struct cred *cred)
{
- struct cred *cred = current->cred;
-
if (strcmp(name, "") == 0)
return -EINVAL;
return ext3_xattr_set(inode, EXT3_XATTR_INDEX_SECURITY, name,
diff --git a/fs/ext3/xattr_trusted.c b/fs/ext3/xattr_trusted.c
index eead225..d086115 100644
--- a/fs/ext3/xattr_trusted.c
+++ b/fs/ext3/xattr_trusted.c
@@ -45,10 +45,9 @@ ext3_xattr_trusted_get(struct inode *inode, const char *name,
static int
ext3_xattr_trusted_set(struct inode *inode, const char *name,
- const void *value, size_t size, int flags)
+ const void *value, size_t size, int flags,
+ struct cred *cred)
{
- struct cred *cred = current->cred;
-
if (strcmp(name, "") == 0)
return -EINVAL;
return ext3_xattr_set(inode, EXT3_XATTR_INDEX_TRUSTED, name,
diff --git a/fs/ext3/xattr_user.c b/fs/ext3/xattr_user.c
index 1aa87ae..afbfc4d 100644
--- a/fs/ext3/xattr_user.c
+++ b/fs/ext3/xattr_user.c
@@ -45,10 +45,9 @@ ext3_xattr_user_get(struct inode *inode, const char *name,
static int
ext3_xattr_user_set(struct inode *inode, const char *name,
- const void *value, size_t size, int flags)
+ const void *value, size_t size, int flags,
+ struct cred *cred)
{
- struct cred *cred = current->cred;
-
if (strcmp(name, "") == 0)
return -EINVAL;
if (!test_opt(inode->i_sb, XATTR_USER))
diff --git a/fs/xattr.c b/fs/xattr.c
index a44fd92..7917579 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -587,6 +587,7 @@ generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
int
generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags)
{
+ struct cred *cred = current->cred;
struct xattr_handler *handler;
struct inode *inode = dentry->d_inode;
@@ -595,7 +596,7 @@ generic_setxattr(struct dentry *dentry, const char *name, const void *value, siz
handler = xattr_resolve_name(inode->i_sb->s_xattr, &name);
if (!handler)
return -EOPNOTSUPP;
- return handler->set(inode, name, value, size, flags);
+ return handler->set(inode, name, value, size, flags, cred);
}
/*
@@ -605,13 +606,14 @@ generic_setxattr(struct dentry *dentry, const char *name, const void *value, siz
int
generic_removexattr(struct dentry *dentry, const char *name)
{
+ struct cred *cred = current->cred;
struct xattr_handler *handler;
struct inode *inode = dentry->d_inode;
handler = xattr_resolve_name(inode->i_sb->s_xattr, &name);
if (!handler)
return -EOPNOTSUPP;
- return handler->set(inode, name, NULL, 0, XATTR_REPLACE);
+ return handler->set(inode, name, NULL, 0, XATTR_REPLACE, cred);
}
EXPORT_SYMBOL(generic_getxattr);
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index def131a..50c35d9 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -43,7 +43,7 @@ struct xattr_handler {
int (*get)(struct inode *inode, const char *name, void *buffer,
size_t size);
int (*set)(struct inode *inode, const char *name, const void *buffer,
- size_t size, int flags);
+ size_t size, int flags, struct cred *cred);
};
ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t);
diff --git a/mm/shmem.c b/mm/shmem.c
index ee0b20a..ab44c06 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1972,7 +1972,8 @@ static int shmem_xattr_security_get(struct inode *inode, const char *name,
}
static int shmem_xattr_security_set(struct inode *inode, const char *name,
- const void *value, size_t size, int flags)
+ const void *value, size_t size, int flags,
+ struct cred *cred)
{
if (strcmp(name, "") == 0)
return -EINVAL;
diff --git a/mm/shmem_acl.c b/mm/shmem_acl.c
index f5664c5..0c7f1f2 100644
--- a/mm/shmem_acl.c
+++ b/mm/shmem_acl.c
@@ -89,7 +89,7 @@ shmem_get_acl_access(struct inode *inode, const char *name, void *buffer,
static int
shmem_set_acl_access(struct inode *inode, const char *name, const void *value,
- size_t size, int flags)
+ size_t size, int flags, struct cred *cred)
{
if (strcmp(name, "") != 0)
return -EINVAL;
@@ -130,7 +130,7 @@ shmem_get_acl_default(struct inode *inode, const char *name, void *buffer,
static int
shmem_set_acl_default(struct inode *inode, const char *name, const void *value,
- size_t size, int flags)
+ size_t size, int flags, struct cred *cred)
{
if (strcmp(name, "") != 0)
return -EINVAL;
next prev parent reply other threads:[~2007-10-12 16:23 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-12 16:05 [PATCH 00/52] Introduce credential record David Howells
2007-10-12 16:05 ` [PATCH 01/52] CRED: Introduce a COW credentials record David Howells
2007-10-15 1:53 ` David Chinner
2007-10-12 16:05 ` [PATCH 02/52] CRED: Give in_group_p() a cred pointer David Howells
2007-10-12 16:05 ` [PATCH 03/52] CRED: Pass credentials down to ext3 block allocator David Howells
2007-10-12 16:05 ` [PATCH 04/52] CRED: Pass credentials down to ext3 inode allocator David Howells
2007-10-12 16:05 ` [PATCH 05/52] CRED: Prepare TMPFS for cred passing David Howells
2007-10-12 16:05 ` [PATCH 06/52] CRED: Prepare RAMFS " David Howells
2007-10-12 16:05 ` [PATCH 07/52] CRED: Pass credentials down to ext2 block allocator David Howells
2007-10-12 16:06 ` [PATCH 08/52] CRED: Pass credentials down to ext2 inode allocator David Howells
2007-10-12 16:06 ` [PATCH 09/52] CRED: Pass credentials down to ext4 block allocator David Howells
2007-10-12 16:06 ` [PATCH 10/52] CRED: Pass credentials down to ext4 inode allocator David Howells
2007-10-12 16:06 ` [PATCH 11/52] CRED: Give the get_block() callback a credentials pointer David Howells
2007-10-12 16:06 ` [PATCH 12/52] CRED: Make mpage read functions take " David Howells
2007-10-12 16:06 ` [PATCH 13/52] CRED: Make block_prepare_write() and co " David Howells
2007-10-12 16:06 ` [PATCH 14/52] CRED: Provide a writeback credentials record David Howells
2007-10-12 16:06 ` [PATCH 15/52] CRED: Make Ext3 use the writeback credentials David Howells
2007-10-12 16:06 ` [PATCH 16/52] CRED: Pass credentials through the internals of ext3 truncation David Howells
2007-10-12 16:06 ` [PATCH 17/52] CRED: Make rpcauth_lookupcred() take a credentials pointer David Howells
2007-10-12 16:06 ` [PATCH 18/52] CRED: Make rpcauth_bindcred() " David Howells
2007-10-12 16:06 ` [PATCH 19/52] CRED: Add a credentials pointer to struct rpc_task David Howells
2007-10-12 16:07 ` [PATCH 20/52] CRED: Pass credentials into rpc_init_task() David Howells
2007-10-12 16:07 ` [PATCH 21/52] CRED: Pass credentials through the truncate() inode operation David Howells
2007-10-12 16:07 ` [PATCH 22/52] CRED: Pass credentials to nfs_setattr_update_inode() David Howells
2007-10-12 16:07 ` [PATCH 23/52] CRED: Pass credentials to the setattr() inode operation David Howells
2007-10-12 16:07 ` [PATCH 24/52] CRED: Pass credentials through inode_setattr() David Howells
2007-10-12 16:07 ` [PATCH 25/52] CRED: Give the mknod() inode op a credentials pointer David Howells
2007-10-12 16:07 ` [PATCH 26/52] CRED: Give the mkdir() " David Howells
2007-10-12 16:07 ` [PATCH 27/52] CRED: Give the create() " David Howells
2007-10-12 16:07 ` [PATCH 28/52] CRED: Give the link() " David Howells
2007-10-12 16:07 ` [PATCH 29/52] CRED: Give the unlink() " David Howells
2007-10-12 16:07 ` [PATCH 30/52] CRED: Give the rmdir() " David Howells
2007-10-12 16:07 ` [PATCH 31/52] CRED: Give the rename() " David Howells
2007-10-12 16:08 ` [PATCH 32/52] CRED: Give the symlink() " David Howells
2007-10-12 16:08 ` [PATCH 33/52] CRED: Make the get_parent() export op take a credential pointer David Howells
2007-10-12 16:08 ` [PATCH 34/52] CRED: Make Ext3 ACL set handlers pass credentials down David Howells
2007-10-12 16:08 ` David Howells [this message]
2007-10-12 16:08 ` [PATCH 36/52] CRED: Make ext3_fill_super() " David Howells
2007-10-12 16:08 ` [PATCH 37/52] CRED: Pass credentials to the get_sb() op and various fill_super() ops David Howells
2007-10-12 16:08 ` [PATCH 38/52] CRED: Pass credentials through the quota_read() op David Howells
2007-10-12 16:08 ` [PATCH 39/52] CRED: Pass credentials through the quota_write() op David Howells
2007-10-12 16:08 ` [PATCH 40/52] CRED: Give the lookup() inode op a credentials pointer David Howells
2007-10-12 16:08 ` [PATCH 41/52] CRED: Pass credentials through d_revalidate() David Howells
2007-10-12 16:08 ` [PATCH 42/52] CRED: Pass credentials through the permission() inode op David Howells
2007-10-12 16:08 ` [PATCH 43/52] CRED: Pass credentials through the statfs() superblock op David Howells
2007-10-12 16:09 ` [PATCH 44/52] CRED: Pass credentials through the follow_link() inode op David Howells
2007-10-12 16:09 ` [PATCH 45/52] CRED: Pass credentials through the getattr() " David Howells
2007-10-12 16:09 ` [PATCH 46/52] CRED: Pass credentials through the setxattr() " David Howells
2007-10-12 16:09 ` [PATCH 47/52] CRED: Pass credentials through the xattr get() handler David Howells
2007-10-12 16:09 ` [PATCH 48/52] CRED: Pass credentials through the getxattr() inode op David Howells
2007-10-12 16:09 ` [PATCH 49/52] CRED: Pass credentials through the xattr list() handler David Howells
2007-10-12 16:09 ` [PATCH 50/52] CRED: Pass credentials through the listxattr() inode op David Howells
2007-10-12 16:09 ` [PATCH 51/52] CRED: Pass credentials through the removexattr() " David Howells
2007-10-12 16:09 ` [PATCH 52/52] CRED: Pass credentials through vfs_mkdir() David Howells
2007-10-13 18:11 ` [PATCH 00/52] Introduce credential record Theodore Tso
2007-10-13 18:19 ` Al Viro
2007-10-13 21:46 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071012160818.15119.28784.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=Trond.Myklebust@netapp.com \
--cc=kwc@citi.umich.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®