Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
3796135c0d
!29 sync from 2403 sp1
From: @sun_hai_10 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
2025-04-25 08:32:29 +00:00
sun_hai_10
705c0f67fb sync from 2403 sp1 2025-04-23 18:13:07 +08:00
openeuler-ci-bot
5cfdae29a0
!20 [sync] PR-17: fix CVE-2024-47533
From: @openeuler-sync-bot 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
2025-04-02 09:51:47 +00:00
wangshuo
9a2440bb02 fix CVE-2024-47533
(cherry picked from commit ba6cbdcc98624be348c58888e2ce2f8e1849e2e9)
2025-04-02 16:18:17 +08:00
openeuler-ci-bot
f1fcfc4e42
!16 [sync] PR-15: fix build fail
From: @openeuler-sync-bot 
Reviewed-by: @yanan-rock 
Signed-off-by: @yanan-rock
2023-08-11 07:41:10 +00:00
zhangpan
ce542d4f73 fix build fail
(cherry picked from commit f06273b36484c998fcef9e84eac6a3aa8d7fc415)
2023-08-11 15:06:36 +08:00
openeuler-ci-bot
89ffbc8899
!11 [sync] PR-6: Change permission with web.ss
From: @openeuler-sync-bot 
Reviewed-by: @anonymous_z 
Signed-off-by: @anonymous_z
2023-04-17 08:56:27 +00:00
sun_hai_10
ceda42ae37 Change permission with web.ss
(cherry picked from commit 7df0a93e2547155df2d93bd69e0dec16f50c684b)
2023-04-07 11:04:18 +08:00
openeuler-ci-bot
b949ee9d53
!7 [sync] PR-5: add install depend
From: @openeuler-sync-bot 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
2023-03-09 07:40:33 +00:00
sun_hai_10
468df0d495 add install depend
(cherry picked from commit 1cd0c804616e98cf0cf738b3209352006e21a926)
2023-03-09 15:23:11 +08:00
6 changed files with 202 additions and 91 deletions

View File

@ -0,0 +1,100 @@
From 8a94846b133f12c71f515b0fbaa834b37dd00347 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
<psuarezhernandez@suse.com>
Date: Wed, 17 May 2023 13:33:37 +0100
Subject: [PATCH] Fix package building with Sphinx >= 7.0.0
Sphinx has dropped the integration with setuptools in version 7.0.0:
https://www.sphinx-doc.org/en/master/changes.html#release-7-0-0-released-apr-29-2023
We now build documentation and man pages out of setup.py script
---
Makefile | 3 +++
cobbler.spec | 1 +
setup.py | 22 +---------------------
3 files changed, 5 insertions(+), 21 deletions(-)
diff --git a/Makefile b/Makefile
index 1174062..541865c 100644
--- a/Makefile
+++ b/Makefile
@@ -53,6 +53,9 @@ doc: ## Creates the documentation with sphinx in html form.
@echo "creating: documentation"
@cd docs; make html > /dev/null 2>&1
+man: ## Creates documentation and man pages using Sphinx
+ @${PYTHON} -m sphinx -b man -j auto ./docs ./build/sphinx/man
+
qa: ## If pyflakes and/or pycodestyle is found then they are run.
ifeq ($(strip $(PYFLAKES)),)
@echo "No pyflakes found"
diff --git a/cobbler.spec b/cobbler.spec
index 1235917..e4c482b 100644
--- a/cobbler.spec
+++ b/cobbler.spec
@@ -307,6 +307,7 @@ echo "ERROR: DOCPATH: ${DOCPATH} does not match %{_mandir}"
[ "${TFTPROOT}" != %{tftpboot_dir} ] && echo "ERROR: TFTPROOT: ${TFTPROOT} does not match %{tftpboot_dir}"
%py3_build
+make man
%install
. distro_build_configs.sh
diff --git a/setup.py b/setup.py
index 57d8543..595ffd0 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,6 @@ from setuptools import dep_util
from distutils.command.build import build as _build
from configparser import ConfigParser
from setuptools import find_packages
-from sphinx.setup_command import BuildDoc
import codecs
from coverage import Coverage
@@ -143,15 +142,6 @@ class build(_build):
def run(self):
_build.run(self)
-#####################################################################
-# # Build man pages using Sphinx ###################################
-#####################################################################
-
-
-class build_man(BuildDoc):
- def initialize_options(self):
- BuildDoc.initialize_options(self)
- self.builder = 'man'
#####################################################################
# # Configure files ##################################################
@@ -279,16 +269,7 @@ def has_configure_files(build):
return bool(build.distribution.configure_files)
-def has_man_pages(build):
- """Check if the distribution has configuration files to work on."""
- return bool(build.distribution.man_pages)
-
-
-build.sub_commands.extend((
- ('build_man', has_man_pages),
- ('build_cfg', has_configure_files)
-))
-
+build.sub_commands.extend((("build_cfg", has_configure_files),))
#####################################################################
# # Modify Install Stage ############################################
@@ -490,7 +471,6 @@ if __name__ == "__main__":
'savestate': savestate,
'restorestate': restorestate,
'build_cfg': build_cfg,
- 'build_man': build_man
},
name="cobbler",
version=VERSION,
--
2.27.0

Binary file not shown.

BIN
cobbler-3.2.3.tar.gz Normal file

Binary file not shown.

View File

@ -3,8 +3,8 @@
%global vendor_lower `echo %{_vendor}|tr 'A-Z' 'a-z'`
Name: cobbler
Version: 3.2.0
Release: 1
Version: 3.2.3
Release: 2
Summary: Boot server configurator
URL: https://cobbler.github.io/
License: GPLv2+
@ -13,7 +13,8 @@ BuildArch: noarch
Patch9000: huawei-adapt-vendor.patch
Patch9001: huawei-repair-switch-condition-error.patch
Patch6000: fix-Give-root-RW-permissions-to-var-lib-cobbler-web.ss.patch
Patch6001: backport-Fix-package-building-with-Sphinx.patch
BuildRequires: system-release
BuildRequires: python%{python3_pkgversion}-devel
@ -52,7 +53,8 @@ Requires: python%{python3_pkgversion}-simplejson
Requires: python%{python3_pkgversion}-tornado
Requires: python%{python3_pkgversion}-distro
Requires: python%{python3_pkgversion}-ldap3
Requires: genisoimage
Requires: genisoimage
Requires: cobbler-web = %{version}-%{release}
Recommends: bash-completion
Recommends: syslinux
@ -182,13 +184,9 @@ sed -i -e "s/SECRET_KEY = ''/SECRET_KEY = \'$RAND_SECRET\'/" %{_datadir}/cobbler
%{_bindir}/cobbler-ext-nodes
%{_bindir}/cobblerd
%{_sbindir}/tftpd.py
%{_sbindir}/fence_ipmitool
%{_datadir}/bash-completion/
%dir %{_datadir}/cobbler
%{_datadir}/cobbler/bin
%{_mandir}/man1/cobbler.1*
%{_mandir}/man5/cobbler.conf.5*
%{_mandir}/man8/cobblerd.8*
%{python3_sitelib}/cobbler/
%{python3_sitelib}/cobbler-*.egg-info
%{_unitdir}/cobblerd.service
@ -209,7 +207,43 @@ sed -i -e "s/SECRET_KEY = ''/SECRET_KEY = \'$RAND_SECRET\'/" %{_datadir}/cobbler
%attr(-,apache,apache) /var/www/cobbler_webui_content/
%changelog
* Sat May 29 2021 liuxin <liuxin264@huawei.com> - 3.2.0 - 1
* Wed Apr 23 2025 sunhai <sunhai10@huawei.com> - 3.2.3-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix start cobbler failed
* Tue Apr 22 2025 sunhai <sunhai10@huawei.com> - 3.2.3-1
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:update to 3.2.3
* Wed Nov 20 2024 wangshuo <wangshuo@kylinos.cn> - 3.2.0-5
- Type:CVE
- ID:CVE-2024-47533
- SUG:NA
- DESC:Add Patch6002, fix CVE-2024-47533
* Fri Aug 11 2023 zhangpan <zhangpan103@h-partners.com> - 3.2.0-4
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix build fail
* Thu Mar 09 2023 sunhai <sunhai10@huawei.com> - 3.2.0-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:Change permission with web.ss
* Tue Feb 28 2023 sunhai <sunhai10@huawei.com> - 3.2.0-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC: add install depend
* Sat May 29 2021 liuxin <liuxin264@huawei.com> - 3.2.0-1
- Package init

View File

@ -1,25 +0,0 @@
From d63ed9f9712bfbdc9b36e2f3dc94bc8bb4ba0a80 Mon Sep 17 00:00:00 2001
From: Orion Poplawski <orion@nwra.com>
Date: Sun, 25 Oct 2020 11:43:25 -0600
Subject: [PATCH] Give root RW permissions to /var/lib/cobbler/web.ss
---
cobbler/cobblerd.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cobbler/cobblerd.py b/cobbler/cobblerd.py
index fe1cf88..34aedf9 100644
--- a/cobbler/cobblerd.py
+++ b/cobbler/cobblerd.py
@@ -57,7 +57,7 @@ def regen_ss_file():
data = fd.read(512)
fd.close()
- fd = os.open(ssfile, os.O_CREAT | os.O_RDWR, 0o600)
+ fd = os.open(ssfile, os.O_CREAT | os.O_RDWR, 0o660)
os.write(fd, binascii.hexlify(data))
os.close(fd)
--
2.30.0

View File

@ -1,6 +1,6 @@
From 39793327e0f859dc613f9ff69e3f91e6a7be086c Mon Sep 17 00:00:00 2001
From: bitcoffee <liuxin264@huawei.com>
Date: Tue, 29 Jun 2021 00:43:34 +0800
From 704be6fc9efd009c8f1da9abdb626e7fb18c86bb Mon Sep 17 00:00:00 2001
From: sun_hai_10 <sunhai10@huawei.com>
Date: Fri, 28 Mar 2025 01:51:43 +0800
Subject: [PATCH] adapt vendor
---
@ -9,17 +9,17 @@ Subject: [PATCH] adapt vendor
cobbler/actions/reposync.py | 2 +-
cobbler/autoinstallgen.py | 2 +-
cobbler/tftpgen.py | 2 +-
cobbler/utils.py | 3 +++
cobbler/utils.py | 4 +++-
config/cobbler/distro_signatures.json | 28 +++++++++++++++++++++++++++
distro_build_configs.sh | 5 ++++-
templates/etc/dhcp.template | 10 +++++-----
9 files changed, 55 insertions(+), 21 deletions(-)
9 files changed, 55 insertions(+), 22 deletions(-)
diff --git a/cobbler/actions/buildiso.py b/cobbler/actions/buildiso.py
index 9500086..be42749 100644
index f1be922..e469535 100644
--- a/cobbler/actions/buildiso.py
+++ b/cobbler/actions/buildiso.py
@@ -228,7 +228,7 @@ class BuildIso(object):
@@ -220,7 +220,7 @@ class BuildIso:
else:
append_line += " autoyast=%s" % data["autoinstall"]
@ -27,8 +27,8 @@ index 9500086..be42749 100644
+ if dist.breed == "redhat" or dist.breed == "generic_lower_os":
if "proxy" in data and data["proxy"] != "":
append_line += " proxy=%s http_proxy=%s" % (data["proxy"], data["proxy"])
append_line += " ks=%s" % data["autoinstall"]
@@ -278,7 +278,7 @@ class BuildIso(object):
if dist.os_version in ["rhel4", "rhel5", "rhel6", "fedora16"]:
@@ -273,7 +273,7 @@ class BuildIso:
else:
append_line += " autoyast=%s" % data["autoinstall"]
@ -36,8 +36,8 @@ index 9500086..be42749 100644
+ if dist.breed == "redhat" or dist.breed == "generic_lower_os":
if "proxy" in data and data["proxy"] != "":
append_line += " proxy=%s http_proxy=%s" % (data["proxy"], data["proxy"])
append_line += " ks=%s" % data["autoinstall"]
@@ -314,7 +314,7 @@ class BuildIso(object):
if dist.os_version in ["rhel4", "rhel5", "rhel6", "fedora16"]:
@@ -312,7 +312,7 @@ class BuildIso:
my_mask = None
my_gw = None
my_dns = None
@ -46,7 +46,7 @@ index 9500086..be42749 100644
if "netmask" in data["kernel_options"] and data["kernel_options"]["netmask"] != "":
my_mask = data["kernel_options"]["netmask"]
del data["kernel_options"]["netmask"]
@@ -322,7 +322,7 @@ class BuildIso(object):
@@ -320,7 +320,7 @@ class BuildIso:
my_gw = data["kernel_options"]["gateway"]
del data["kernel_options"]["gateway"]
@ -55,7 +55,7 @@ index 9500086..be42749 100644
if "ksdevice" in data["kernel_options"] and data["kernel_options"]["ksdevice"] != "":
my_int = data["kernel_options"]["ksdevice"]
if my_int == "bootif":
@@ -424,7 +424,7 @@ class BuildIso(object):
@@ -422,7 +422,7 @@ class BuildIso:
append_line += " netdevice=%s" % data["mac_address_" + my_int].lower()
else:
append_line += " netdevice=%s" % my_int
@ -64,7 +64,7 @@ index 9500086..be42749 100644
if intmac in data and data[intmac] != "":
append_line += " ksdevice=%s" % data["mac_address_" + my_int]
else:
@@ -435,19 +435,19 @@ class BuildIso(object):
@@ -433,19 +433,19 @@ class BuildIso:
if my_ip is not None:
if dist.breed == "suse":
append_line += " hostip=%s" % my_ip
@ -87,7 +87,7 @@ index 9500086..be42749 100644
append_line += " gateway=%s" % my_gw
if dist.breed in ["ubuntu", "debian"]:
append_line += " netcfg/get_gateway=%s" % my_gw
@@ -458,7 +458,7 @@ class BuildIso(object):
@@ -456,7 +456,7 @@ class BuildIso:
append_line += " nameserver=%s" % ",".join(my_dns)
else:
append_line += " nameserver=%s" % my_dns
@ -96,55 +96,55 @@ index 9500086..be42749 100644
if type(my_dns) == list:
append_line += " dns=%s" % ",".join(my_dns)
else:
@@ -548,7 +548,7 @@ class BuildIso(object):
@@ -545,7 +545,7 @@ class BuildIso:
cfg.write(" kernel %s\n" % os.path.basename(distro.kernel))
append_line = " append initrd=%s" % os.path.basename(distro.initrd)
- if distro.breed == "redhat":
+ if distro.breed == "redhat" or distro.breed == "generic_lower_os":
append_line += " ks=cdrom:/isolinux/%s.cfg" % descendant.name
if distro.breed == "suse":
append_line += " autoyast=file:///isolinux/%s.cfg install=cdrom:///" % descendant.name
@@ -566,7 +566,7 @@ class BuildIso(object):
+ if distro.breed == "redhat" or dist.breed == "generic_lower_os":
if distro.os_version in ["rhel4", "rhel5", "rhel6", "fedora16"]:
append_line += " ks=cdrom:/isolinux/%s.cfg" % descendant.name
else:
@@ -566,7 +566,7 @@ class BuildIso:
elif descendant.COLLECTION_TYPE == 'system':
autoinstall_data = self.api.autoinstallgen.generate_autoinstall_for_system(descendant.name)
- if distro.breed == "redhat":
+ if distro.breed == "redhat" or distro.breed == "generic_lower_os":
+ if distro.breed == "redhat" or dist.breed == "generic_lower_os":
cdregex = re.compile(r"^\s*url .*\n", re.IGNORECASE | re.MULTILINE)
autoinstall_data = cdregex.sub("cdrom\n", autoinstall_data, count=1)
diff --git a/cobbler/actions/check.py b/cobbler/actions/check.py
index 319c03f..9ae8831 100644
index 4fadab5..4893bf9 100644
--- a/cobbler/actions/check.py
+++ b/cobbler/actions/check.py
@@ -139,7 +139,7 @@ class CobblerCheck(object):
@@ -138,7 +138,7 @@ class CobblerCheck:
if notes != "":
notes = " (NOTE: %s)" % notes
rc = 0
return_code = 0
- if self.checked_family in ("redhat", "suse"):
+ if self.checked_family in ("redhat", "suse", "generic_lower_os"):
if os.path.exists("/etc/rc.d/init.d/%s" % which):
rc = utils.subprocess_call(self.logger, "/sbin/service %s status > /dev/null 2>/dev/null" % which, shell=True)
if rc != 0:
return_code = utils.subprocess_call(self.logger,
"/sbin/service %s status > /dev/null 2>/dev/null" % which,
diff --git a/cobbler/actions/reposync.py b/cobbler/actions/reposync.py
index fb2ac5c..6b4ff70 100644
index 651514f..ddee79c 100644
--- a/cobbler/actions/reposync.py
+++ b/cobbler/actions/reposync.py
@@ -275,7 +275,7 @@ class RepoSync(object):
mdoptions.append("-g %s" % groupmdfile)
if "prestodelta" in rd:
# need createrepo >= 0.9.7 to add deltas
- if utils.get_family() in ("redhat", "suse"):
@@ -257,7 +257,7 @@ class RepoSync:
mdoptions.append("-g %s" % os.path.join(origin_path, groupmdfile))
if "prestodelta" in rd:
# need createrepo >= 0.9.7 to add deltas
- if utils.get_family() in ("redhat", "suse"):
+ if utils.get_family() in ("redhat", "suse", "generic_lower_os"):
cmd = "/usr/bin/rpmquery --queryformat=%{VERSION} createrepo"
createrepo_ver = utils.subprocess_get(self.logger, cmd)
if not createrepo_ver[0:1].isdigit():
cmd = "/usr/bin/rpmquery --queryformat=%{VERSION} createrepo"
createrepo_ver = utils.subprocess_get(self.logger, cmd)
if not createrepo_ver[0:1].isdigit():
diff --git a/cobbler/autoinstallgen.py b/cobbler/autoinstallgen.py
index 2f38a40..ec1aac5 100644
index d8532ca..0486bf8 100644
--- a/cobbler/autoinstallgen.py
+++ b/cobbler/autoinstallgen.py
@@ -314,7 +314,7 @@ class AutoInstallationGen(object):
@@ -312,7 +312,7 @@ class AutoInstallationGen:
meta.update(autoinstall_meta)
# add package repositories metadata to autoinstall metavariables
@ -154,34 +154,36 @@ index 2f38a40..ec1aac5 100644
meta["yum_config_stanza"] = self.generate_config_stanza(obj, (system is None))
# FIXME: implement something similar to zypper (SUSE based distros) and apt (Debian based distros)
diff --git a/cobbler/tftpgen.py b/cobbler/tftpgen.py
index 5c5b1ef..bf0f347 100644
index 087d8c0..5e10636 100644
--- a/cobbler/tftpgen.py
+++ b/cobbler/tftpgen.py
@@ -727,7 +727,7 @@ class TFTPGen(object):
else:
autoinstall_path = "http://%s/cblr/svc/op/autoinstall/profile/%s" % (httpserveraddress, profile.name)
@@ -746,7 +746,7 @@ class TFTPGen:
autoinstall_path = "http://%s/cblr/svc/op/autoinstall/profile/%s" \
% (httpserveraddress, profile.name)
- if distro.breed is None or distro.breed == "redhat":
+ if distro.breed is None or distro.breed == "redhat" or distro.breed == "generic_lower_os":
append_line += " kssendmac"
append_line = "%s ks=%s" % (append_line, autoinstall_path)
if distro.os_version in ["rhel4", "rhel5", "rhel6", "fedora16"]:
append_line += " kssendmac ks=%s" % autoinstall_path
diff --git a/cobbler/utils.py b/cobbler/utils.py
index 44a7016..8e46e47 100644
index 98663a5..7475a27 100644
--- a/cobbler/utils.py
+++ b/cobbler/utils.py
@@ -1056,6 +1056,9 @@ def os_release():
@@ -1017,8 +1017,10 @@ def os_release():
make = "suse"
if "suse" not in distro.like():
make = "unknown"
return make, float(distro_version)
- return make, float(distro_version)
+ return make, float(distro_versioni)
+ elif family == "generic_lower_os":
+ return "generic_lower_os", float(distro_version)
+
def is_safe_to_hardlink(src, dst, api):
def is_safe_to_hardlink(src: str, dst: str, api) -> bool:
"""
diff --git a/config/cobbler/distro_signatures.json b/config/cobbler/distro_signatures.json
index b1d073c..773e9f2 100644
index 6d2c04b..804f735 100644
--- a/config/cobbler/distro_signatures.json
+++ b/config/cobbler/distro_signatures.json
@@ -1,5 +1,33 @@
@ -219,7 +221,7 @@ index b1d073c..773e9f2 100644
"rhel4": {
"signatures": [
diff --git a/distro_build_configs.sh b/distro_build_configs.sh
index bad43e3..ef48836 100644
index 31ee5ce..19fc711 100644
--- a/distro_build_configs.sh
+++ b/distro_build_configs.sh
@@ -30,6 +30,9 @@ if [ "$DISTRO" = "" ] && [ -r /etc/os-release ];then
@ -232,17 +234,17 @@ index bad43e3..ef48836 100644
esac
fi
@@ -42,7 +45,7 @@ elif [ "$DISTRO" = "UBUNTU" ];then
export WEBROOT="/var/www";
export WEBCONFIG="/etc/apache2/conf-available";
@@ -43,7 +46,7 @@ elif [ "$DISTRO" = "UBUNTU" ];then
export WEBROOT="/var/www"
export WEBCONFIG="/etc/apache2/conf-available"
export DEFAULTPATH="etc/default"
-elif [ "$DISTRO" = "FEDORA" ];then
+elif [ "$DISTRO" = "FEDORA" ] || [ "$DISTRO" = `echo 'generic_os'|tr 'a-z' 'A-Z'` ];then
export APACHE_USER="apache"
export HTTP_USER=$APACHE_USER # overrule setup.py
export APACHE_GROUP="apache"
diff --git a/templates/etc/dhcp.template b/templates/etc/dhcp.template
index e450419..e8a2b91 100644
index a24f903..68ebe8a 100644
--- a/templates/etc/dhcp.template
+++ b/templates/etc/dhcp.template
@@ -33,7 +33,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
@ -283,5 +285,5 @@ index e450419..e8a2b91 100644
# RiskV 32 bit
else if option system-arch = 00:25 {
--
2.30.0
2.43.0