From 681fd3d0ef5fc607cd161f16fd5f0e993d727962 Mon Sep 17 00:00:00 2001 From: Ivan Chebykin <ivan@chebykin.org> Date: Sat, 11 Nov 2017 22:12:55 +0300 Subject: [PATCH] Migrated to redox_users --- Cargo.lock | 29 ++++++++++++----------------- Cargo.toml | 2 +- src/install.rs | 4 ++-- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 707476c..9fc4f40 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,12 +6,12 @@ dependencies = [ "liner 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "pkgutils 0.1.1 (git+https://github.com/redox-os/pkgutils.git)", "rand 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_users 0.1.0 (git+https://github.com/redox-os/users.git)", "redoxfs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "userutils 0.1.0 (git+https://github.com/redox-os/userutils.git)", ] [[package]] @@ -370,6 +370,16 @@ dependencies = [ "redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "redox_users" +version = "0.1.0" +source = "git+https://github.com/redox-os/users.git#77ce04ba3c2a1e4731e75eb58984598fa8937880" +dependencies = [ + "argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "extra 0.1.0 (git+https://github.com/redox-os/libextra.git)", + "redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "redoxfs" version = "0.2.0" @@ -649,21 +659,6 @@ dependencies = [ "percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "userutils" -version = "0.1.0" -source = "git+https://github.com/redox-os/userutils.git#a1d096b0bfbce9528c8b78e77d66225fa6d77124" -dependencies = [ - "arg_parser 0.1.0 (git+https://github.com/redox-os/arg-parser.git)", - "argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "extra 0.1.0 (git+https://github.com/redox-os/libextra.git)", - "liner 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "vec_map" version = "0.8.0" @@ -763,6 +758,7 @@ dependencies = [ "checksum rayon-core 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7febc28567082c345f10cddc3612c6ea020fc3297a1977d472cf9fdb73e6e493" "checksum redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "8dde11f18c108289bef24469638a04dce49da56084f2d50618b226e47eb04509" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" +"checksum redox_users 0.1.0 (git+https://github.com/redox-os/users.git)" = "<none>" "checksum redoxfs 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5236198d590faf34738c4ae3ce402f8721978d2b50d9db09f0ff99e11b0bfb34" "checksum ring 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2a6dc7fc06a05e6de183c5b97058582e9da2de0c136eafe49609769c507724" "checksum rustls 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17727f4b991294da2c84d75a43c003151ff58072212768800f66c56ee46dca43" @@ -799,7 +795,6 @@ dependencies = [ "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum untrusted 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f392d7819dbe58833e26872f5f6f0d68b7bbbe90fc3667e98731c4a15ad9a7ae" "checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" -"checksum userutils 0.1.0 (git+https://github.com/redox-os/userutils.git)" = "<none>" "checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c" "checksum version-compare 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cb766fdc689f3a5e38b2a0eb9dff9ac4a8961c09bb99064ecf88702a39b1992e" "checksum version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6b772017e347561807c1aa192438c5fd74242a670a6cffacc40f2defd1dc069d" diff --git a/Cargo.toml b/Cargo.toml index b0d87d0..fdd46bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,4 +20,4 @@ serde = "0.8" serde_derive = "0.8" termion = "1.5.1" toml = { version = "0.2", default-features = false, features = ["serde"] } -userutils = { git = "https://github.com/redox-os/userutils.git" } +redox_users = { git = "https://github.com/redox-os/users.git" } diff --git a/src/install.rs b/src/install.rs index a10dc2c..ad76f80 100644 --- a/src/install.rs +++ b/src/install.rs @@ -2,7 +2,7 @@ extern crate liner; extern crate pkgutils; extern crate rand; extern crate termion; -extern crate userutils; +extern crate redox_users; use self::rand::Rng; use self::termion::input::TermRead; @@ -55,7 +55,7 @@ fn prompt_password(prompt: &str, confirm_prompt: &str) -> Result<String, String> if confirm_password == password { let salt = format!("{:X}", rand::OsRng::new().unwrap().next_u64()); - Ok(userutils::Passwd::encode(&password, &salt)) + Ok(redox_users::User::encode_passwd(&password, &salt)) } else { Err("passwords do not match".to_string()) } -- GitLab