From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <pdm-devel-bounces@lists.proxmox.com> Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id EB7D41FF164 for <inbox@lore.proxmox.com>; Fri, 11 Apr 2025 14:06:09 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 184A918D7F; Fri, 11 Apr 2025 14:06:05 +0200 (CEST) From: Lukas Wagner <l.wagner@proxmox.com> To: pdm-devel@lists.proxmox.com Date: Fri, 11 Apr 2025 14:05:27 +0200 Message-Id: <20250411120527.261675-1-l.wagner@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.138 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_2 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_4 0.1 random spam to be learned in bayes RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox-datacenter-manager-daily-update.rs, main.rs, tfa.rs, proxmox-datacenter-privileged-api.rs] Subject: [pdm-devel] [PATCH proxmox-datacenter-manager] clippy: don't `Clone::clone` CreateOptions, use `Copy` X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion <pdm-devel.lists.proxmox.com> List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pdm-devel>, <mailto:pdm-devel-request@lists.proxmox.com?subject=unsubscribe> List-Archive: <http://lists.proxmox.com/pipermail/pdm-devel/> List-Post: <mailto:pdm-devel@lists.proxmox.com> List-Help: <mailto:pdm-devel-request@lists.proxmox.com?subject=help> List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel>, <mailto:pdm-devel-request@lists.proxmox.com?subject=subscribe> Reply-To: Proxmox Datacenter Manager development discussion <pdm-devel@lists.proxmox.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" <pdm-devel-bounces@lists.proxmox.com> proxmox-sys 0.6.6 now derives Copy for CreateOptions, we should use it to silence some clippy warnings. Signed-off-by: Lukas Wagner <l.wagner@proxmox.com> --- Cargo.toml | 2 +- debian/control | 8 ++++---- lib/pdm-config/src/config_version_cache.rs | 2 +- server/src/auth/tfa.rs | 7 ++++--- server/src/bin/proxmox-datacenter-api/main.rs | 13 +++++-------- .../bin/proxmox-datacenter-manager-daily-update.rs | 5 +---- server/src/bin/proxmox-datacenter-privileged-api.rs | 13 +++++-------- 7 files changed, 21 insertions(+), 29 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f66254d6..6e16831e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ proxmox-shared-memory = "0.3.0" proxmox-simple-config = "0.1" proxmox-sortable-macro = "0.1.2" proxmox-subscription = { version = "0.5", features = [ "api-types"], default-features = false } -proxmox-sys = "0.6.0" +proxmox-sys = "0.6.6" proxmox-systemd = "0.1" proxmox-tfa = { version = "5", features = [ "api-types" ], default-features = false } proxmox-time = "2" diff --git a/debian/control b/debian/control index 3e0b18ba..8241c405 100644 --- a/debian/control +++ b/debian/control @@ -74,10 +74,10 @@ Build-Depends: cargo:native, librust-proxmox-sortable-macro-0.1+default-dev (>= 0.1.2-~~), librust-proxmox-subscription-0.5+api-types-dev, librust-proxmox-subscription-0.5+impl-dev, - librust-proxmox-sys-0.6+acl-dev, - librust-proxmox-sys-0.6+crypt-dev, - librust-proxmox-sys-0.6+default-dev, - librust-proxmox-sys-0.6+timer-dev, + librust-proxmox-sys-0.6+acl-dev (>= 0.6.6-~~), + librust-proxmox-sys-0.6+crypt-dev (>= 0.6.6-~~), + librust-proxmox-sys-0.6+default-dev (>= 0.6.6-~~), + librust-proxmox-sys-0.6+timer-dev (>= 0.6.6-~~), librust-proxmox-syslog-api-0.1+default-dev, librust-proxmox-syslog-api-0.1+impl-dev, librust-proxmox-systemd-0.1+default-dev, diff --git a/lib/pdm-config/src/config_version_cache.rs b/lib/pdm-config/src/config_version_cache.rs index 5c4b61a0..36a6a778 100644 --- a/lib/pdm-config/src/config_version_cache.rs +++ b/lib/pdm-config/src/config_version_cache.rs @@ -112,7 +112,7 @@ impl ConfigVersionCache { let file_path = Path::new(FILE_PATH); let dir_path = file_path.parent().unwrap(); - create_path(dir_path, Some(dir_opts.clone()), Some(dir_opts))?; + create_path(dir_path, Some(dir_opts), Some(dir_opts))?; let file_opts = CreateOptions::new() .perm(Mode::from_bits_truncate(0o660)) diff --git a/server/src/auth/tfa.rs b/server/src/auth/tfa.rs index fe7cd52a..66d3c1d3 100644 --- a/server/src/auth/tfa.rs +++ b/server/src/auth/tfa.rs @@ -208,14 +208,15 @@ impl proxmox_tfa::api::OpenUserChallengeData for UserAccess { /// if it does not exist), and keep a lock on the file. fn open(&self, userid: &str) -> Result<Box<dyn UserChallengeAccess>, Error> { let options = CreateOptions::new().perm(Mode::from_bits_truncate(0o0600)); - proxmox_sys::fs::create_path(CHALLENGE_DATA_PATH, Some(options.clone()), Some(options)) - .map_err(|err| { + proxmox_sys::fs::create_path(CHALLENGE_DATA_PATH, Some(options), Some(options)).map_err( + |err| { format_err!( "failed to crate challenge data dir {:?}: {}", CHALLENGE_DATA_PATH, err ) - })?; + }, + )?; let path = challenge_data_path_str(userid); diff --git a/server/src/bin/proxmox-datacenter-api/main.rs b/server/src/bin/proxmox-datacenter-api/main.rs index 25852c8c..ad1dc66d 100644 --- a/server/src/bin/proxmox-datacenter-api/main.rs +++ b/server/src/bin/proxmox-datacenter-api/main.rs @@ -174,23 +174,20 @@ async fn run(debug: bool) -> Result<(), Error> { //.register_template("console", "/usr/share/pve-xtermjs/index.html.hbs")? .enable_access_log( pdm_buildcfg::API_ACCESS_LOG_FN, - Some(dir_opts.clone()), - Some(file_opts.clone()), + Some(dir_opts), + Some(file_opts), &mut command_sock, )? .enable_auth_log( pdm_buildcfg::API_AUTH_LOG_FN, - Some(dir_opts.clone()), - Some(file_opts.clone()), + Some(dir_opts), + Some(file_opts), &mut command_sock, )?; let rest_server = RestServer::new(config); let redirector = proxmox_rest_server::Redirector::new(); - proxmox_rest_server::init_worker_tasks( - pdm_buildcfg::PDM_LOG_DIR_M!().into(), - file_opts.clone(), - )?; + proxmox_rest_server::init_worker_tasks(pdm_buildcfg::PDM_LOG_DIR_M!().into(), file_opts)?; //openssl req -x509 -newkey rsa:4096 -keyout /etc/proxmox-backup/api.key -out /etc/proxmox-backup/api.pem -nodes diff --git a/server/src/bin/proxmox-datacenter-manager-daily-update.rs b/server/src/bin/proxmox-datacenter-manager-daily-update.rs index 883f7ac4..43ad5383 100644 --- a/server/src/bin/proxmox-datacenter-manager-daily-update.rs +++ b/server/src/bin/proxmox-datacenter-manager-daily-update.rs @@ -94,10 +94,7 @@ async fn check_acme_certificates(rpcenv: &mut dyn RpcEnvironment) -> Result<(), async fn run(rpcenv: &mut dyn RpcEnvironment) -> Result<(), Error> { let api_user = pdm_config::api_user()?; let file_opts = CreateOptions::new().owner(api_user.uid).group(api_user.gid); - proxmox_rest_server::init_worker_tasks( - pdm_buildcfg::PDM_LOG_DIR_M!().into(), - file_opts.clone(), - )?; + proxmox_rest_server::init_worker_tasks(pdm_buildcfg::PDM_LOG_DIR_M!().into(), file_opts)?; let mut command_sock = proxmox_daemon::command_socket::CommandSocket::new(api_user.gid); proxmox_rest_server::register_task_control_commands(&mut command_sock)?; diff --git a/server/src/bin/proxmox-datacenter-privileged-api.rs b/server/src/bin/proxmox-datacenter-privileged-api.rs index 0e23a5f1..a9b5c5e8 100644 --- a/server/src/bin/proxmox-datacenter-privileged-api.rs +++ b/server/src/bin/proxmox-datacenter-privileged-api.rs @@ -126,22 +126,19 @@ async fn run() -> Result<(), Error> { .formatted_router(&["api2"], &server::api::ROUTER) .enable_access_log( pdm_buildcfg::API_ACCESS_LOG_FN, - Some(dir_opts.clone()), - Some(file_opts.clone()), + Some(dir_opts), + Some(file_opts), &mut command_sock, )? .enable_auth_log( pdm_buildcfg::API_AUTH_LOG_FN, - Some(dir_opts.clone()), - Some(file_opts.clone()), + Some(dir_opts), + Some(file_opts), &mut command_sock, )?; let rest_server = RestServer::new(config); - proxmox_rest_server::init_worker_tasks( - pdm_buildcfg::PDM_LOG_DIR_M!().into(), - file_opts.clone(), - )?; + proxmox_rest_server::init_worker_tasks(pdm_buildcfg::PDM_LOG_DIR_M!().into(), file_opts)?; let server = proxmox_daemon::server::create_daemon( std::os::unix::net::SocketAddr::from_pathname(pdm_buildcfg::PDM_PRIVILEGED_API_SOCKET_FN) -- 2.39.5 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel