mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 06:26:14 -05:00
feat: add prebuilt Nix package (#622)
This commit is contained in:
1 parent
ae4cbedd3b
commit
536a43773f
11 files changed
+248
-71
No files matched your search
@@ -1,7 +1,7 @@
|
||||
use std::process::Stdio;
|
||||
use std::{path::PathBuf, process::Stdio};
|
||||
|
||||
use anyhow::bail;
|
||||
use common::constants::GP_AUTH_BINARY;
|
||||
use common::binary_paths;
|
||||
use tokio::process::Command;
|
||||
|
||||
use crate::{auth::SamlAuthResult, credential::Credential, os_profile::OsProfile};
|
||||
@@ -113,8 +113,11 @@ impl<'a> SamlAuthLauncher<'a> {
|
||||
|
||||
/// Launch the authenticator binary as the current user or SUDO_USER if available.
|
||||
pub async fn launch(self) -> anyhow::Result<Credential> {
|
||||
let program = self.auth_executable.unwrap_or(GP_AUTH_BINARY);
|
||||
let mut auth_cmd = Command::new(program);
|
||||
let program = self
|
||||
.auth_executable
|
||||
.map(PathBuf::from)
|
||||
.unwrap_or_else(binary_paths::gpauth);
|
||||
let mut auth_cmd = Command::new(&program);
|
||||
auth_cmd.arg(self.server);
|
||||
|
||||
if self.gateway {
|
||||
@@ -174,7 +177,7 @@ impl<'a> SamlAuthLauncher<'a> {
|
||||
let child = match child {
|
||||
Ok(child) => child,
|
||||
Err(err) => {
|
||||
bail!("Failed to spawn {}: {}", program, err);
|
||||
bail!("Failed to spawn {}: {}", program.display(), err);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user