Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\keyring.c Create Date:2022-07-28 18:18:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:key_move - Move a key from one keyring to another*@key: The key to move*@from_keyring: The keyring to remove the link from

Proto:int key_move(struct key *key, struct key *from_keyring, struct key *to_keyring, unsigned int flags)

Type:int

Parameter:

TypeParameterName
struct key *key
struct key *from_keyring
struct key *to_keyring
unsigned intflags
1594  struct assoc_array_edit * from_edit = NULL, * to_edit = NULL
1597  kenter("%d,%d,%d", key serial number , key serial number , key serial number )
1599  If from_keyring == to_keyring Then Return 0
1602  key_check(key)
1603  key_check(from_keyring)
1604  key_check(to_keyring)
1606  ret = Lock keyrings for move (link/unlink combination).
1607  If ret < 0 Then Go to out
1609  ret = Begin the process of unlinking a key from a keyring.
1610  If ret < 0 Then Go to error
1612  ret = Preallocate memory so that a key can be linked into to a keyring.
1613  If ret < 0 Then Go to error
1616  ret = -EEXIST
1617  If dead_leaf && flags & Do not displace from the to-keyring Then Go to error
1620  ret = Check addition of keys to restricted keyrings.
1621  If ret < 0 Then Go to error
1623  ret = Check already instantiated keys aren't going to be a problem.* The caller must have called __key_link_begin(). Don't need to call this for* keys that were created since __key_link_begin() was called.
1624  If ret < 0 Then Go to error
1627  Apply an unlink change.
1628  Link a key into to a keyring.* Must be called with __key_link_begin() having being called. Discards any* already extant link to matching key if there is one, so that each keyring* holds at most one link to any given key of a particular type+description
1629  error :
1630  Finish linking a key into to a keyring.* Must be called with __key_link_begin() having being called.
1631  Finish unlinking a key from to a keyring.
1632  out :
1633  kleave(" = %d", ret)
1634  Return ret
Caller
NameDescribe
keyctl_keyring_moveMove a link to a key from one keyring to another, displacing any matching* key from the destination keyring.* The key must grant the caller Link permission and both keyrings must grant* the caller Write permission