mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
feat: Default to no owner for rsync (#2230)
This commit is contained in:
@@ -429,6 +429,7 @@ async fn migrate(
|
|||||||
ignore_existing: false,
|
ignore_existing: false,
|
||||||
exclude: Vec::new(),
|
exclude: Vec::new(),
|
||||||
no_permissions: false,
|
no_permissions: false,
|
||||||
|
no_owner: false,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
@@ -441,6 +442,7 @@ async fn migrate(
|
|||||||
ignore_existing: false,
|
ignore_existing: false,
|
||||||
exclude: vec!["tmp".to_owned()],
|
exclude: vec!["tmp".to_owned()],
|
||||||
no_permissions: false,
|
no_permissions: false,
|
||||||
|
no_owner: false,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
@@ -306,6 +306,7 @@ async fn sync_boot() -> Result<(), Error> {
|
|||||||
ignore_existing: false,
|
ignore_existing: false,
|
||||||
exclude: Vec::new(),
|
exclude: Vec::new(),
|
||||||
no_permissions: false,
|
no_permissions: false,
|
||||||
|
no_owner: false,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
.await?
|
.await?
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ pub struct RsyncOptions {
|
|||||||
pub exclude: Vec<String>,
|
pub exclude: Vec<String>,
|
||||||
#[serde(default = "const_true")]
|
#[serde(default = "const_true")]
|
||||||
pub no_permissions: bool,
|
pub no_permissions: bool,
|
||||||
|
#[serde(default = "const_true")]
|
||||||
|
pub no_owner: bool,
|
||||||
}
|
}
|
||||||
impl Default for RsyncOptions {
|
impl Default for RsyncOptions {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
@@ -32,6 +34,7 @@ impl Default for RsyncOptions {
|
|||||||
ignore_existing: false,
|
ignore_existing: false,
|
||||||
exclude: Vec::new(),
|
exclude: Vec::new(),
|
||||||
no_permissions: false,
|
no_permissions: false,
|
||||||
|
no_owner: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,6 +64,9 @@ impl Rsync {
|
|||||||
if options.no_permissions {
|
if options.no_permissions {
|
||||||
cmd.arg("--no-perms");
|
cmd.arg("--no-perms");
|
||||||
}
|
}
|
||||||
|
if options.no_owner {
|
||||||
|
cmd.arg("--no-owner");
|
||||||
|
}
|
||||||
for exclude in options.exclude {
|
for exclude in options.exclude {
|
||||||
cmd.arg(format!("--exclude={}", exclude));
|
cmd.arg(format!("--exclude={}", exclude));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user