Ship the corrected bundled SQLite in device components and pinned builds

This commit is contained in:
2026-11-18 10:08:01 +01:00
parent 3e6ce7f07c
commit db2f5b407d
12 changed files with 100 additions and 145 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ uuid.workspace = true
rmm-domain = { path = "../domain" }
rmm-protocol = { path = "../protocol" }
rmm-updater-handoff = { path = "../updater-handoff" }
rusqlite = { version = "0.32.1", features = ["bundled"] }
rusqlite.workspace = true
ed25519-dalek = "=2.2.0"
[dev-dependencies]
+1 -1
View File
@@ -43,7 +43,7 @@ rmm-updater = { path = "../updater" }
hex.workspace = true
ed25519-dalek = "=2.2.0"
rmm-update-history = { path = "../update-history" }
rusqlite = { version = "0.32.1", features = ["bundled"] }
rusqlite.workspace = true
fs2 = "0.4.3"
x509-parser = { version = "=0.18.1", features = ["verify"] }
rcgen = { version = "=0.14.10", default-features = false, features = ["crypto", "ring", "pem"] }
+1 -1
View File
@@ -21,7 +21,7 @@ sha2.workspace = true
tokio.workspace = true
tokio-tungstenite.workspace = true
uuid.workspace = true
rusqlite = { version = "0.32.1", features = ["bundled"] }
rusqlite.workspace = true
fs2 = "0.4.3"
rmm-domain = { path = "../domain" }
rmm-protocol = { path = "../protocol" }
+5 -1
View File
@@ -5,5 +5,9 @@ edition.workspace = true
license.workspace = true
[dependencies]
anyhow.workspace = true
sqlx.workspace = true
# Use the PostgreSQL driver directly. SQLx 0.8's generic migration and type
# features also resolve the obsolete SQLite driver in the shared lockfile.
sqlx = { package = "sqlx-core", version = "=0.8.6", features = ["migrate", "_rt-tokio", "_tls-rustls-ring-webpki"] }
sqlx-macros = { version = "=0.8.6", features = ["migrate"] }
sqlx-postgres = { version = "=0.8.6", features = ["migrate", "chrono", "uuid", "json"] }
uuid.workspace = true
+6 -5
View File
@@ -1,17 +1,18 @@
use anyhow::{Result, ensure};
use sqlx::{PgPool, Postgres, Transaction};
use sqlx::{query::query, query_scalar::query_scalar};
use sqlx_postgres::{PgPool, PgTransaction};
use uuid::Uuid;
pub async fn tenant_tx(pool: &PgPool, tenant: Uuid) -> Result<Transaction<'_, Postgres>> {
pub async fn tenant_tx(pool: &PgPool, tenant: Uuid) -> Result<PgTransaction<'_>> {
let mut tx = pool.begin().await?;
sqlx::query("SELECT set_config('app.tenant_id', $1, true)")
query("SELECT set_config('app.tenant_id', $1, true)")
.bind(tenant.to_string())
.execute(&mut *tx)
.await?;
Ok(tx)
}
pub async fn verify_application_role(pool: &PgPool) -> Result<()> {
let unsafe_role: bool = sqlx::query_scalar(
let unsafe_role: bool = query_scalar(
"SELECT rolsuper OR rolbypassrls OR EXISTS (SELECT 1 FROM pg_tables WHERE schemaname='public' AND tableowner=current_user) FROM pg_roles WHERE rolname=current_user",
).fetch_one(pool).await?;
ensure!(
@@ -22,7 +23,7 @@ pub async fn verify_application_role(pool: &PgPool) -> Result<()> {
}
pub async fn migrate(url: &str) -> Result<()> {
let pool = PgPool::connect(url).await?;
sqlx::migrate!("../../migrations").run(&pool).await?;
sqlx_macros::migrate!("../../migrations").run(&pool).await?;
pool.close().await;
Ok(())
}
+1 -1
View File
@@ -15,7 +15,7 @@ serde_json.workspace = true
uuid.workspace = true
libc = "0.2.177"
fs2 = "0.4.3"
rusqlite = { version = "0.32.1", features = ["bundled"] }
rusqlite.workspace = true
rmm-domain = { path = "../domain" }
rmm-agent-linux = { path = "../agent-linux" }
+1 -1
View File
@@ -11,7 +11,7 @@ hex.workspace = true
serde_json.workspace = true
uuid.workspace = true
ed25519-dalek = "=2.2.0"
rusqlite = { version = "0.32.1", features = ["bundled"] }
rusqlite.workspace = true
rmm-domain = { path = "../domain" }
rmm-agent-core = { path = "../agent-core" }
rmm-updater = { path = "../updater" }
+1 -1
View File
@@ -16,7 +16,7 @@ serde.workspace = true
serde_json.workspace = true
uuid.workspace = true
libc = "0.2.177"
rusqlite = { version = "0.32.1", features = ["bundled"] }
rusqlite.workspace = true
ed25519-dalek = "=2.2.0"
base64 = "=0.22.1"
rmm-domain = { path = "../domain" }