From patchwork Tue Sep 24 08:34:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonatan Schlag X-Patchwork-Id: 8151 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 (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4XCY7q2Nvxz3wxp for ; Tue, 24 Sep 2024 08:34:47 +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 RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4XCY7n55Sgz369; Tue, 24 Sep 2024 08:34:45 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4XCY7n31kZz34LX; Tue, 24 Sep 2024 08:34:45 +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 (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4XCY7l705Yz33jw for ; Tue, 24 Sep 2024 08:34:43 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.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 mail01.ipfire.org (Postfix) with ESMTPSA id 4XCY7l2wcJz1Tn; Tue, 24 Sep 2024 08:34:43 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1727166883; 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=vLtR5abGIxBdPuEns7yX/ID1uLmShc9Z/SIBsUV3GX8=; b=Sn3Cy3Hae1pYDsaO9+NvqIcp8KvZlQ6p7mr5ZTB5dcpwO3vc7zjcE56kJXnNGEwDVtqTXv Qt1DnHOE9uKofqCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1727166883; 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=vLtR5abGIxBdPuEns7yX/ID1uLmShc9Z/SIBsUV3GX8=; b=vNhAfZbLD4y2YPtlS4WHX0hSV7DVduRZUzNbXTaqZV89nXaUQ3Kz8ZW0FcybxSF4+hpRp0 lyqeW7LkryaXMExvAw9582kndGoflYaj86GsiwvtuNG8z/+ZHvkcVrlflLin97ItlcPhMJ oMHoTxoUOWt71+YjWd7tNbijn4x34lNQntqr57JJ2ib8zgvsZBvxg2ICob4T8HCr+T54Yu 20c3SX6gq2LGhOo1D5RbeqJNRBfuLoKRrLdb+QPvtYZTsSMFq0x/s/YvY0MvjuTg3ITHUT uZesyB1+6R7o5gjT5Y5n+zmLWgXYDG/ano5UPOpgRvvDjbWJltEdc5cnlAukMQ== From: Jonatan Schlag To: development@lists.ipfire.org Subject: [PATCH 1/2] setup: Reformat the C Code Date: Tue, 24 Sep 2024 10:34:32 +0200 Message-Id: <20240924083433.48085-1-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: IHFVL52DQAEEDKASDNW3SYZVGR4I7AQX X-Message-ID-Hash: IHFVL52DQAEEDKASDNW3SYZVGR4I7AQX X-MailFrom: jonatan.schlag@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Otherwise the line wraps at position where it does not make any sense. Signed-off-by: Jonatan Schlag --- src/setup/netstuff.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/setup/netstuff.c b/src/setup/netstuff.c index 60e27242f..ec4c31513 100644 --- a/src/setup/netstuff.c +++ b/src/setup/netstuff.c @@ -602,9 +602,15 @@ int scan_network_cards(void) while (fgets(temp_line, STRING_SIZE, fp) != NULL) { temp_line[strlen(temp_line) -1] = 0; - if ( strncmp(temp_line, _driver, strlen(_driver)) == 0 ) sprintf(nics[count].driver, "%s", temp_line+strlen(_driver)); - if ( strncmp(temp_line, _desc, strlen(_desc)) == 0 ) sprintf(nics[count].description, "%s", temp_line+strlen(_desc)); - if ( strncmp(temp_line, _network_hwaddr, strlen(_network_hwaddr)) == 0 ) sprintf(nics[count].macaddr, "%s", temp_line+strlen(_network_hwaddr)); + if ( strncmp(temp_line, _driver, strlen(_driver)) == 0 ) { + sprintf(nics[count].driver, "%s", temp_line+strlen(_driver)); + } + if ( strncmp(temp_line, _desc, strlen(_desc)) == 0 ) { + sprintf(nics[count].description, "%s", temp_line+strlen(_desc)); + } + if ( strncmp(temp_line, _network_hwaddr, strlen(_network_hwaddr)) == 0 ) { + sprintf(nics[count].macaddr, "%s", temp_line+strlen(_network_hwaddr)); + } if (strlen(nics[count].macaddr) > 15 ) { sprintf(nics[count].nic, "%s", find_nic4mac(nics[count].macaddr)); count++; From patchwork Tue Sep 24 08:34:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonatan Schlag X-Patchwork-Id: 8152 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 (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4XCY7v4JBHz3wxp for ; Tue, 24 Sep 2024 08:34:51 +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 RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4XCY7t4wHcz66h; Tue, 24 Sep 2024 08:34:50 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4XCY7t4R9fz34LX; Tue, 24 Sep 2024 08:34:50 +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 (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4XCY7r0qcsz33jw for ; Tue, 24 Sep 2024 08:34:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.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 mail01.ipfire.org (Postfix) with ESMTPSA id 4XCY7q6mYRz2KN; Tue, 24 Sep 2024 08:34:47 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1727166888; 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: in-reply-to:in-reply-to:references:references; bh=PUHk+oQwwaeSVTHJSpzx07NynC3epoCAboKzzRUeRsM=; b=efisvg2BlAhSYiWa3zdaFqhuEx3j/zLmZkvKe27djWJ2/Gfa1Ceg2Bp8GRHsn5VDR0BaKC pylBCPU+XhEpTQDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1727166888; 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: in-reply-to:in-reply-to:references:references; bh=PUHk+oQwwaeSVTHJSpzx07NynC3epoCAboKzzRUeRsM=; b=mbJJdvR7esNGkkQRLP4hFlWhKSNNpV47rRrL2GQ2iqcd/3lNwBFyG5ni61In4nkotcSKXE fQ6R2tvtM1HpRL3q/2k8scnTV0nzocWsqyVONucjkDo/jb3JHUDrFgOqRbQLcJqZ4kXnkx e5KWyQY1Q3Nh7QIzCnsFVEumY9+1bSLjIl0iYhwOsm6bqkK50uosrdAejlrvn3hIvfGQg3 2teIcpZRF7K/Y5mUWuOigZwlmVyH7TVP8Xcz7c746s4GrR0f8nLi/5QFomPHklm2H3cgRE ozScCV02ePAy0gJlWhsPUUQ4X83qYWdtELQENgccxzqVy2fOEUNF7747cQGE0g== From: Jonatan Schlag To: development@lists.ipfire.org Subject: [PATCH 2/2] setup: Copy the description of a mac without "" Date: Tue, 24 Sep 2024 10:34:33 +0200 Message-Id: <20240924083433.48085-2-jonatan.schlag@ipfire.org> In-Reply-To: <20240924083433.48085-1-jonatan.schlag@ipfire.org> References: <20240924083433.48085-1-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: ZYU3D2K67DJ6QYIMK4UPDXENUFQ36PCE X-Message-ID-Hash: ZYU3D2K67DJ6QYIMK4UPDXENUFQ36PCE X-MailFrom: jonatan.schlag@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This creates problems as the "" are invalid characters which our new bash readhash refuses to accepts. Signed-off-by: Jonatan Schlag --- src/setup/netstuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/setup/netstuff.c b/src/setup/netstuff.c index ec4c31513..5967a7882 100644 --- a/src/setup/netstuff.c +++ b/src/setup/netstuff.c @@ -606,7 +606,7 @@ int scan_network_cards(void) sprintf(nics[count].driver, "%s", temp_line+strlen(_driver)); } if ( strncmp(temp_line, _desc, strlen(_desc)) == 0 ) { - sprintf(nics[count].description, "%s", temp_line+strlen(_desc)); + snprintf(nics[count].description, strlen(temp_line) - strlen(_desc) - 1,"%s", temp_line+strlen(_desc)+1 ); } if ( strncmp(temp_line, _network_hwaddr, strlen(_network_hwaddr)) == 0 ) { sprintf(nics[count].macaddr, "%s", temp_line+strlen(_network_hwaddr));