lkml.org 
[lkml]   [2007]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 04/52] CRED: Pass credentials down to ext3 inode allocator
Date
Pass credentials down to the ext3 inode allocator.

Signed-off-by: David Howells <dhowells@redhat.com>
---
fs/ext3/ialloc.c | 6 +++---
fs/ext3/xattr.h | 4 ++--
fs/ext3/xattr_security.c | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c
index 596d8ca..7335461 100644
--- a/fs/ext3/ialloc.c
+++ b/fs/ext3/ialloc.c
@@ -547,7 +547,7 @@ got:
percpu_counter_inc(&sbi->s_dirs_counter);
sb->s_dirt = 1;

- inode->i_uid = current->cred->uid;
+ inode->i_uid = cred->uid;
if (test_opt (sb, GRPID))
inode->i_gid = dir->i_gid;
else if (dir->i_mode & S_ISGID) {
@@ -555,7 +555,7 @@ got:
if (S_ISDIR(mode))
mode |= S_ISGID;
} else
- inode->i_gid = current->cred->gid;
+ inode->i_gid = cred->gid;
inode->i_mode = mode;

inode->i_ino = ino;
@@ -607,7 +607,7 @@ got:
if (err)
goto fail_free_drop;

- err = ext3_init_security(handle,inode, dir);
+ err = ext3_init_security(handle,inode, dir, cred);
if (err)
goto fail_free_drop;

diff --git a/fs/ext3/xattr.h b/fs/ext3/xattr.h
index 761772a..8d00a18 100644
--- a/fs/ext3/xattr.h
+++ b/fs/ext3/xattr.h
@@ -137,10 +137,10 @@ exit_ext3_xattr(void)

#ifdef CONFIG_EXT3_FS_SECURITY
extern int ext3_init_security(handle_t *handle, struct inode *inode,
- struct inode *dir);
+ struct inode *dir, struct cred *cred);
#else
static inline int ext3_init_security(handle_t *handle, struct inode *inode,
- struct inode *dir)
+ struct inode *dir, struct cred *cred)
{
return 0;
}
diff --git a/fs/ext3/xattr_security.c b/fs/ext3/xattr_security.c
index 76ccead..9a949e3 100644
--- a/fs/ext3/xattr_security.c
+++ b/fs/ext3/xattr_security.c
@@ -50,9 +50,9 @@ ext3_xattr_security_set(struct inode *inode, const char *name,
}

int
-ext3_init_security(handle_t *handle, struct inode *inode, struct inode *dir)
+ext3_init_security(handle_t *handle, struct inode *inode, struct inode *dir,
+ struct cred *cred)
{
- struct cred *cred = current->cred;
int err;
size_t len;
void *value;
-
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/

\
 
 \ /
  Last update: 2007-10-12 18:11    [from the cache]
©2003-2011 Jasper Spaans