GlobalProtect-openconnect icon indicating copy to clipboard operation
GlobalProtect-openconnect copied to clipboard

gpservice crashes if can't bind to port

Open timp87 opened this issue 1 year ago • 2 comments

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

timp87 avatar May 10 '24 03:05 timp87

gpservice is supposed to be run as root because connect the VPN needs the root permission.

yuezk avatar May 10 '24 05:05 yuezk

No doubt. But it should not just crash.

timp87 avatar May 10 '24 12:05 timp87