* [pbs-devel] [PATCH bullseye proxmox-backup 1/2] update to zstd 0.6
2021-06-02 10:14 [pbs-devel] [PATCH proxmox-backup 0/2] bullseye compat Fabian Grünbichler
@ 2021-06-02 10:14 ` Fabian Grünbichler
2021-06-02 10:14 ` [pbs-devel] [PATCH bullseye proxmox-backup 2/2] d/control: set R-R-R to run binary d/rules targets as root Fabian Grünbichler
2021-06-14 11:03 ` [pbs-devel] applied: [PATCH proxmox-backup 0/2] bullseye compat Dietmar Maurer
2 siblings, 0 replies; 4+ messages in thread
From: Fabian Grünbichler @ 2021-06-02 10:14 UTC (permalink / raw)
To: pbs-devel
compatible with libzstd from bullseye.
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
d/control is autogenerated, so if conflicts arise there just ignore that
hunk..
Cargo.toml | 2 +-
debian/control | 4 ++--
src/backup/data_blob_reader.rs | 16 ++++++++--------
src/backup/data_blob_writer.rs | 14 +++++++-------
src/client/backup_reader.rs | 2 +-
5 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index 93681698..976f18bc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -78,7 +78,7 @@ url = "2.1"
walkdir = "2"
webauthn-rs = "0.2.5"
xdg = "2.2"
-zstd = { version = "0.4", features = [ "bindgen" ] }
+zstd = { version = "0.6", features = [ "bindgen" ] }
nom = "5.1"
crossbeam-channel = "0.5"
diff --git a/debian/control b/debian/control
index 5bf595b4..baa2d13f 100644
--- a/debian/control
+++ b/debian/control
@@ -81,8 +81,8 @@ Build-Depends: debhelper (>= 11),
librust-walkdir-2+default-dev,
librust-webauthn-rs-0.2+default-dev (>= 0.2.5-~~),
librust-xdg-2+default-dev (>= 2.2-~~),
- librust-zstd-0.4+bindgen-dev,
- librust-zstd-0.4+default-dev,
+ librust-zstd-0.6+bindgen-dev,
+ librust-zstd-0.6+default-dev,
libacl1-dev,
libfuse3-dev,
libsystemd-dev,
diff --git a/src/backup/data_blob_reader.rs b/src/backup/data_blob_reader.rs
index fe3a35c4..11a4613e 100644
--- a/src/backup/data_blob_reader.rs
+++ b/src/backup/data_blob_reader.rs
@@ -5,23 +5,23 @@ use proxmox::tools::io::ReadExt;
use super::*;
-enum BlobReaderState<R: Read> {
+enum BlobReaderState<'reader, R: Read> {
Uncompressed { expected_crc: u32, csum_reader: ChecksumReader<R> },
- Compressed { expected_crc: u32, decompr: zstd::stream::read::Decoder<BufReader<ChecksumReader<R>>> },
+ Compressed { expected_crc: u32, decompr: zstd::stream::read::Decoder<'reader, BufReader<ChecksumReader<R>>> },
Encrypted { expected_crc: u32, decrypt_reader: CryptReader<BufReader<ChecksumReader<R>>> },
- EncryptedCompressed { expected_crc: u32, decompr: zstd::stream::read::Decoder<BufReader<CryptReader<BufReader<ChecksumReader<R>>>>> },
+ EncryptedCompressed { expected_crc: u32, decompr: zstd::stream::read::Decoder<'reader, BufReader<CryptReader<BufReader<ChecksumReader<R>>>>> },
}
/// Read data blobs
-pub struct DataBlobReader<R: Read> {
- state: BlobReaderState<R>,
+pub struct DataBlobReader<'reader, R: Read> {
+ state: BlobReaderState<'reader, R>,
}
// zstd_safe::DCtx is not sync but we are, since
// the only public interface is on mutable reference
-unsafe impl<R: Read> Sync for DataBlobReader<R> {}
+unsafe impl<R: Read> Sync for DataBlobReader<'_, R> {}
-impl <R: Read> DataBlobReader<R> {
+impl <R: Read> DataBlobReader<'_, R> {
pub fn new(mut reader: R, config: Option<Arc<CryptConfig>>) -> Result<Self, Error> {
@@ -104,7 +104,7 @@ impl <R: Read> DataBlobReader<R> {
}
}
-impl <R: Read> Read for DataBlobReader<R> {
+impl <R: Read> Read for DataBlobReader<'_, R> {
fn read(&mut self, buf: &mut [u8]) -> Result<usize, std::io::Error> {
match &mut self.state {
diff --git a/src/backup/data_blob_writer.rs b/src/backup/data_blob_writer.rs
index 10b2813a..82bd14c6 100644
--- a/src/backup/data_blob_writer.rs
+++ b/src/backup/data_blob_writer.rs
@@ -5,19 +5,19 @@ use proxmox::tools::io::WriteExt;
use super::*;
-enum BlobWriterState<W: Write> {
+enum BlobWriterState<'writer, W: Write> {
Uncompressed { csum_writer: ChecksumWriter<W> },
- Compressed { compr: zstd::stream::write::Encoder<ChecksumWriter<W>> },
+ Compressed { compr: zstd::stream::write::Encoder<'writer, ChecksumWriter<W>> },
Encrypted { crypt_writer: CryptWriter<ChecksumWriter<W>> },
- EncryptedCompressed { compr: zstd::stream::write::Encoder<CryptWriter<ChecksumWriter<W>>> },
+ EncryptedCompressed { compr: zstd::stream::write::Encoder<'writer, CryptWriter<ChecksumWriter<W>>> },
}
/// Data blob writer
-pub struct DataBlobWriter<W: Write> {
- state: BlobWriterState<W>,
+pub struct DataBlobWriter<'writer, W: Write> {
+ state: BlobWriterState<'writer, W>,
}
-impl <W: Write + Seek> DataBlobWriter<W> {
+impl <W: Write + Seek> DataBlobWriter<'_, W> {
pub fn new_uncompressed(mut writer: W) -> Result<Self, Error> {
writer.seek(SeekFrom::Start(0))?;
@@ -133,7 +133,7 @@ impl <W: Write + Seek> DataBlobWriter<W> {
}
}
-impl <W: Write + Seek> Write for DataBlobWriter<W> {
+impl <W: Write + Seek> Write for DataBlobWriter<'_, W> {
fn write(&mut self, buf: &[u8]) -> Result<usize, std::io::Error> {
match self.state {
diff --git a/src/client/backup_reader.rs b/src/client/backup_reader.rs
index 92200f9e..7f24cb9b 100644
--- a/src/client/backup_reader.rs
+++ b/src/client/backup_reader.rs
@@ -148,7 +148,7 @@ impl BackupReader {
&self,
manifest: &BackupManifest,
name: &str,
- ) -> Result<DataBlobReader<File>, Error> {
+ ) -> Result<DataBlobReader<'_, File>, Error> {
let mut tmpfile = std::fs::OpenOptions::new()
.write(true)
--
2.30.2
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pbs-devel] [PATCH bullseye proxmox-backup 2/2] d/control: set R-R-R to run binary d/rules targets as root
2021-06-02 10:14 [pbs-devel] [PATCH proxmox-backup 0/2] bullseye compat Fabian Grünbichler
2021-06-02 10:14 ` [pbs-devel] [PATCH bullseye proxmox-backup 1/2] update to zstd 0.6 Fabian Grünbichler
@ 2021-06-02 10:14 ` Fabian Grünbichler
2021-06-14 11:03 ` [pbs-devel] applied: [PATCH proxmox-backup 0/2] bullseye compat Dietmar Maurer
2 siblings, 0 replies; 4+ messages in thread
From: Fabian Grünbichler @ 2021-06-02 10:14 UTC (permalink / raw)
To: pbs-devel
the build still requires root to make helper binaries setuid
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
d/control is autogenerated, so if conflicts arise there just ignore that
hunk..
Makefile | 2 ++
debian/control | 7 ++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 2ffd2fb8..5d361ff3 100644
--- a/Makefile
+++ b/Makefile
@@ -92,6 +92,8 @@ build:
sed -e '1,/^$$/ ! d' build/debian/control > build/debian/control.src
cat build/debian/control.src build/debian/control.in > build/debian/control
rm build/debian/control.in build/debian/control.src
+ # not yet settable via debcargo.toml, required for setuid binaries in `make install`
+ sed -i -e 's/^Rules-Requires-Root: no/Rules-Requires-Root: binary-targets/g' build/debian/control
cp build/debian/control debian/control
rm build/Cargo.lock
find build/debian -name "*.hint" -delete
diff --git a/debian/control b/debian/control
index baa2d13f..dfddca90 100644
--- a/debian/control
+++ b/debian/control
@@ -1,8 +1,8 @@
Source: rust-proxmox-backup
Section: admin
Priority: optional
-Build-Depends: debhelper (>= 11),
- dh-cargo (>= 18),
+Build-Depends: debhelper (>= 12),
+ dh-cargo (>= 24),
cargo:native,
rustc:native,
libstd-rust-dev,
@@ -106,10 +106,11 @@ Build-Depends: debhelper (>= 11),
texlive-xetex <!nodoc>,
xindy <!nodoc>
Maintainer: Proxmox Support Team <support@proxmox.com>
-Standards-Version: 4.4.1
+Standards-Version: 4.5.1
Vcs-Git: git://git.proxmox.com/git/proxmox-backup.git
Vcs-Browser: https://git.proxmox.com/?p=proxmox-backup.git;a=summary
Homepage: https://www.proxmox.com
+Rules-Requires-Root: binary-targets
Package: proxmox-backup-server
Architecture: any
--
2.30.2
^ permalink raw reply [flat|nested] 4+ messages in thread