diff --git a/crates/sshx-server/src/grpc.rs b/crates/sshx-server/src/grpc.rs index afe6444..d68cb61 100644 --- a/crates/sshx-server/src/grpc.rs +++ b/crates/sshx-server/src/grpc.rs @@ -122,7 +122,8 @@ impl SshxService for GrpcServer { } /// Validate the client token for a session. -fn validate_token(mac: impl Mac, name: &str, token: &str) -> Result<(), Status> { +#[allow(clippy::result_large_err)] +fn validate_token(mac: impl Mac, name: &str, token: &str) -> tonic::Result<()> { if let Ok(token) = BASE64_STANDARD.decode(token) { if mac.chain_update(name).verify_slice(&token).is_ok() { return Ok(()); diff --git a/crates/sshx/src/runner.rs b/crates/sshx/src/runner.rs index d309a67..d2122a6 100644 --- a/crates/sshx/src/runner.rs +++ b/crates/sshx/src/runner.rs @@ -117,7 +117,7 @@ async fn shell_task( let data = encrypt.segment( 0x100000000 | id.0 as u64, // stream number (content_offset + start) as u64, - content[start..end].as_bytes(), + &content.as_bytes()[start..end], ); let data = TerminalData { id: id.0, diff --git a/scripts/release.sh b/scripts/release.sh index 592e244..259fd64 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -28,8 +28,8 @@ CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER=armv7-unknown-linux-musleabih cargo build --release --target armv7-unknown-linux-musleabihf # x86_64-apple-darwin: for macOS on Intel -SDKROOT=$(xcrun -sdk macosx15.2 --show-sdk-path) \ -MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx15.2 --show-sdk-platform-version) \ +SDKROOT=$(xcrun --show-sdk-path) \ +MACOSX_DEPLOYMENT_TARGET=$(xcrun --show-sdk-platform-version) \ cargo build --release --target x86_64-apple-darwin # aarch64-apple-darwin: for macOS on Apple Silicon @@ -60,15 +60,15 @@ for target in "${targets[@]}" do if [[ ! $target == *"windows"* ]]; then echo "compress: target/$target/release/sshx" - tar czf $temp -C target/$target/release sshx + tar --no-xattrs -czf $temp -C target/$target/release sshx aws s3 cp $temp s3://sshx/sshx-$target.tar.gz echo "compress: target/$target/release/sshx-server" - tar czf $temp -C target/$target/release sshx-server + tar --no-xattrs -czf $temp -C target/$target/release sshx-server aws s3 cp $temp s3://sshx/sshx-server-$target.tar.gz else echo "compress: target/$target/release/sshx.exe" - rm $temp && zip -j $temp target/$target/release/sshx.exe + rm $temp && zip -X -j $temp target/$target/release/sshx.exe aws s3 cp $temp s3://sshx/sshx-$target.zip fi done