fn extract_authorized_keys_file_path()

in libazureinit/src/provision/ssh.rs [185:203]


fn extract_authorized_keys_file_path(stdout: &[u8]) -> Option<String> {
    let output = String::from_utf8_lossy(stdout);
    for line in output.lines() {
        if line.starts_with("authorizedkeysfile") {
            let keypath = line.split_whitespace().nth(1).map(|s| {
                info!(
                    target: "libazureinit::ssh::authorized_keys",
                    authorizedkeysfile = %s,
                    "Using sshd's authorizedkeysfile path configuration"
                );
                s.to_string()
            });
            if keypath.is_some() {
                return keypath;
            }
        }
    }
    None
}