Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120664
b: refs/heads/master
c: b0fafa8
h: refs/heads/master
v: v3
  • Loading branch information
David Howells authored and James Morris committed Nov 13, 2008
1 parent e986026 commit 6fe9f08
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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: 350b4da71f8326b9319ada7b701f2bce2e1285b7
refs/heads/master: b0fafa816ece0080771355de6158b4dfa8531a95
6 changes: 4 additions & 2 deletions trunk/drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,8 +936,10 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
{
int err;
struct loop_func_table *xfer;
uid_t uid = current_uid();

if (lo->lo_encrypt_key_size && lo->lo_key_owner != current->uid &&
if (lo->lo_encrypt_key_size &&
lo->lo_key_owner != uid &&
!capable(CAP_SYS_ADMIN))
return -EPERM;
if (lo->lo_state != Lo_bound)
Expand Down Expand Up @@ -992,7 +994,7 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
if (info->lo_encrypt_key_size) {
memcpy(lo->lo_encrypt_key, info->lo_encrypt_key,
info->lo_encrypt_key_size);
lo->lo_key_owner = current->uid;
lo->lo_key_owner = uid;
}

return 0;
Expand Down

0 comments on commit 6fe9f08

Please sign in to comment.