Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5613
b: refs/heads/master
c: 1260f80
h: refs/heads/master
i:
  5611: f840373
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Aug 4, 2005
1 parent cd1ef6e commit ebc6f87
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 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: c36f19e02a96488f550fdb678c92500afca3109b
refs/heads/master: 1260f801b4e4ba7be200886b4a53d730de05ca19
11 changes: 7 additions & 4 deletions trunk/security/keys/keyctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ asmlinkage long sys_add_key(const char __user *_type,
goto error;
type[31] = '\0';

if (!type[0])
goto error;

ret = -EPERM;
if (type[0] == '.')
goto error;
Expand Down Expand Up @@ -144,6 +141,10 @@ asmlinkage long sys_request_key(const char __user *_type,
goto error;
type[31] = '\0';

ret = -EPERM;
if (type[0] == '.')
goto error;

/* pull the description into kernel space */
ret = -EFAULT;
dlen = strnlen_user(_description, PAGE_SIZE - 1);
Expand Down Expand Up @@ -362,7 +363,7 @@ long keyctl_revoke_key(key_serial_t id)

key_put(key);
error:
return 0;
return ret;

} /* end keyctl_revoke_key() */

Expand Down Expand Up @@ -685,6 +686,8 @@ long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen)
goto can_read_key2;

ret = PTR_ERR(skey);
if (ret == -EAGAIN)
ret = -EACCES;
goto error2;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/security/keys/request_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ struct key *request_key_and_link(struct key_type *type,
key_user_put(user);

/* link the new key into the appropriate keyring */
if (!PTR_ERR(key))
if (!IS_ERR(key))
request_key_link(key, dest_keyring);
}

Expand Down

0 comments on commit ebc6f87

Please sign in to comment.