From patchwork Mon Oct 4 19:09:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: morganamilo X-Patchwork-Id: 1978 Return-Path: Delivered-To: patchwork@archlinux.org Received: from mail.archlinux.org [95.216.189.61] by patchwork.archlinux.org with IMAP (fetchmail-6.4.22) for (single-drop); Mon, 04 Oct 2021 19:10:19 +0000 (UTC) Received: from mail.archlinux.org by mail.archlinux.org with LMTP id 6KS4CptRW2Hx+AEAK+/4rw (envelope-from ) for ; Mon, 04 Oct 2021 19:10:19 +0000 Received: from lists.archlinux.org (lists.archlinux.org [IPv6:2a01:4f9:c010:9eb4::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.archlinux.org (Postfix) with ESMTPS id 6AC5698CA39; Mon, 4 Oct 2021 19:10:18 +0000 (UTC) Received: from lists.archlinux.org (localhost [IPv6:::1]) by lists.archlinux.org (Postfix) with ESMTP id 281E18B14C3; Mon, 4 Oct 2021 19:10:18 +0000 (UTC) X-Original-To: pacman-dev@lists.archlinux.org Delivered-To: pacman-dev@lists.archlinux.org Received: from mail.archlinux.org (mail.archlinux.org [IPv6:2a01:4f9:c010:3052::1]) by lists.archlinux.org (Postfix) with ESMTPS id C9B2F8B14BB for ; Mon, 4 Oct 2021 19:10:15 +0000 (UTC) From: morganamilo DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-rsa; t=1633374615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=UUgImq+jHR3L9WfwHpUusqueEvhCoDOFZG469hbs4wQ=; b=sokUA82DMoBqNeOHa4ORRr7G7SH1BFN8g1t7c98+jN2lwWBtBbV2Ju3UkU+CkArsYv1A9T BDWDCLEZ/m3GkUAbaRCd2eO8nRamlZiZ5hIm6DsQrqHzSzoKVYlWpY69383fbk0YZeB3RT N1Gv82R7ssVUz+thesrle1golC/MQZnqh55w3INEPfUsVVZO7w4AGNbXu/T+toq/yOjseL +2r7ZpthgPRjyaKar8yEN3KuEuTSbtz3dx+K5qAgF9AvV3khUYsFuYqDqHmp6fOVf4naqG GRNiJXxruwPqKTEH//ykgZdAoVhXk7iA7T17/WbxbNLLBi5YNzJM22QTcxwM0+Ugte/Abt erUkvOl0tSwNkgy4YGIjNd4WkbAQ4uxDkh7MYvye8mlcmTFg5wwfvUdoZWlLKpYeTxswVo 3sh4RRDkQ64YosWQ4Xl+YFaV7ulxcWub2UQISb5J73DvJMmByB3P8jJ16GTVz4+KfAbjhJ 5ZHtfOor+OYcqvNONr6bW1EFc2GQ7KvyQ9a+ZSA/V6Y6uRULeQ4YwL8oIEwYujrDFFnK7u yaLIFaV+5+ocBfHZbjv5gwO/maF+ip4vTFpXjZgYU8+YE68FN15fVSL9IzncedHCJ6wdXP +plmxZxIzMRm3VJKYCJzF+ZqC4eGA682SUUxy+Qb2KplXtmEjaj2I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=archlinux.org; s=dkim-ed25519; t=1633374615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=UUgImq+jHR3L9WfwHpUusqueEvhCoDOFZG469hbs4wQ=; b=ZVmRFI8hV5sz6KX77dQHiCZi0kJkiB7kjvdWl8HBYHkSwKglGHyGzsfSfHCBp6vARGDISw NwmSDr1Hd9QEvbBw== To: pacman-dev@lists.archlinux.org Cc: morganamilo Subject: [PATCH] alpm: return -1 for error in find_dl_candidates Date: Mon, 4 Oct 2021 20:09:55 +0100 Message-Id: <20211004190954.2116002-1-morganamilo@archlinux.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-BeenThere: pacman-dev@lists.archlinux.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: pacman-dev-bounces@lists.archlinux.org Sender: "pacman-dev" Authentication-Results: mail.archlinux.org; dkim=pass header.d=archlinux.org header.s=dkim-rsa header.b=sokUA82D; dkim=pass header.d=archlinux.org header.s=dkim-ed25519 header.b=ZVmRFI8h; dmarc=pass (policy=none) header.from=archlinux.org; spf=pass (mail.archlinux.org: domain of pacman-dev-bounces@lists.archlinux.org designates 2a01:4f9:c010:9eb4::1 as permitted sender) smtp.mailfrom=pacman-dev-bounces@lists.archlinux.org X-Rspamd-Queue-Id: 6AC5698CA39 X-Spamd-Result: default: False [-2.61 / 15.00]; DWL_DNSWL_MED(-2.00)[archlinux.org:dkim]; MID_CONTAINS_FROM(1.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; R_MISSING_CHARSET(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[archlinux.org,none]; RCVD_IN_DNSWL_MED(-0.40)[2a01:4f9:c010:9eb4::1:from,2a01:4f9:c010:3052::1:received]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f9:c010:9eb4::1:c]; R_DKIM_ALLOW(-0.20)[archlinux.org:s=dkim-rsa,archlinux.org:s=dkim-ed25519]; MAILLIST(-0.20)[mailman]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f9::/32, country:DE]; DKIM_TRACE(0.00)[archlinux.org:+]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FROM_NEQ_ENVFROM(0.00)[morganamilo@archlinux.org,pacman-dev-bounces@lists.archlinux.org]; NEURAL_HAM(-0.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[pacman-dev@lists.archlinux.org]; TO_DN_SOME(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[] X-Rspamd-Server: mail.archlinux.org This is the error value generally used and the calling function explicitly checks for -1, later causing the error to be missed and the transaction to continue. > pacman -S xterm warning: xterm-369-1 is up to date -- reinstalling resolving dependencies... looking for conflicting packages... Package (1) Old Version New Version Net Change Download Size extra/xterm 369-1 369-1 0.00 MiB 0.42 MiB Total Download Size: 0.42 MiB Total Installed Size: 1.05 MiB Net Upgrade Size: 0.00 MiB :: Proceed with installation? [Y/n] error: no servers configured for repository: extra (1/1) checking keys in keyring [--------------------------------------------------------] 100% (1/1) checking package integrity [--------------------------------------------------------] 100% error: failed to commit transaction (wrong or NULL argument passed) Errors occurred, no packages were upgraded. --- lib/libalpm/sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 36ad6242..acca375e 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -732,7 +732,7 @@ static int find_dl_candidates(alpm_handle_t *handle, alpm_list_t **files) handle->pm_errno = ALPM_ERR_SERVER_NONE; _alpm_log(handle, ALPM_LOG_ERROR, "%s: %s\n", alpm_strerror(handle->pm_errno), repo->treename); - return 1; + return -1; } ASSERT(spkg->filename != NULL, RET_ERR(handle, ALPM_ERR_PKG_INVALID_NAME, -1));