[Pkg-freeipa-devel] Bug#1037345: 389-ds-base: ftbfs with rust-base64 0.21

plugwash plugwash-urgent at p10link.net
Sun Jun 11 20:29:48 BST 2023


Package: 389-ds-base
Version: 2.3.1+dfsg1-1
Tags: trixie, sid, ftbfs

389-ds-base FTBFS with the new version of rust-base64.

I attach a patch which makes the package build, and also fixes some 
packaging annoyances. I have not tested it beyond that. I may or may not 
NMU this later.
-------------- next part --------------
diff -Nru 389-ds-base-2.3.1+dfsg1/debian/changelog 389-ds-base-2.3.1+dfsg1/debian/changelog
--- 389-ds-base-2.3.1+dfsg1/debian/changelog	2023-01-24 11:21:19.000000000 +0000
+++ 389-ds-base-2.3.1+dfsg1/debian/changelog	2023-06-11 13:22:07.000000000 +0000
@@ -1,3 +1,13 @@
+389-ds-base (2.3.1+dfsg1-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add patch for base64 0.21
+  * Make Debian dependency on base64 match cargo dependency.
+  * Improve clean target.
+  * Use ln -fs instead of ln -s to allow resuming build after fixing errors.
+
+ -- Peter Michael Green <plugwash at debian.org>  Sun, 11 Jun 2023 13:22:07 +0000
+
 389-ds-base (2.3.1+dfsg1-1) unstable; urgency=medium
 
   * Repackage the source, filter vendored crates and allow building with
diff -Nru 389-ds-base-2.3.1+dfsg1/debian/control 389-ds-base-2.3.1+dfsg1/debian/control
--- 389-ds-base-2.3.1+dfsg1/debian/control	2023-01-24 11:21:16.000000000 +0000
+++ 389-ds-base-2.3.1+dfsg1/debian/control	2023-06-11 13:22:07.000000000 +0000
@@ -27,7 +27,7 @@
  libpci-dev,
  libpcre2-dev,
  libperl-dev,
- librust-base64-dev,
+ librust-base64-0.21-dev,
  librust-cbindgen-dev,
  librust-cc-dev,
  librust-crossbeam-dev,
diff -Nru 389-ds-base-2.3.1+dfsg1/debian/patches/base64-0.21.diff 389-ds-base-2.3.1+dfsg1/debian/patches/base64-0.21.diff
--- 389-ds-base-2.3.1+dfsg1/debian/patches/base64-0.21.diff	1970-01-01 00:00:00.000000000 +0000
+++ 389-ds-base-2.3.1+dfsg1/debian/patches/base64-0.21.diff	2023-06-11 13:22:07.000000000 +0000
@@ -0,0 +1,65 @@
+Description: update for base64 0.21
+Author: Peter Michael Green <plugwash at debian.org>
+
+Index: 389-ds-base-2.3.1+dfsg1.new/src/plugins/pwdchan/src/lib.rs
+===================================================================
+--- 389-ds-base-2.3.1+dfsg1.new.orig/src/plugins/pwdchan/src/lib.rs
++++ 389-ds-base-2.3.1+dfsg1.new/src/plugins/pwdchan/src/lib.rs
+@@ -42,6 +42,12 @@ macro_rules! ab64_to_b64 {
+     }};
+ }
+ 
++use base64::engine::GeneralPurpose;
++use base64::engine::GeneralPurposeConfig;
++use base64::Engine;
++use base64::alphabet;
++static BASE64CONFIG: GeneralPurposeConfig = GeneralPurposeConfig::new().with_decode_allow_trailing_bits(true);
++static BASE64ENGINE: GeneralPurpose = GeneralPurpose::new(&alphabet::STANDARD,BASE64CONFIG);
+ impl PwdChanCrypto {
+     #[inline(always)]
+     fn pbkdf2_decompose(encrypted: &str) -> Result<(usize, Vec<u8>, Vec<u8>), PluginError> {
+@@ -62,7 +68,7 @@ impl PwdChanCrypto {
+             .ok_or(PluginError::MissingValue)
+             .and_then(|ab64| {
+                 let s = ab64_to_b64!(ab64);
+-                base64::decode_config(&s, base64::STANDARD.decode_allow_trailing_bits(true))
++                BASE64ENGINE.decode(&s)
+                     .map_err(|e| {
+                         log_error!(ErrorLevel::Error, "Invalid Base 64 {} -> {:?}", s, e);
+                         PluginError::InvalidBase64
+@@ -74,7 +80,7 @@ impl PwdChanCrypto {
+             .ok_or(PluginError::MissingValue)
+             .and_then(|ab64| {
+                 let s = ab64_to_b64!(ab64);
+-                base64::decode_config(&s, base64::STANDARD.decode_allow_trailing_bits(true))
++                BASE64ENGINE.decode(&s)
+                     .map_err(|e| {
+                         log_error!(ErrorLevel::Error, "Invalid Base 64 {} -> {:?}", s, e);
+                         PluginError::InvalidBase64
+@@ -152,11 +158,11 @@ impl PwdChanCrypto {
+             PluginError::Format
+         })?;
+         // the base64 salt
+-        base64::encode_config_buf(&salt, base64::STANDARD, &mut output);
++        BASE64ENGINE.encode_string(&salt, &mut output);
+         // Push the delim
+         output.push_str("$");
+         // Finally the base64 hash
+-        base64::encode_config_buf(&hash_input, base64::STANDARD, &mut output);
++        BASE64ENGINE.encode_string(&hash_input, &mut output);
+         // Return it
+         Ok(output)
+     }
+Index: 389-ds-base-2.3.1+dfsg1.new/src/plugins/pwdchan/Cargo.toml
+===================================================================
+--- 389-ds-base-2.3.1+dfsg1.new.orig/src/plugins/pwdchan/Cargo.toml
++++ 389-ds-base-2.3.1+dfsg1.new/src/plugins/pwdchan/Cargo.toml
+@@ -17,7 +17,7 @@ paste = "1.*"
+ slapi_r_plugin = { path="../../slapi_r_plugin" }
+ uuid = { version = "0.8", features = [ "v4" ] }
+ openssl = { version = "0.10" }
+-base64 = "0.13"
++base64 = "0.21"
+ 
+ [build-dependencies]
+ cc = { version = "1.0", features = ["parallel"] }
diff -Nru 389-ds-base-2.3.1+dfsg1/debian/patches/series 389-ds-base-2.3.1+dfsg1/debian/patches/series
--- 389-ds-base-2.3.1+dfsg1/debian/patches/series	2023-01-24 11:21:16.000000000 +0000
+++ 389-ds-base-2.3.1+dfsg1/debian/patches/series	2023-06-11 13:22:07.000000000 +0000
@@ -3,3 +3,4 @@
 dont-run-rpm.diff
 use-packaged-rust-registry.diff
 allow-newer-crates.diff
+base64-0.21.diff
diff -Nru 389-ds-base-2.3.1+dfsg1/debian/rules 389-ds-base-2.3.1+dfsg1/debian/rules
--- 389-ds-base-2.3.1+dfsg1/debian/rules	2023-01-24 11:21:16.000000000 +0000
+++ 389-ds-base-2.3.1+dfsg1/debian/rules	2023-06-11 13:22:07.000000000 +0000
@@ -24,6 +24,10 @@
 	rm -rf src/lib389/build src/lib389/lib389.egg-info
 	find src/lib389/ -name '__pycache__' -exec rm -rf '{}' ';'
 	rm -f src/lib389/man/*.8
+	rm -f ldap/admin/src/*.inf rust-nsslapd-private.h src/Cargo.lock 
+	rm -f wrappers/dirsrv-snmp.service wrappers/dirsrv.target wrappers/dirsrv at .service wrappers/dirsrv at .service.d/custom.conf wrappers/ds_selinux_restorecon.sh wrappers/ds_systemd_ask_password_acl
+	rm -f debian/vendor/*-*
+	rm -f config.sub config.guess
 
 override_dh_auto_configure:
 	dh_auto_configure -- \
@@ -41,7 +45,7 @@
 		--enable-rust-offline
 
 	(cd debian/vendor && for i in `ls /usr/share/cargo/registry`; do \
-	  ln -s /usr/share/cargo/registry/$$i .; done)
+	  ln -fs /usr/share/cargo/registry/$$i .; done)
 
 override_dh_auto_build:
 	(cd src/lib389 && python3 setup.py build)


More information about the Pkg-freeipa-devel mailing list