Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327283
b: refs/heads/master
c: cdf8c58
h: refs/heads/master
i:
  327281: 8c72f40
  327279: 881f98e
v: v3
  • Loading branch information
Eric W. Biederman committed Sep 21, 2012
1 parent 9dbdccd commit e587178
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a7d9cfe97b450b27c82e6e41b2fde6214708560d
refs/heads/master: cdf8c58a3546443073cab77d07a88ee439319c19
5 changes: 3 additions & 2 deletions trunk/fs/ecryptfs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,11 +544,12 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags
goto out_free;
}

if (check_ruid && path.dentry->d_inode->i_uid != current_uid()) {
if (check_ruid && !uid_eq(path.dentry->d_inode->i_uid, current_uid())) {
rc = -EPERM;
printk(KERN_ERR "Mount of device (uid: %d) not owned by "
"requested user (uid: %d)\n",
path.dentry->d_inode->i_uid, current_uid());
i_uid_read(path.dentry->d_inode),
from_kuid(&init_user_ns, current_uid()));
goto out_free;
}

Expand Down
5 changes: 2 additions & 3 deletions trunk/fs/ecryptfs/messaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static struct hlist_head *ecryptfs_daemon_hash;
struct mutex ecryptfs_daemon_hash_mux;
static int ecryptfs_hash_bits;
#define ecryptfs_current_euid_hash(uid) \
hash_long((unsigned long)current_euid(), ecryptfs_hash_bits)
hash_long((unsigned long)from_kuid(&init_user_ns, current_euid()), ecryptfs_hash_bits)

static u32 ecryptfs_msg_counter;
static struct ecryptfs_msg_ctx *ecryptfs_msg_ctx_arr;
Expand Down Expand Up @@ -121,8 +121,7 @@ int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon)
hlist_for_each_entry(*daemon, elem,
&ecryptfs_daemon_hash[ecryptfs_current_euid_hash()],
euid_chain) {
if ((*daemon)->file->f_cred->euid == current_euid() &&
(*daemon)->file->f_cred->user_ns == current_user_ns()) {
if (uid_eq((*daemon)->file->f_cred->euid, current_euid())) {
rc = 0;
goto out;
}
Expand Down
1 change: 0 additions & 1 deletion trunk/init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,6 @@ config UIDGID_CONVERTED
depends on CEPH_FS = n
depends on CIFS = n
depends on CODA_FS = n
depends on ECRYPT_FS = n
depends on EFS_FS = n
depends on EXOFS_FS = n
depends on FUSE_FS = n
Expand Down

0 comments on commit e587178

Please sign in to comment.