Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP3:GA
powerd
sysvinit-2.90-no-kill.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File sysvinit-2.90-no-kill.patch of Package powerd
--- src/killall5.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) --- src/killall5.c +++ src/killall5.c 2019-09-18 07:41:29.094181373 +0000 @@ -478,6 +478,38 @@ int readarg(FILE *fp, char *buf, int sz) } /* + * Scan the filedescriptors of pid for /dev/fuse + */ +int is_fuse(const char *pid) { + DIR *dir; + char path[256]; + char buf[256]; + struct dirent *d; + ssize_t len; + + /* Open /proc/pid/fd/ */ + snprintf(path, sizeof(path), "/proc/%s/fd", pid); + if ((dir = opendir(path)) != NULL) { + int dfd = dirfd(dir); + /* Walk through the directory. */ + while ((d = readdir(dir)) != NULL) { + if (*d->d_name == '.') + continue; + /* check for /dev/fuse */ + if ((len = readlinkat(dfd, d->d_name, buf, sizeof(buf))) > 0) { + buf[len] = '\0'; + if (strcmp("/dev/fuse", buf) == 0) + return 1; /* Fuse filesystem */ + } + } + closedir(dir); + } + + /* Not a fuse filesystem */ + return 0; +} + +/* * Read the proc filesystem. * CWD must be /proc to avoid problems if / is affected by the killing (ie depend on fuse). */ @@ -676,6 +708,26 @@ int readproc(int do_stat) p->nfs = 0; switch (do_stat) { + case NO_STAT: + if ((len = readlink(path, buf, PATH_MAX)) < 0) + break; + buf[len] = '\0'; + + /* Check for uevent handler, mdmon, and for providers + of FUSE filesystems */ + if ((strncmp(buf, "/sbin/udevd", 11) == 0) || + (strncmp(buf, "/sbin/mdmon", 11) == 0) || + (is_fuse(d->d_name))) { + OMIT *restrict optr; + + xmemalign((void*)&optr, sizeof(void*), alignof(OMIT)); + optr->next = omit; + optr->prev = (OMIT*)0; + optr->pid = pid; + omit = optr; + } + + break; case DO_NETFS: if ((p->nfs = check4nfs(path, buf))) goto link;
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