diff options
-rw-r--r-- | keyctl.c | 6 | ||||
-rw-r--r-- | man/keyctl.1 | 9 |
2 files changed, 9 insertions, 6 deletions
@@ -93,7 +93,7 @@ static const struct command commands[] = { { act_keyctl_list, "list", "<keyring>" }, { act_keyctl_move, "move", "[-f] <key> <from_keyring> <to_keyring>" }, { act_keyctl_negate, "negate", "<key> <timeout> <keyring>" }, - { act_keyctl_new_session, "new_session", "" }, + { act_keyctl_new_session, "new_session", "[<name>]" }, { act_keyctl_newring, "newring", "<name> <keyring>" }, { act_keyctl_padd, "padd", "<type> <desc> <keyring>" }, { act_keyctl_pinstantiate, "pinstantiate","<key> <keyring>" }, @@ -1351,10 +1351,10 @@ static void act_keyctl_new_session(int argc, char *argv[]) { key_serial_t keyring; - if (argc != 1) + if (argc != 1 && argc != 2) format(); - if (keyctl_join_session_keyring(NULL) < 0) + if (keyctl_join_session_keyring(argv[1]) < 0) error("keyctl_join_session_keyring"); if (keyctl_session_to_parent() < 0) diff --git a/man/keyctl.1 b/man/keyctl.1 index d1008ff..dd1f4a5 100644 --- a/man/keyctl.1 +++ b/man/keyctl.1 @@ -69,7 +69,7 @@ keyctl \- key management facility control .br \fBkeyctl\fR setperm <key> <mask> .br -\fBkeyctl\fR new_session +\fBkeyctl\fR new_session [<name>] .br \fBkeyctl\fR session .br @@ -736,10 +736,12 @@ unconfined_u:unconfined_r:unconfined_t:s0\-s0:c0.c1023 .fi .RE .SS Give the parent process a new session keyring -\fBkeyctl new_session\fR +\fBkeyctl new_session [<name>]\fR This command is used to give the invoking process (typically a shell) a new -session keyring, discarding its old session keyring. +session keyring, discarding its old session keyring. If a name is given, the +keyring is given that name, otherwise it will be given a name of "_ses" and +will not be manually joinable. .RS .nf @@ -761,6 +763,7 @@ call, and so may only affect processes with matching credentials. Furthermore, the change does not take effect till the parent process next transitions from kernel space to user space - typically when the \fBwait\fP() system call returns. + .SS Remove dead keys from the session keyring tree \fBkeyctl reap\fR |