From d351a8b6be8bdfb99972e9690f8dec91043dc7d1 Mon Sep 17 00:00:00 2001 From: DragonSlayer_14 Date: Wed, 26 Aug 2026 18:53:16 +0200 Subject: [PATCH 1/4] Fix: Passt LICENSE an --- LICENSE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 866a4a7..8defb59 100644 --- a/LICENSE +++ b/LICENSE @@ -208,8 +208,8 @@ If you develop a new program, and you want it to be of the greatest possible use To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found. - DockerUpdater - Copyright (C) 2026 Linuxapps + config + Copyright (C) 2026 Rust-Crates This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -221,7 +221,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - DockerUpdater Copyright (C) 2026 Linuxapps + config Copyright (C) 2026 Rust-Crates This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. From bf32d82ae73e2244a81593b65015658311ab08fe Mon Sep 17 00:00:00 2001 From: DragonSlayer_14 Date: Wed, 26 Aug 2026 19:13:36 +0200 Subject: [PATCH 2/4] Feat: Ersetzt is_run_as_root durch die Implementation von Crate sudo_ctdra --- Cargo.lock | 11 ++++++++++- Cargo.toml | 2 +- src/lib.rs | 23 +---------------------- 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2179f7..2983cb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,8 +13,8 @@ name = "config-ctdra" version = "1.0.2" dependencies = [ "confy", - "libc", "serde", + "sudo-ctdra", ] [[package]] @@ -141,6 +141,15 @@ dependencies = [ "serde_core", ] +[[package]] +name = "sudo-ctdra" +version = "1.0.0" +source = "sparse+https://gitea.creative-dragonslayer.de/api/packages/Rust-Crates/cargo/" +checksum = "2c2746122bbe36f821de70db3ca4ad24edfb77118fc6a6bc7693082b50d23e5f" +dependencies = [ + "libc", +] + [[package]] name = "syn" version = "3.0.4" diff --git a/Cargo.toml b/Cargo.toml index 455f119..3426470 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ description = "Einfache, threadsichere Konfigurationsverwaltung für Rust mit au [dependencies] confy = "2.0.0" serde = { version = "1.0.229", features = ["derive"] } -libc = "1.0.0-alpha.4" +sudo-ctdra = { version = "1.0.0", registry = "gitea" } [profile.release] debug = "none" diff --git a/src/lib.rs b/src/lib.rs index b46990c..8473b72 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -36,6 +36,7 @@ use std::sync::{OnceLock, RwLock}; pub use confy::ConfyError; use serde::de::DeserializeOwned; use serde::Serialize; +use sudo_ctdra::is_run_as_root; /// Optionaler benutzerdefinierter Programmname für die Konfigurationspfade. static PROGRAM_NAME: OnceLock>> = OnceLock::new(); @@ -56,28 +57,6 @@ static GLOBAL_CONFIGS: OnceLock bool { - #[cfg(target_os = "windows")] - { - std::process::Command::new("net") - .args(["session"]) - .output() - .map(|output| output.status.success()) - .unwrap_or(false) - } - - #[cfg(not(target_os = "windows"))] - { - unsafe { libc::geteuid() == 0 } - } -} - /// Setzt den Programmnamen für die Pfadermittlung explizit. pub fn set_program_name(name: impl Into) { let lock = PROGRAM_NAME.get_or_init(|| RwLock::new(None)); From 1c99387d6faefe7db196c23c693e0276680be9ee Mon Sep 17 00:00:00 2001 From: DragonSlayer_14 Date: Wed, 26 Aug 2026 19:14:30 +0200 Subject: [PATCH 3/4] Feat: Ersetzt is_run_as_root durch die Implementation von Crate sudo_ctdra --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2983cb7..a17d98f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,7 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "config-ctdra" -version = "1.0.2" +version = "1.0.3" dependencies = [ "confy", "serde", diff --git a/Cargo.toml b/Cargo.toml index 3426470..81e1e1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "config-ctdra" -version = "1.0.2" +version = "1.0.3" edition = "2024" authors = ['DragonSlayer_14'] readme = "README.md" From 439ccd60d414e89c910d57fc67e8890f0d5ee461 Mon Sep 17 00:00:00 2001 From: DragonSlayer_14 Date: Wed, 26 Aug 2026 19:14:30 +0200 Subject: [PATCH 4/4] Feat: Hebt Version auf 1.0.3 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2983cb7..a17d98f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,7 +10,7 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "config-ctdra" -version = "1.0.2" +version = "1.0.3" dependencies = [ "confy", "serde", diff --git a/Cargo.toml b/Cargo.toml index 3426470..81e1e1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "config-ctdra" -version = "1.0.2" +version = "1.0.3" edition = "2024" authors = ['DragonSlayer_14'] readme = "README.md"