Scope enrollment membership migration and use pull-only deployed gateway
This commit is contained in:
@@ -98,14 +98,21 @@ impl UpdateArtifacts {
|
||||
hasher: Sha256::new(),
|
||||
})
|
||||
}
|
||||
pub(crate) fn verified_file(&self, tenant: Uuid, hash: &str, bytes: u64) -> Result<File> {
|
||||
fn open_object(&self, tenant: Uuid, hash: &str, bytes: u64) -> Result<(File, fs::Metadata)> {
|
||||
ensure!(descriptor(hash, bytes), "bounded update object descriptor");
|
||||
let parent = self.parent(tenant)?;
|
||||
let mut file = OpenOptions::new()
|
||||
let file = OpenOptions::new()
|
||||
.read(true)
|
||||
.custom_flags(libc::O_NOFOLLOW | libc::O_CLOEXEC)
|
||||
.open(parent.join(hash))?;
|
||||
let before = regular(&file, self.owner, bytes)?;
|
||||
let metadata = regular(&file, self.owner, bytes)?;
|
||||
Ok((file, metadata))
|
||||
}
|
||||
pub(crate) fn available(&self, tenant: Uuid, hash: &str, bytes: u64) -> Result<()> {
|
||||
self.open_object(tenant, hash, bytes).map(|_| ())
|
||||
}
|
||||
pub(crate) fn verified_file(&self, tenant: Uuid, hash: &str, bytes: u64) -> Result<File> {
|
||||
let (mut file, before) = self.open_object(tenant, hash, bytes)?;
|
||||
let mut hasher = Sha256::new();
|
||||
let mut buffer = [0_u8; 32768];
|
||||
let mut seen = 0;
|
||||
|
||||
Reference in New Issue
Block a user