mirror of
				https://github.com/yuezk/GlobalProtect-openconnect.git
				synced 2025-05-20 07:26:58 -04:00 
			
		
		
		
	Support specify csd-wrapper
This commit is contained in:
		| @@ -15,6 +15,9 @@ pub(crate) struct ConnectOptions { | ||||
|   pub os: *const c_char, | ||||
|   pub certificate: *const c_char, | ||||
|   pub servercert: *const c_char, | ||||
|  | ||||
|   pub csd_uid: u32, | ||||
|   pub csd_wrapper: *const c_char, | ||||
| } | ||||
|  | ||||
| #[link(name = "vpn")] | ||||
|   | ||||
| @@ -61,6 +61,8 @@ int vpn_connect(const vpn_options *options, vpn_connected_callback callback) | ||||
|     INFO("User agent: %s", options->user_agent); | ||||
|     INFO("VPNC script: %s", options->script); | ||||
|     INFO("OS: %s", options->os); | ||||
|     INFO("CSD_USER: %d", options->csd_uid); | ||||
|     INFO("CSD_WRAPPER: %s", options->csd_wrapper); | ||||
|  | ||||
|     vpninfo = openconnect_vpninfo_new(options->user_agent, validate_peer_cert, NULL, NULL, print_progress, NULL); | ||||
|  | ||||
| @@ -91,6 +93,10 @@ int vpn_connect(const vpn_options *options, vpn_connected_callback callback) | ||||
|         openconnect_set_system_trust(vpninfo, 0); | ||||
|     } | ||||
|  | ||||
|     if (options->csd_wrapper) { | ||||
|         openconnect_setup_csd(vpninfo, options->csd_uid, 1, options->csd_wrapper); | ||||
|     } | ||||
|  | ||||
|     g_cmd_pipe_fd = openconnect_setup_cmd_pipe(vpninfo); | ||||
|     if (g_cmd_pipe_fd < 0) | ||||
|     { | ||||
|   | ||||
| @@ -16,6 +16,9 @@ typedef struct vpn_options | ||||
|     const char *os; | ||||
|     const char *certificate; | ||||
|     const char *servercert; | ||||
|  | ||||
|     const uid_t csd_uid; | ||||
|     const char *csd_wrapper; | ||||
| } vpn_options; | ||||
|  | ||||
| int vpn_connect(const vpn_options *options, vpn_connected_callback callback); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user