From ec565166072e4220526e95ca5c61124375ab36ce Mon Sep 17 00:00:00 2001 From: kzak Date: Mon, 2 Apr 2007 11:44:38 +0000 Subject: [PATCH] add missing patch :-( --- psmisc-22.3-killall-ino.patch | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 psmisc-22.3-killall-ino.patch diff --git a/psmisc-22.3-killall-ino.patch b/psmisc-22.3-killall-ino.patch new file mode 100644 index 0000000..92891a9 --- /dev/null +++ b/psmisc-22.3-killall-ino.patch @@ -0,0 +1,37 @@ +--- psmisc-22.3/src/killall.c.kzak 2007-04-02 11:45:04.000000000 +0200 ++++ psmisc-22.3/src/killall.c 2007-04-02 12:56:54.000000000 +0200 +@@ -372,16 +372,29 @@ + } + else + { ++ int ok = 1; ++ + if (asprintf (&path, PROC_BASE "/%d/exe", pid_table[i]) < 0) + continue; + + if (stat (path, &st) < 0) ++ ok = 0; ++ ++ else if (sts[j].st_dev != st.st_dev || ++ sts[j].st_ino != st.st_ino) + { +- free (path); +- continue; +- } +- free (path); +- if (sts[j].st_dev != st.st_dev || sts[j].st_ino != st.st_ino) ++ /* maybe the binary has been modified and std[j].st_ino ++ * is not reliable anymore. We need to compare paths. ++ */ ++ char linkbuf[PATH_MAX]; ++ ++ if (readlink(path, linkbuf, sizeof(linkbuf)) <= 0 || ++ strcmp(namelist[j], linkbuf)) ++ ok = 0; ++ } ++ ++ free(path); ++ if (!ok) + continue; + } + } /* non-regex */