SystemUIs authorization (#1233)

* Initial implementation of AuthCodeStore for SystemUIs

* SystemUIs authorization

* Renaming SystemUI -> SignerUI

* Fixing clippy warnings

* Lowering time threshold

* Bumping sysui

* Fixing test
This commit is contained in:
Tomasz Drwięga
2016-06-07 17:21:19 +02:00
committed by Gav Wood
parent e6d141e14f
commit f61ee1a5f1
12 changed files with 316 additions and 24 deletions

View File

@@ -465,7 +465,8 @@ pub struct KeyDirectory {
cache_usage: RwLock<VecDeque<Uuid>>,
}
fn restrict_permissions_owner(file_path: &Path) -> Result<(), i32> {
/// Restricts the permissions of given path only to the owner.
pub fn restrict_permissions_owner(file_path: &Path) -> Result<(), i32> {
let cstr = ::std::ffi::CString::new(file_path.to_str().unwrap()).unwrap();
match unsafe { ::libc::chmod(cstr.as_ptr(), ::libc::S_IWUSR | ::libc::S_IRUSR) } {
0 => Ok(()),