From patchwork Thu Oct 6 17:59:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Roevens X-Patchwork-Id: 19 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4MjzwC6x7Xz3wgH for ; Thu, 6 Oct 2022 18:08:59 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Mjzw73bmsz2Yp; Thu, 6 Oct 2022 18:08:55 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Mjzw70zq0z2ysm; Thu, 6 Oct 2022 18:08:55 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Mjzw51g3sz2ySQ for ; Thu, 6 Oct 2022 18:08:53 +0000 (UTC) Received: from knopi.disroot.org (knopi.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4Mjzw417kqz1Cl for ; Thu, 6 Oct 2022 18:08:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id ECE184C92D for ; Thu, 6 Oct 2022 20:08:50 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id vQ5F4WDOwWEH for ; Thu, 6 Oct 2022 20:08:49 +0200 (CEST) Received: from chojin.sicho.home (amaterasu.sicho.home [192.168.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (no client certificate requested) (Authenticated sender) by hachiman (MailScanner Milter) with SMTP id E6E4573536 for ; Thu, 6 Oct 2022 20:00:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1665079221; bh=s6IvR0DdmKt/lew4tEkyKTqasTpVaMATV0+14+hlDx0=; h=From:To:Subject:Date; b=DogVyiAug3g4+L4yhBciX0IImEkczN8fVwJVJDmghTaeWuab1OhkOVyWmdI2DrqH0 8ZJovvWP2SVB+u/ipKxRGzrGoC/tAdvZYXAhGbrGO35F5C5vpP5xOD6JszOdIJK0jl D7KfJ/PVSr10pWs3ShCDKwlanpykhOYKyNJfN2lcb81uEn7NgPRfzQ4Bs7mwMoEEBM 9UJiqwWYbi85izhQlFouixfrEF8wj4OKi+h53BgqZSW71kD10B3JM1lHBPtjSsCQXg JIMuHn5HgifxUq/gAg39ZeftRiFTppPZ7n3SY6nPDNZwNPHdiu3NShdfxcBbC1AwBh pjj8NS7SvrUsw== From: Robin Roevens To: development@lists.ipfire.org Subject: [PATCH v2 0/5] Fix Bug#12935 + cosmetic changes/enhancements Date: Thu, 6 Oct 2022 19:59:53 +0200 Message-Id: <20221006175958.11036-1-robin.roevens@disroot.org> Mime-Version: 1.0 X-sicho-MailScanner-ID: E6E4573536.A2AA4 X-sicho-MailScanner: Found to be clean X-sicho-MailScanner-From: robin.roevens@disroot.org X-sicho-MailScanner-Watermark: 1665684008.75435@2SHmaWYB7jtQUCBdO+K75A ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1665079732; a=rsa-sha256; cv=none; b=KzWiB34cY26Ql5eSJHUoE/y9mG2llFYshDT88CE7wj8QPfx1u4GyKMx0LyeZhmuxKrwKK8 Aej6UnFP9wul/+ve/QQI91YSmOSZMKL0cJp6A0XWnR+CETtaexlnD6uLUpen7kW7fJ9myP T9kKMbZJPmUBBW+KvBWAYQ0nu0Z0tQGBN7nRqpmTVUiTfxVh+oRtO06RJnIj8+J/KRrSHr 3jTqM8bkn4VN6UrW6GEyiohdx46mXOY2coDbaAuY2TSseuS7nbmnEpbKkLzaQ/B4GNaafO q/V535GLR5dsXvw5MtaYvkNW4PYqVs6gTSjf8/gXSjZDzezLJRp4Yg9ZIXdiaA== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=DogVyiAu; spf=pass (mail01.ipfire.org: domain of robin.roevens@disroot.org designates 178.21.23.139 as permitted sender) smtp.mailfrom=robin.roevens@disroot.org; dmarc=pass (policy=quarantine) header.from=disroot.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1665079732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=RJx6CeXzZvhXiJumXYu0YWIWdxC4qsL5mItU6XBauOk=; b=O6E7614uPYc2IOSTXHCrbMi2WgNYA3xhxb535znVcp5ikMj5Pv/XNxKSkUUIsEtqb/OriJ 0W1CU7tNJJfAHm241HUvusU6ydTI8v9TTFFlrSBqLXeF9jMiLyreLsOzR+I/v7ulZBCq4Z kY+j3DyFZqSNQMjhsPt2X2VNFjH54KUmvOzlW0zqpwwJCSKZA8Sdrfde2ctrTplVOkap3k Di41Rhd2WWvSW6ZWZdQQoFgwH9yDj+jxVEdhsTNoCTNG1RBelklcQGMp94ylMvPb7cJpHN NCIfvDX84w8y1ONPxl7e3OpKph80dZGM4/BNbxAyyt0g9FKRLB4sXGEHE11agA== Authentication-Results: mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=DogVyiAu; spf=pass (mail01.ipfire.org: domain of robin.roevens@disroot.org designates 178.21.23.139 as permitted sender) smtp.mailfrom=robin.roevens@disroot.org; dmarc=pass (policy=quarantine) header.from=disroot.org X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-3.74 / 11.00]; BAYES_HAM(-1.63)[92.65%]; IP_REPUTATION_HAM(-1.10)[asn: 50673(-0.31), country: NL(-0.01), ip: 178.21.23.139(-0.78)]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-1.000]; DKIM_REPUTATION(-0.79)[-0.78955115065407]; SPF_REPUTATION_HAM(-0.68)[-0.67900099170085]; DMARC_POLICY_ALLOW(-0.50)[disroot.org,quarantine]; MV_CASE(0.50)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(0.26)[disroot.org:s=mail]; R_SPF_ALLOW(-0.20)[+a]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[development@lists.ipfire.org]; RCPT_COUNT_ONE(0.00)[1]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[disroot.org:+]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; ASN(0.00)[asn:50673, ipnet:178.21.23.0/24, country:NL]; RCVD_COUNT_THREE(0.00)[4]; MIME_TRACE(0.00)[0:+] X-Rspamd-Queue-Id: 4Mjzw417kqz1Cl X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Hi all After processing, tackling and implementing all remarks Michael gave about previous version, I hereby present you v2 of this patchset. As the other patchset that I submitted, containing small cosmetic changes on services.cgi, depended on v1 of this patchset; I have now included those changes in this set instead of reposting those again as a seperate set. Those cosmetics (patch 3-5) are not part of the fix for bug#12935. I'm quite confident that the code of addonctrl is now much better/cleaner by implementing and handling Michael's concerns. There is now even more errorchecking going on (mainly for system errors). I know Core 171 went in Testing, but as there currently are already 2 bugreports concering this fix (#12916 was also linked to this today); I'm assuming quite a few IPFire users are currently experiencing problems with the services.cgi page. So, if possible and feasable, I think it would be a good idea to try to include this one in CU171 (at least patch 1 and 2) ? If there are still concerns/remarks about this new version, I'll try to handle them asap. For reference, the content of the summary mail that was sent with v1 of the patch: --- This patchset fixes Bug#12935 (https://bugzilla.ipfire.org/show_bug.cgi?id=12935) Summary: Addons where the initscript does not match the addon-name and addons with multiple initscripts are now listed on services.cgi since CU170. But addonctrl still expected addon name to be equal to initscript name; Hence starting/stopping/enabling/disabling of such addons was not possible. This has always been like that, but that problem was hidden as services.cgi also did not display those addon services. After discussing this with Adolf on the Bug report, we concluded that we should adapt addonctrl to work with the new addon metadata Services-field instead. I basically rewrote addonctrl to not only use the new services metadata but also to have better errorchecking and added the posibility to check if a service is currently enabled or disabled. As a result services.cgi no longer has to go checking the precense of runlevel initscripts, but can just ask addonctrl. I also added a warning to services.cgi if a runlevel initscript does not exists, to prevent the user from wondering why he can't enable a specific service. (Adolf pointed out some services don't install runlevel initscripts by default) More details in the bugreport and in the commit-messages of the patches. --- Regards Robin