Sync from SUSE:SLFO:Main memcached revision b4eb8cbe4c5f0f381a4c07fae0bcf242

This commit is contained in:
Adrian Schröter 2024-05-03 16:44:34 +02:00
commit a179712ff1
9 changed files with 1320 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,18 @@
Index: memcached-1.6.9/scripts/memcached.service
===================================================================
--- memcached-1.6.9.orig/scripts/memcached.service
+++ memcached-1.6.9/scripts/memcached.service
@@ -41,6 +41,13 @@ CapabilityBoundingSet=CAP_SETGID CAP_SET
# Restricts the set of socket address families accessible to the processes
# of this unit. Protects against vulnerabilities such as CVE-2016-8655
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
+# added automatically, for details please see
+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
+ProtectHome=true
+ProtectHostname=true
+ProtectClock=true
+ProtectKernelLogs=true
+# end of automatic additions
# Some security features are not in the older versions of systemd used by

BIN
memcached-1.6.23.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

1
memcached-rpmlintrc Normal file
View File

@ -0,0 +1 @@
addFilter("incoherent-init-script-name")

1052
memcached.changes Normal file

File diff suppressed because it is too large Load Diff

23
memcached.service Normal file
View File

@ -0,0 +1,23 @@
[Unit]
Description=memcached daemon
After=network.target
[Service]
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
ProtectHome=true
PrivateDevices=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
EnvironmentFile=/etc/sysconfig/memcached
ExecStart=/usr/bin/memcached -u $MEMCACHED_USER $MEMCACHED_PARAMS
[Install]
WantedBy=multi-user.target

167
memcached.spec Normal file
View File

@ -0,0 +1,167 @@
#
# spec file for package memcached
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
%endif
%if 0%{?suse_version} > 1500
%bcond_without tls
%else
%bcond_with tls
%endif
Name: memcached
Version: 1.6.23
Release: 0
Summary: A high-performance, distributed memory object caching system
License: BSD-3-Clause
Group: Productivity/Networking/Other
URL: https://memcached.org/
Source: https://www.memcached.org/files/%{name}-%{version}.tar.gz
Source2: %{name}.sysconfig
Source3: memcached-rpmlintrc
Source4: memcached.service
Source5: system-user-memcached.conf
Patch0: harden_memcached.service.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: cyrus-sasl-devel
BuildRequires: libevent-devel >= 2.0
BuildRequires: libtool
BuildRequires: pkgconfig
Requires(pre): %fillup_prereq
Conflicts: memcached-unstable
%if %{with tls}
BuildRequires: openssl-devel >= 1.1.0
BuildRequires: perl
BuildRequires: perl-IO-Socket-SSL
BuildRequires: perl-Net-SSLeay
%endif
%if 0%{?suse_version} >= 1500
BuildRequires: sysuser-tools
%sysusers_requires
%else
Requires(pre): %{_sbindir}/groupadd
Requires(pre): %{_sbindir}/useradd
%endif
%if 0%{?suse_version} > 1210
BuildRequires: systemd-rpm-macros
%{?systemd_ordering}
%else
Requires(pre): %insserv_prereq
%endif
%description
Memcached is a high-performance, distributed memory object caching
system, generic in nature, but intended for use in speeding up dynamic
web applications by alleviating database load.
%package devel
Summary: Files needed for development using memcached protocol
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
%description devel
Memcached is a high-performance, distributed memory object caching
system, generic in nature, but intended for use in speeding up dynamic
web applications by alleviating database load.
This package contains development files
%prep
%setup -q
%patch0 -p1
%build
autoreconf -fi
%configure \
%if %{with tls}
--enable-tls \
%endif
--enable-sasl \
--enable-sasl-pwdb \
--enable-seccomp \
--disable-coverage \
%ifarch s390 s390x ppc ppc64
--disable-extstore
%endif
%make_build
%if 0%{?suse_version} >= 1500
%sysusers_generate_pre %{SOURCE5} memcached system-user-memcached.conf
%endif
%install
%make_install
install -D -m 0755 scripts/memcached-tool %{buildroot}%{_bindir}/memcached-tool
install -Dd -m 0751 %{buildroot}%{_localstatedir}/lib/%{name}
install -D -m 0644 %{SOURCE2} %{buildroot}%{_fillupdir}/sysconfig.%{name}
install -d -m 755 %{buildroot}%{_sbindir}
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
install -D -m 0644 %{SOURCE4} %{buildroot}%{_unitdir}/%{name}.service
%if 0%{?suse_version} >= 1500
mkdir -p %{buildroot}%{_sysusersdir}
install -m 0644 %{SOURCE5} %{buildroot}%{_sysusersdir}/
%endif
%check
%make_build test
%if 0%{?suse_version} >= 1500
%pre -f memcached.pre
%else
%pre
getent group %{name} >/dev/null || \
%{_sbindir}/groupadd -r %{name}
getent passwd %{name} >/dev/null || \
%{_sbindir}/useradd -g %{name} -s /bin/false -r \
-c "user for %{name}" -d %{_localstatedir}/lib/%{name} %{name}
%endif
%service_add_pre %{name}.service
%post
%service_add_post %{name}.service
%fillup_only %{name}
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%files
%doc AUTHORS ChangeLog NEWS
%license COPYING
%{_bindir}/%{name}
%{_bindir}/memcached-tool
%{_sbindir}/rc%{name}
%{_mandir}/man1/%{name}.*
%{_unitdir}/%{name}.service
%{_fillupdir}/sysconfig.%{name}
%dir %attr(751,root,root) %{_localstatedir}/lib/%{name}
%if 0%{?suse_version} >= 1500
%{_sysusersdir}/system-user-memcached.conf
%endif
%files devel
%doc AUTHORS ChangeLog NEWS doc/*.txt
%license COPYING
%{_includedir}/%{name}
%changelog

31
memcached.sysconfig Normal file
View File

@ -0,0 +1,31 @@
## Path: Network/WWW/Memcached
## Description: start parameters for memcached.
## Type: string
## Default: "-l 127.0.0.1"
## Config: memcached
#
# start parameters for memcached.
#
# see man 1 memcached for more
#
MEMCACHED_PARAMS="-l 127.0.0.1"
## Path: Network/WWW/Memcached
## Description: username memcached should run as
## Type: string
## Default: "memcached"
## Config: memcached
#
# username memcached should run as
#
MEMCACHED_USER="memcached"
## Path: Network/WWW/Memcached
## Description: group memcached should be run as
## Type: string
## Default: "memcached"
## Config: memcached
#
# group memcached should be run as
#
MEMCACHED_GROUP="memcached"

View File

@ -0,0 +1,2 @@
#Type Name ID GECOS Home directory Shell
u memcached - "user for memcached" /var/lib/memcached -