Release 236-2mamba

This commit is contained in:
Automatic Build System 2023-12-30 11:38:02 +01:00
parent b0361b44b2
commit 705cc94e26
2 changed files with 64 additions and 1 deletions

View File

@ -0,0 +1,58 @@
From 521251d2757295b6e9df4b51c7cb33929fbd65c4 Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppymaster@gmail.com>
Date: Sat, 30 Dec 2017 06:16:49 -0500
Subject: [PATCH] sysctl: use raw file descriptor in sysctl_write (#7753)
The kernel returns specific error codes which may be lost if we use the
libc buffered io functions.
Fixes: https://github.com/systemd/systemd/issues/7744
---
src/shared/sysctl-util.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/shared/sysctl-util.c b/src/shared/sysctl-util.c
index 189580e3ed..0bc81aaa56 100644
--- a/src/shared/sysctl-util.c
+++ b/src/shared/sysctl-util.c
@@ -18,9 +18,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <errno.h>
+#include <fcntl.h>
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
+#include "fd-util.h"
#include "fileio.h"
#include "log.h"
#include "macro.h"
@@ -53,6 +57,7 @@ char *sysctl_normalize(char *s) {
int sysctl_write(const char *property, const char *value) {
char *p;
+ _cleanup_close_ int fd = -1;
assert(property);
assert(value);
@@ -60,7 +65,17 @@ int sysctl_write(const char *property, const char *value) {
log_debug("Setting '%s' to '%s'", property, value);
p = strjoina("/proc/sys/", property);
- return write_string_file(p, value, WRITE_STRING_FILE_DISABLE_BUFFER);
+ fd = open(p, O_WRONLY|O_CLOEXEC);
+ if (fd < 0)
+ return -errno;
+
+ if (!endswith(value, "\n"))
+ value = strjoina(value, "\n");
+
+ if (write(fd, value, strlen(value)) < 0)
+ return -errno;
+
+ return 0;
}
int sysctl_read(const char *property, char **content) {

View File

@ -26,7 +26,7 @@
Name: systemd Name: systemd
Epoch: 2 Epoch: 2
Version: 236 Version: 236
Release: 1mamba Release: 2mamba
Summary: A system and service manager compatible with SysV and LSB init scripts Summary: A system and service manager compatible with SysV and LSB init scripts
Group: System/Configuration Group: System/Configuration
Vendor: openmamba Vendor: openmamba
@ -62,6 +62,7 @@ Patch13: systemd-219-upstream_do_not_spawn_jobs_or_during_coldplug.patch
Patch14: systemd-219-silend-about-device-appeared-twice.patch Patch14: systemd-219-silend-about-device-appeared-twice.patch
Patch15: systemd-232-udev-rootlibdir.patch Patch15: systemd-232-udev-rootlibdir.patch
Patch16: systemd-232-i586-disable_restrict_address_families.patch Patch16: systemd-232-i586-disable_restrict_address_families.patch
Patch17: systemd-236-use_raw_file_descriptor_in_sysctl_write.patch
License: GPL License: GPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
@ -228,6 +229,7 @@ This package include development files for building software using udev librarie
#%patch14 -p1 #%patch14 -p1
#%patch15 -p1 #%patch15 -p1
%patch16 -p1 %patch16 -p1
%patch17 -p1
%build %build
#./autogen.sh #./autogen.sh
@ -719,6 +721,9 @@ fi
%{_libdir}/pkgconfig/libudev.pc %{_libdir}/pkgconfig/libudev.pc
%changelog %changelog
* Tue Jan 02 2018 Silvan Calarco <silvan.calarco@mambasoft.it> 236-2mamba
- upstream patch to fix sysctl boot error
* Wed Dec 20 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 236-1mamba * Wed Dec 20 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 236-1mamba
- update to 236 - update to 236