GlobalProtect-openconnect
GlobalProtect-openconnect copied to clipboard
gpservice crashes if can't bind to port
Describe the bug gpservice crashes if can't bind to port. For example, you can try starting it under non-root user.
https://github.com/yuezk/GlobalProtect-openconnect/blob/v2.2.1/apps/gpservice/src/ws_server.rs#L124
Expected behavior Output a perror and exit.
Logs
[2024-05-10T03:07:09Z INFO gpservice::cli] gpservice started: 2.2.1 (2024-05-08)
thread 'tokio-runtime-worker' panicked at apps/gpservice/src/ws_server.rs:124:58:
called `Result::unwrap()` on an `Err` value: Permission denied (os error 13)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Abort trap (core dumped)
Environment:
- FreeBSD 13.3-RELEASE-p1 amd64
- GlobalProtect-openconnect-2.2.1
gpservice is supposed to be run as root because connect the VPN needs the root permission.
No doubt. But it should not just crash.