Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
openssh-askpass-gnome
openssh-bsc1216474-s390-leave-fds-open.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File openssh-bsc1216474-s390-leave-fds-open.patch of Package openssh-askpass-gnome
Zseries only: Leave the hardware filedescriptors open. All filedescriptors above 2 are getting closed when a new sshd process to handle a new client connection is spawned. As the process also chroot into an empty filesystem without any device nodes, there is no chance to reopen the files. This patch filters out the reqired fds in the closefrom function so these are skipped in the close loop. Author: Harald Freudenberger <freude@de.ibm.com> --- openbsd-compat/bsd-closefrom.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) --- a/openbsd-compat/bsd-closefrom.c +++ b/openbsd-compat/bsd-closefrom.c @@ -82,7 +82,33 @@ closefrom(int lowfd) fd = strtol(dent->d_name, &endp, 10); if (dent->d_name != endp && *endp == '\0' && fd >= 0 && fd < INT_MAX && fd >= lowfd && fd != dirfd(dirp)) +#ifdef __s390__ + { + /* + * the filedescriptors used to communicate with + * the device drivers to provide hardware support + * should survive. HF <freude@de.ibm.com> + */ + char fpath[PATH_MAX], lpath[PATH_MAX]; + len = snprintf(fpath, sizeof(fpath), "%s/%s", + fdpath, dent->d_name); + if (len > 0 && (size_t)len <= sizeof(fpath)) { + len = readlink(fpath, lpath, sizeof(lpath)); + if (len > 0) { + lpath[len] = 0; + if (strstr(lpath, "dev/z90crypt") + || strstr(lpath, "dev/zcrypt") + || strstr(lpath, "dev/prandom") + || strstr(lpath, "dev/shm/icastats")) + fd = -1; + } + } + if (fd >= 0) + (void) close((int) fd); + } +#else (void) close((int) fd); +#endif } (void) closedir(dirp); return; --- openssh-8.7p1/openbsd-compat/bsd-closefrom.c.orig 2022-04-12 15:47:03.815044607 +0200 +++ openssh-8.7p1/openbsd-compat/bsd-closefrom.c 2022-04-12 15:48:12.464963511 +0200 @@ -16,7 +16,7 @@ #include "includes.h" -#ifndef HAVE_CLOSEFROM +#if (!defined HAVE_CLOSEFROM) || (defined __s390__) #include <sys/types.h> #include <sys/param.h>
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor