Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bryangerlach committed Feb 8, 2024
2 parents 56829b5 + 79f0eb4 commit 81b08dd
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hbbs"
version = "1.1.9"
version = "1.1.10-3"
authors = ["rustdesk <[email protected]>"]
edition = "2021"
build = "build.rs"
Expand Down
8 changes: 8 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
rustdesk-server (1.1.10-3) UNRELEASED; urgency=medium
* fix on -2

rustdesk-server (1.1.10-2) UNRELEASED; urgency=medium

* fix hangup signal exit when run with nohup
* some minors

rustdesk-server (1.1.9) UNRELEASED; urgency=medium

* remove unsafe
Expand Down
14 changes: 7 additions & 7 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub fn init_args(args: &str, name: &str, about: &str) {
}
}
for (k, v) in matches.args {
if let Some(v) = v.vals.get(0) {
if let Some(v) = v.vals.first() {
std::env::set_var(arg_name(k), v.to_string_lossy().to_string());
}
}
Expand Down Expand Up @@ -113,13 +113,18 @@ pub fn gen_sk(wait: u64) -> (String, Option<sign::SecretKey>) {
if let Ok(mut file) = std::fs::File::open(sk_file) {
let mut contents = String::new();
if file.read_to_string(&mut contents).is_ok() {
let sk = base64::decode(&contents).unwrap_or_default();
let contents = contents.trim();
let sk = base64::decode(contents).unwrap_or_default();
if sk.len() == sign::SECRETKEYBYTES {
let mut tmp = [0u8; sign::SECRETKEYBYTES];
tmp[..].copy_from_slice(&sk);
let pk = base64::encode(&tmp[sign::SECRETKEYBYTES / 2..]);
log::info!("Private key comes from {}", sk_file);
return (pk, Some(sign::SecretKey(tmp)));
} else {
// don't use log here, since it is async
println!("Fatal error: malformed private key in {sk_file}.");
std::process::exit(1);
}
}
} else {
Expand Down Expand Up @@ -156,8 +161,6 @@ pub async fn listen_signal() -> Result<()> {
use hbb_common::tokio::signal::unix::{signal, SignalKind};

tokio::spawn(async {
let mut s = signal(SignalKind::hangup())?;
let hangup = s.recv();
let mut s = signal(SignalKind::terminate())?;
let terminate = s.recv();
let mut s = signal(SignalKind::interrupt())?;
Expand All @@ -166,9 +169,6 @@ pub async fn listen_signal() -> Result<()> {
let quit = s.recv();

tokio::select! {
_ = hangup => {
log::info!("signal hangup");
}
_ = terminate => {
log::info!("signal terminate");
}
Expand Down
2 changes: 1 addition & 1 deletion ui/setup.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
!define PRODUCT_NAME "rustdesk_server"
!define PRODUCT_DESCRIPTION "Installer for ${PRODUCT_NAME}"
!define COPYRIGHT "Copyright © 2021"
!define VERSION "1.1.8"
!define VERSION "1.1.10"

VIProductVersion "${VERSION}.0"
VIAddVersionKey "ProductName" "${PRODUCT_NAME}"
Expand Down

0 comments on commit 81b08dd

Please sign in to comment.