Skip to content

Commit f6d9a07

Browse files
committed
Add home dir to User telemetry
1 parent e9175b1 commit f6d9a07

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

core/src/target/default.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use regex::Regex;
1010
use std::process;
1111
use telemetry::{FsMount, User};
1212
use users::{get_group_by_gid, get_user_by_uid, get_current_uid};
13+
use users::os::unix::UserExt;
1314

1415
pub fn hostname() -> Result<String> {
1516
match get_hostname() {
@@ -104,5 +105,6 @@ pub fn user() -> Result<User> {
104105
uid: user.uid(),
105106
group: group.name().into(),
106107
gid: group.gid(),
108+
home_dir: user.home_dir().into(),
107109
})
108110
}

core/src/telemetry/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use host::Host;
1919
use pnet::datalink::NetworkInterface;
2020
use remote::{Request, Response};
2121
#[doc(hidden)] pub use self::providers::factory;
22+
use std::path::PathBuf;
2223

2324
/// Top level structure that contains static information about a `Host`.
2425
#[derive(Debug)]
@@ -121,6 +122,7 @@ pub struct User {
121122
pub uid: u32,
122123
pub group: String,
123124
pub gid: u32,
125+
pub home_dir: PathBuf,
124126
}
125127

126128
impl Telemetry {

0 commit comments

Comments
 (0)