File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[package ]
22name = " linux-keyutils"
3- version = " 0.1.1 "
3+ version = " 0.1.2 "
44edition = " 2021"
55authors = [" landhb <landhb@users.noreply.github.com>" ]
66description = """
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ fn main() -> Result<(), Box<dyn Error>> {
5959 // Obtain the default User keyring for the current UID/user
6060 // See [KeyRingIdentifier] and `man 2 keyctl` for more information on default
6161 // keyrings for processes.
62- let ring = KeyRing :: get_persistent ( KeyRingIdentifier :: User ) ?;
62+ let ring = KeyRing :: from_special_id ( KeyRingIdentifier :: Session , false ) ?;
6363
6464 _ = match args. subcommand {
6565 // Add a new key to the keyring
@@ -102,6 +102,7 @@ fn main() -> Result<(), Box<dyn Error>> {
102102 Command :: Invalidate { description } => {
103103 let key = ring. search ( & description) ?;
104104 key. invalidate ( ) ?;
105+ println ! ( "Removed key with ID {:?}" , key. get_id( ) ) ;
105106 }
106107 } ;
107108
Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ pub enum KeyError {
4848 /// An invalid identifier was returned
4949 InvalidIdentifier ,
5050
51+ /// Operation not supported
52+ OperationNotSupported ,
53+
5154 /// Unknown - catch all, return this instead of panicing
5255 Unknown ( i32 ) ,
5356}
@@ -76,6 +79,7 @@ impl KeyError {
7679 libc:: EKEYREJECTED => KeyError :: KeyRejected ,
7780 libc:: ENOMEM => KeyError :: OutOfMemory ,
7881 libc:: ENOKEY => KeyError :: KeyDoesNotExist ,
82+ libc:: ENOTSUP => KeyError :: OperationNotSupported ,
7983
8084 // Unknown, provide error code for debugging
8185 x => KeyError :: Unknown ( x) ,
You can’t perform that action at this time.
0 commit comments