| 18643 | } |
| 18644 | |
| 18645 | int Client::get_fscrypt_key_status(fscrypt_get_key_status_arg* arg) { |
| 18646 | ceph_fscrypt_key_identifier kid; |
| 18647 | int r = kid.init(arg->key_spec); |
| 18648 | if (r < 0) { |
| 18649 | return r; |
| 18650 | } |
| 18651 | unsigned int status = 0; |
| 18652 | unsigned int status_flags = 0; |
| 18653 | unsigned int user_count = 0; |
| 18654 | |
| 18655 | FSCryptKeyHandlerRef kh; |
| 18656 | r = fscrypt->get_key_store().find(kid, kh); |
| 18657 | |
| 18658 | if (!kh){ |
| 18659 | status = FSCRYPT_KEY_STATUS_ABSENT; |
| 18660 | goto out; |
| 18661 | } |
| 18662 | |
| 18663 | user_count = kh->get_users().size(); |
| 18664 | |
| 18665 | if (!kh->present) { |
| 18666 | status = FSCRYPT_KEY_STATUS_INCOMPLETELY_REMOVED; |
| 18667 | } else { |
| 18668 | status = FSCRYPT_KEY_STATUS_PRESENT; |
| 18669 | } |
| 18670 | out: |
| 18671 | arg->status = status; |
| 18672 | arg->status_flags = status_flags; //TODO: implement this |
| 18673 | arg->user_count = user_count; |
| 18674 | return 0; |
| 18675 | } |
| 18676 | #endif |
| 18677 | // called before mount. 0 means infinite |
| 18678 | void Client::set_session_timeout(unsigned timeout) |
no test coverage detected