bumps rust to 1.63.0, fixes linting errors (#16056)

This commit is contained in:
Isaiah Becker-Mayer 2022-09-06 07:17:31 -04:00 committed by GitHub
parent 168fd90002
commit a67f5c3eb4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 43 additions and 51 deletions

View file

@ -24,16 +24,16 @@ ARCH ?= amd64
BUILDBOX_VERSION ?= teleport11
# NOTE: Windows Drone scripts hardcode $GOLANG_VERSION rather than drawing it
# from here at build time, so any changes here must be reflected in
# from here at build time, so any changes here must be reflected in
# `dronegen/windows.go`
GOLANG_VERSION ?= go1.18.3
# NOTE: Windows Drone scripts hardcode $NODE_VERSION rather than drawing it
# from here at build time, so any changes here must be reflected in
# from here at build time, so any changes here must be reflected in
# `dronegen/windows.go`
NODE_VERSION ?= 16.13.2
RUST_VERSION ?= 1.58.1 # don't bump this without checking GLIBC compatibility
RUST_VERSION ?= 1.63.0 # don't bump this without checking GLIBC compatibility
BORINGCRYPTO_RUNTIME=$(GOLANG_VERSION)b7
LIBBPF_VERSION ?= 0.7.0-teleport

View file

@ -352,10 +352,10 @@ fn connect_rdp_inner(
}
Err(_) => {
// TODO(isaiah): change TryError to TeleportError for a generic error caused by Teleport specific code.
return Err(RdpError::TryError(format!(
Err(RdpError::TryError(format!(
"path contained characters that couldn't be converted to a C string: {:?}",
req.path
)));
)))
}
}
});
@ -386,10 +386,10 @@ fn connect_rdp_inner(
}
Err(_) => {
// TODO(isaiah): change TryError to TeleportError for a generic error caused by Teleport specific code.
return Err(RdpError::TryError(format!(
Err(RdpError::TryError(format!(
"path contained characters that couldn't be converted to a C string: {:?}",
req.path
)));
)))
}
}
});
@ -419,10 +419,10 @@ fn connect_rdp_inner(
}
Err(_) => {
// TODO(isaiah): change TryError to TeleportError for a generic error caused by Teleport specific code.
return Err(RdpError::TryError(format!(
Err(RdpError::TryError(format!(
"path contained characters that couldn't be converted to a C string: {:?}",
req.path
)));
)))
}
}
});
@ -451,10 +451,10 @@ fn connect_rdp_inner(
}
Err(_) => {
// TODO(isaiah): change TryError to TeleportError for a generic error caused by Teleport specific code.
return Err(RdpError::TryError(format!(
Err(RdpError::TryError(format!(
"path contained characters that couldn't be converted to a C string: {:?}",
req.path
)));
)))
}
}
});
@ -484,12 +484,10 @@ fn connect_rdp_inner(
}
Ok(())
}
Err(_) => {
return Err(RdpError::TryError(format!(
"path contained characters that couldn't be converted to a C string: {:?}",
req.path
)));
}
Err(_) => Err(RdpError::TryError(format!(
"path contained characters that couldn't be converted to a C string: {:?}",
req.path
))),
}
});
@ -519,12 +517,10 @@ fn connect_rdp_inner(
}
Ok(())
}
Err(_) => {
return Err(RdpError::TryError(format!(
"path contained characters that couldn't be converted to a C string: {:?}",
req.path
)));
}
Err(_) => Err(RdpError::TryError(format!(
"path contained characters that couldn't be converted to a C string: {:?}",
req.path
))),
}
});
@ -552,19 +548,15 @@ fn connect_rdp_inner(
}
Ok(())
}
Err(_) => {
return Err(RdpError::TryError(format!(
"new_path contained characters that couldn't be converted to a C string: {:?}",
req.new_path
)));
}
Err(_) => Err(RdpError::TryError(format!(
"new_path contained characters that couldn't be converted to a C string: {:?}",
req.new_path
))),
},
Err(_) => {
return Err(RdpError::TryError(format!(
"original_path contained characters that couldn't be converted to a C string: {:?}",
req.original_path
)));
}
Err(_) => Err(RdpError::TryError(format!(
"original_path contained characters that couldn't be converted to a C string: {:?}",
req.original_path
))),
}
});
@ -1391,7 +1383,7 @@ unsafe fn from_go_array<T: Clone>(data: *mut T, len: u32) -> Vec<T> {
}
#[repr(C)]
#[derive(Copy, Clone, PartialEq, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum CGOErrCode {
ErrCodeSuccess = 0,
ErrCodeFailure = 1,
@ -1549,14 +1541,14 @@ impl From<CGOFileSystemObject> for FileSystemObject {
}
#[repr(C)]
#[derive(Copy, Clone, PartialEq, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum FileType {
File = 0,
Directory = 1,
}
#[repr(C)]
#[derive(Copy, Clone, PartialEq, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum TdpErrCode {
/// nil (no error, operation succeeded)
Nil = 0,

View file

@ -22,6 +22,7 @@ use rdp::model::error::*;
use rsa::pkcs1::DecodeRsaPrivateKey;
use rsa::{BigUint, PublicKeyParts, RsaPrivateKey};
use std::convert::TryFrom;
use std::fmt::Write as _;
use std::io::{Cursor, Read};
use uuid::Uuid;
@ -138,12 +139,12 @@ impl<const S: usize> Card<S> {
}
fn handle_verify(&mut self, cmd: Command<S>) -> RdpResult<Response> {
return if cmd.data() == self.pin.as_bytes() {
if cmd.data() == self.pin.as_bytes() {
Ok(Response::new(Status::Success))
} else {
warn!("PIN mismatch, want {}, got {:?}", self.pin, cmd.data());
Ok(Response::new(Status::VerificationFailed))
};
}
}
fn handle_get_data(&mut self, cmd: Command<S>) -> RdpResult<Response> {
@ -420,7 +421,8 @@ fn hex_data<const S: usize>(cmd: &Command<S>) -> String {
fn to_hex(bytes: &[u8]) -> String {
let mut s = String::new();
for b in bytes {
s.push_str(&format!("{:02X}", b));
// https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string
let _ = write!(s, "{:02X}", b);
}
s
}

View file

@ -79,7 +79,7 @@ pub enum DeviceType {
}
/// https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpefs/a087ffa8-d0d5-4874-ac7b-0494f63e2d5d
#[derive(Debug, FromPrimitive, ToPrimitive, PartialEq, Clone)]
#[derive(Debug, FromPrimitive, ToPrimitive, PartialEq, Eq, Clone)]
#[allow(non_camel_case_types)]
pub enum MajorFunction {
IRP_MJ_CREATE = 0x00000000,
@ -106,7 +106,7 @@ pub enum MinorFunction {
/// Windows defines an absolutely massive list of potential NTSTATUS values.
/// This enum includes the basic ones we support for communicating with the windows machine.
/// https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55
#[derive(ToPrimitive, Debug, PartialEq)]
#[derive(ToPrimitive, Debug, PartialEq, Eq)]
#[repr(u32)]
#[allow(non_camel_case_types)]
#[allow(dead_code)]
@ -125,7 +125,7 @@ pub enum NTSTATUS {
/// 2.4 File Information Classes [MS-FSCC]
/// https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/4718fc40-e539-4014-8e33-b675af74e3e1
#[derive(FromPrimitive, Debug, PartialEq, Clone)]
#[derive(FromPrimitive, Debug, PartialEq, Eq, Clone)]
#[repr(u32)]
#[allow(clippy::enum_variant_names)]
pub enum FileInformationClassLevel {
@ -180,7 +180,7 @@ pub enum FileInformationClassLevel {
/// 2.5 File System Information Classes [MS-FSCC]
/// https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fscc/ee12042a-9352-46e3-9f67-c094b75fe6c3
#[derive(FromPrimitive, Debug, PartialEq)]
#[derive(FromPrimitive, Debug, PartialEq, Eq)]
#[repr(u32)]
#[allow(clippy::enum_variant_names)]
pub enum FileSystemInformationClassLevel {

View file

@ -2509,12 +2509,10 @@ impl FileInformationClass {
FileAllocationInformation::decode(payload)?,
))
}
_ => {
return Err(invalid_data_error(&format!(
"decode invalid FileInformationClassLevel: {:?}",
file_information_class_level
)))
}
_ => Err(invalid_data_error(&format!(
"decode invalid FileInformationClassLevel: {:?}",
file_information_class_level
))),
}
}