Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 108534 Details for
Bug 138788
[PATCH] pidof bug renders machine unbootable when NFS is stuck
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Updated patch for SysVinit-2.85-4 to support symlinks as prog args
nfs_block_v2_AS3_SysVinit-2.85-4.patch (text/plain), 2.10 KB, created by
Constantine Gavrilov
on 2004-12-14 16:59:32 UTC
(
hide
)
Description:
Updated patch for SysVinit-2.85-4 to support symlinks as prog args
Filename:
MIME Type:
Creator:
Constantine Gavrilov
Created:
2004-12-14 16:59:32 UTC
Size:
2.10 KB
patch
obsolete
>--- src/killall5.c Tue Dec 14 11:38:26 2004 >+++ src/killall5.c Tue Dec 14 11:28:33 2004 >@@ -50,8 +50,6 @@ > char *fullname; /* Name as found out from argv[0] */ > char *basename; /* Only the part after the last / */ > char *statname; /* the statname without braces */ >- ino_t ino; /* Inode number */ >- dev_t dev; /* Device it is on */ > pid_t pid; /* Process ID. */ > int sid; /* Session ID. */ > struct _proc_ *next; /* Pointer to next struct. */ >@@ -155,7 +153,6 @@ > FILE *fp; > int pid, f; > PROC *p, *n; >- struct stat st; > int c; > > /* Open the /proc directory. */ >@@ -225,6 +222,7 @@ > if (p->sid < 0) { > p->sid = 0; > nsyslog(LOG_ERR, "can't read sid for pid %d\n", pid); >+ free(p->statname); > free(p); > continue; > } >@@ -249,17 +247,20 @@ > p->basename = p->fullname; > } else { > /* Process disappeared.. */ >+ free(p->statname); > free(p); > continue; > } > > /* Try to stat the executable. */ > snprintf(path, sizeof(path), "/proc/%s/exe", d->d_name); >- if (stat(path, &st) == 0) { >- p->dev = st.st_dev; >- p->ino = st.st_ino; >- p->pathname = (char *)xmalloc(PATH_MAX); >- readlink(path, p->pathname, PATH_MAX); >+ >+ p->pathname = (char *)xmalloc(PATH_MAX); >+ if(readlink(path, p->pathname, PATH_MAX) < 0) { >+ free(p->statname); >+ free(p->fullname); >+ free(p); >+ continue; > } > > /* Link it into the list. */ >@@ -322,16 +323,16 @@ > /* Try to get the process ID of a given process. */ > PIDQ *pidof(char *prog) > { >- struct stat st; > int dostat = 0; > PROC *p; > PIDQ *q; > char *s; > int foundone = 0; > int ok = 0; >+ char real_path[PATH_MAX]; > > /* Try to stat the executable. */ >- if (prog[0] == '/' && stat(prog, &st) == 0) dostat++; >+ if (prog[0] == '/' && realpath(prog, real_path)) dostat++; > > /* Get basename of program. */ > if ((s = strrchr(prog, '/')) == NULL) >@@ -345,7 +346,7 @@ > /* First try to find a match based on dev/ino pair. */ > if (dostat) { > for (p = plist; p; p = p->next) { >- if (p->dev == st.st_dev && p->ino == st.st_ino) { >+ if (strcmp(real_path, p->pathname) == 0) { > add_pid_to_q(q, p); > foundone++; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 138788
:
106475
|
106478
|
108533
|
108534
|
108535
|
113650