Replaced u8 pex with UnixPex struct

This commit is contained in:
veeso
2021-08-23 17:52:55 +02:00
parent 32ab0267fb
commit 92b081c076
10 changed files with 296 additions and 219 deletions

View File

@@ -707,13 +707,16 @@ impl FileTransferActivity {
target_os = "macos",
target_os = "linux"
))]
if let Some(pex) = dir.unix_pex {
if let Err(err) = self.host.chmod(local_dir_path.as_path(), pex) {
if let Some((owner, group, others)) = dir.unix_pex {
if let Err(err) = self.host.chmod(
local_dir_path.as_path(),
(owner.as_byte(), group.as_byte(), others.as_byte()),
) {
self.log(
LogLevel::Error,
format!(
"Could not apply file mode {:?} to \"{}\": {}",
pex,
(owner.as_byte(), group.as_byte(), others.as_byte()),
local_dir_path.display(),
err
),
@@ -874,13 +877,16 @@ impl FileTransferActivity {
target_os = "macos",
target_os = "linux"
))]
if let Some(pex) = remote.unix_pex {
if let Err(err) = self.host.chmod(local, pex) {
if let Some((owner, group, others)) = remote.unix_pex {
if let Err(err) = self
.host
.chmod(local, (owner.as_byte(), group.as_byte(), others.as_byte()))
{
self.log(
LogLevel::Error,
format!(
"Could not apply file mode {:?} to \"{}\": {}",
pex,
(owner.as_byte(), group.as_byte(), others.as_byte()),
local.display(),
err
),