This repository was archived by the owner on Jan 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +36
-33
lines changed Expand file tree Collapse file tree 3 files changed +36
-33
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,16 @@ license = "Apache-2.0"
6
6
repository = " https://github.com/coreos/update-ssh-keys"
7
7
documentation = " https://docs.rs/update-ssh-keys"
8
8
description = " A tool for managing authorized SSH keys"
9
- version = " 0.3.1 -alpha.0"
9
+ version = " 0.4.0 -alpha.0"
10
10
11
11
[dependencies ]
12
+ # Private dependencies.
12
13
clap = " 2.26"
13
- error-chain = { version = " 0.12" , default-features = false }
14
14
fs2 = " 0.4"
15
+ # Public dependencies, exposed through library API.
16
+ error-chain = { version = " 0.12" , default-features = false }
15
17
openssh-keys = " 0.3"
16
- users = " 0.7 "
18
+ users = " 0.8 "
17
19
18
20
[[bin ]]
19
21
name = " update-ssh-keys"
Original file line number Diff line number Diff line change @@ -140,13 +140,14 @@ fn run() -> Result<()> {
140
140
}
141
141
142
142
fn config ( ) -> Result < Config > {
143
- // get the default user by figuring out the current user if the current user
144
- // is root (or doesn't exist) then use core
143
+ // get the default user by figuring out the current user; if the current user
144
+ // is root (or doesn't exist) then use ' core'.
145
145
let default_user = get_current_username ( ) . map_or ( "core" . into ( ) , |u| {
146
- if u == "root" {
146
+ let name = u. to_string_lossy ( ) ;
147
+ if name == "root" {
147
148
"core" . into ( )
148
149
} else {
149
- u
150
+ name . into_owned ( )
150
151
}
151
152
} ) ;
152
153
You can’t perform that action at this time.
0 commit comments