Function report |
Source Code:security\keys\keyring.c |
Create Date:2022-07-28 18:18:08 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:keyring_restrict - Look up and apply a restriction to a keyring*@keyring_ref: The keyring to be restricted*@type: The key type that will provide the restriction checker.*@restriction: The restriction options to apply to the keyring
Proto:int keyring_restrict(key_ref_t keyring_ref, const char *type, const char *restriction)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
key_ref_t | keyring_ref | |
const char * | type | |
const char * | restriction |
1029 | struct key_type * restrict_type = NULL |
1031 | ret = 0 |
1033 | keyring = key_ref_to_ptr(keyring_ref) |
1036 | If type of key != key_type_keyring Then Return -ENOTDIR |
1039 | If Not type Then |
1041 | Else |
1042 | restrict_type = Find and lock the specified key type against removal.* We return with the sem read-locked if successful. If the type wasn't* available -ENOKEY is returned instead. |
1044 | If IS_ERR(restrict_type) Then Return PTR_ERR(restrict_type) |
1047 | If Not lookup_restriction Then |
1055 | If IS_ERR(restrict_link) Then |
1056 | ret = PTR_ERR(restrict_link) |
1057 | Go to error |
1060 | lock for writing |
1061 | lock for writing |
1065 | Else if Check for restriction cycles that would prevent keyring garbage collection.* keyring_serialise_restrict_sem must be held. Then ret = -EDEADLK |
1070 | lease a write lock |
1071 | lease a write lock |
1073 | If ret < 0 Then |
1075 | kfree(restrict_link) |
1078 | error : |
1082 | Return ret |
Name | Describe |
---|---|
keyctl_restrict_keyring | Apply a restriction to a given keyring.* The caller must have Setattr permission to change keyring restrictions.* The requested type name may be a NULL pointer to reject all attempts* to link to the keyring. In this case, _restriction must also be NULL. |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |