1. 17 3月, 2011 2 次提交
    • D
      KEYS: Make request_key() and co. return an error for a negative key · 4aab1e89
      David Howells 提交于
      Make request_key() and co. return an error for a negative or rejected key.  If
      the key was simply negated, then return ENOKEY, otherwise return the error
      with which it was rejected.
      
      Without this patch, the following command returns a key number (with the latest
      keyutils):
      
      	[root@andromeda ~]# keyctl request2 user debug:foo rejected @s
      	586569904
      
      Trying to print the key merely gets you a permission denied error:
      
      	[root@andromeda ~]# keyctl print 586569904
      	keyctl_read_alloc: Permission denied
      
      Doing another request_key() call does get you the error, as long as it hasn't
      expired yet:
      
      	[root@andromeda ~]# keyctl request user debug:foo
      	request_key: Key was rejected by service
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      4aab1e89
    • D
      KEYS: Improve /proc/keys · 78b7280c
      David Howells 提交于
      Improve /proc/keys by:
      
       (1) Don't attempt to summarise the payload of a negated key.  It won't have
           one.  To this end, a helper function - key_is_instantiated() has been
           added that allows the caller to find out whether the key is positively
           instantiated (as opposed to being uninstantiated or negatively
           instantiated).
      
       (2) Do show keys that are negative, expired or revoked rather than hiding
           them.  This requires an override flag (no_state_check) to be passed to
           search_my_process_keyrings() and keyring_search_aux() to suppress this
           check.
      
           Without this, keys that are possessed by the caller, but only grant
           permissions to the caller if possessed are skipped as the possession check
           fails.
      
           Keys that are visible due to user, group or other checks are visible with
           or without this patch.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      78b7280c
  2. 09 3月, 2011 3 次提交
  3. 08 3月, 2011 8 次提交
  4. 07 3月, 2011 2 次提交
  5. 06 3月, 2011 2 次提交
  6. 05 3月, 2011 23 次提交