Module: Keyutils::SessionKeyring
- Defined in:
- lib/keyutils/keyring.rb
Overview
This module contains the additional methods included in Keyring::Session.
Instance Method Summary collapse
-
#join(name = nil) ⇒ Keyring
Join a different session keyring.
-
#to_parent ⇒ Keyring
Set the parent process’s session keyring.
Instance Method Details
#join(name = nil) ⇒ Keyring
Join a different session keyring
Change the session keyring to which a process is subscribed.
If name
is nil then a new anonymous keyring will be created, and the process will be subscribed to that.
If name
is provided, then if a keyring of that name is available, the process will attempt to subscribe to that keyring, raising an error if that is not permitted; otherwise a new keyring of that name is created and attached as the session keyring.
To attach to an extant named keyring, the keyring must have search permission available to the calling process.
474 475 476 |
# File 'lib/keyutils/keyring.rb', line 474 def join name = nil Keyring.send :new, Lib.keyctl_join_session_keyring(name), name end |
#to_parent ⇒ Keyring
Set the parent process’s session keyring.
Changes the session keyring to which the calling process’s parent subscribes to be the that of the calling process.
The keyring must have link permission available to the calling process, the parent process must have the same UIDs/GIDs as the calling process, and the LSM must not reject the replacement. Furthermore, this may not be used to affect init or a kernel thread.
Note that the replacement will not take immediate effect upon the parent process, but will rather be deferred to the next time it returns to userspace from kernel space.
498 499 500 501 |
# File 'lib/keyutils/keyring.rb', line 498 def to_parent Lib.keyctl_session_to_parent self end |