Date: Thursday, August 4, 2022 @ 10:25:13 Author: eworm Revision: 452049
replace `hostname` with `uname -n` (FS#75247) Added: dhcp/trunk/0001-99-replace-hostname-with-uname-n-o.patch Modified: dhcp/trunk/PKGBUILD -----------------------------------------------+ 0001-99-replace-hostname-with-uname-n-o.patch | 27 ++++++++++++++++++++++++ PKGBUILD | 10 ++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) Added: 0001-99-replace-hostname-with-uname-n-o.patch =================================================================== --- 0001-99-replace-hostname-with-uname-n-o.patch (rev 0) +++ 0001-99-replace-hostname-with-uname-n-o.patch 2022-08-04 10:25:13 UTC (rev 452049) @@ -0,0 +1,27 @@ +From 4c859eba57288eb17eb4603d67ef415b87503879 Mon Sep 17 00:00:00 2001 +From: Christian Hesse <[email protected]> +Date: Thu, 4 Aug 2022 12:15:46 +0200 +Subject: [PATCH 1/1] [!99] replace `hostname` with `uname -n`o + +The former belongs to package `inetutils`, which has some security +implications, so let's use the latter. +--- + client/scripts/linux | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/client/scripts/linux b/client/scripts/linux +index c4e51f6d..49eff40a 100755 +--- a/client/scripts/linux ++++ b/client/scripts/linux +@@ -113,7 +113,7 @@ set_hostname() { + local current_hostname + + if [ -n "$new_host_name" ]; then +- current_hostname=$(hostname) ++ current_hostname=$(uname -n) + + # current host name is empty, '(none)' or 'localhost' or differs from new one from DHCP + if [ -z "$current_hostname" ] || +-- +2.37.1 + Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-08-04 10:12:36 UTC (rev 452048) +++ PKGBUILD 2022-08-04 10:25:13 UTC (rev 452049) @@ -7,7 +7,7 @@ # separate patch levels with a period to maintain proper versioning. _realver=4.4.3 pkgver=${_realver/-/.} -pkgrel=1 +pkgrel=2 arch=('x86_64') license=('custom:isc-dhcp') url='https://www.isc.org/dhcp/' @@ -15,6 +15,7 @@ options=('!lto') validpgpkeys=('7E1C91AC8030A5A59D1EFAB9750F3C87723E4012') # Internet Systems Consortium, Inc. (Signing key, 2021-2022) <[email protected]> source=("https://downloads.isc.org/isc/${pkgbase}/${_realver}/${pkgbase}-${_realver}.tar.gz"{,.asc} + '0001-99-replace-hostname-with-uname-n-o.patch' 'dhcp-sysusers.conf' 'dhcp-tmpfiles.conf' 'dhcpd4.service' @@ -22,6 +23,7 @@ '[email protected]') sha256sums=('0e3ec6b4c2a05ec0148874bcd999a66d05518378d77421f607fb0bc9d0135818' 'SKIP' + '7a3349faac1a2209912b4911ca173f975e3dabf409739250285a25c447b1ca9f' 'b16083e6bb572ffacaa7cd97e7fde5fcfa1b6dbeb166f162e2ec6e8ec4b928d6' 'abcd30e9e8428e34d22ab4d3074ef4bd84c2b11f5868597111b47d6f56d204da' '03fce30efab819b2d928085b0bab962a33ce56fc376acae98ad9b30aa278c9c8' @@ -28,6 +30,12 @@ 'f98a4438f4f69cab7cc5cce6927df4790ee993ebc8f88a169e63043c53d25625' '86cd0b1e0ea1d47ab096f6ee925eee60545116fb887a155761eda589b30e4f0e') +prepare() { + cd "${srcdir}/${pkgbase}-${_realver}" + + patch -Np1 < ../0001-99-replace-hostname-with-uname-n-o.patch +} + build() { cd "${srcdir}/${pkgbase}-${_realver}"
