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