Your message dated Mon, 20 Jun 2011 12:47:37 +0000
with message-id <[email protected]>
and subject line Bug#623425: fixed in psmisc 22.14-1
has caused the Debian Bug report #623425,
regarding [hurd] killall: ftbfs, fails to run
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
623425: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=623425
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: psmisc
Version: 22.13-1
Severity: important
Tags: patch
Hi Craig,
Two quick fixes in the ongoing fight against hurd.
killall uses a buffer of size PATH_MAX (why not SYMLINK_MAX?) to
hold the link target when falling back to comparing /proc/<pid>/exe to
the <path> passed on the command line. On platforms with no
PATH_MAX, it therefore fails to build from source.
Patch 1 switches to a buffer of size strlen("<path>") + 1, which
should be large enough to fit a symlink target that matches and to
determine whether the actual target is longer. The buffer was missing
a null-terminator and tested using strcmp, so patch 1 switches to
memcmp while at it.
Patch 2 teaches killall to look at /proc/$$/stat instead of
/proc/self/stat to see whether /proc is mounted at all. Hurd supports
the former but not the latter (luckily killall doesn't seem to need
/proc/self aside from that sanity check).
So now you can use "killall foo" to kill all instances of "foo" even
on hurd.
Thoughts?
>From 0adb16446bb02c802a68c9d51f69fe61f92a646a Mon Sep 17 00:00:00 2001
From: Jonathan Nieder <[email protected]>
Date: Tue, 19 Apr 2011 23:19:35 -0500
Subject: [PATCH 1/2] killall: fix textual path comparison fallback
Ever since psmisc 22.4 (2007-04-08), "killall <path>" compares
the target of the /proc/<pid>/exe link to <path> when comparison
of inode numbers fails. But the code to do this has two problems:
- readlink does not NUL-terminate, but we use strcmp to
compare strings. Probably this hasn't been a problem so far
because (1) the on-stack buffer happened to have zeroes in the
right places or (2) some implementations of readlink might
happen to NUL-terminate their result when convenient anyway.
- it relies on PATH_MAX to determine the size of the buffer,
so the code fails to build from source on platforms (like the
Hurd) that have no global PATH_MAX.
Fix both by using a buffer of size strlen("<path>") + 1 and comparing
the link target to <path> with memcmp after checking that it fit in
the buffer.
For consistency with the surrounding code, the pid is considered not
to match if malloc or readlink fails.
Signed-off-by: Jonathan Nieder <[email protected]>
---
src/killall.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/killall.c b/src/killall.c
index 8b590c2..93de30d 100644
--- a/src/killall.c
+++ b/src/killall.c
@@ -511,11 +511,14 @@ kill_all (int signal, int names, char **namelist, struct
passwd *pwent)
/* maybe the binary has been modified and std[j].st_ino
* is not reliable anymore. We need to compare paths.
*/
- char linkbuf[PATH_MAX];
+ size_t len = strlen(namelist[j]);
+ char *linkbuf = malloc(len + 1);
- if (readlink(path, linkbuf, sizeof(linkbuf)) <= 0 ||
- strcmp(namelist[j], linkbuf))
+ if (!linkbuf ||
+ readlink(path, linkbuf, len + 1) != len ||
+ memcmp(namelist[j], linkbuf, len))
ok = 0;
+ free(linkbuf);
}
free(path);
--
1.7.5.rc2
>From efc08c926a8dbf5af4b956613dc862280e1b33df Mon Sep 17 00:00:00 2001
From: Jonathan Nieder <[email protected]>
Date: Wed, 20 Apr 2011 00:12:00 -0500
Subject: [PATCH 2/2] killall: tolerate platforms without /proc/self
The Hurd has most of the expected /proc/<pid> hierarchy but no
/proc/self. Without this change, running "sleep 10 & killall sleep"
on that platform produces the confusing message:
/proc is empty (not mounted ?)
Afterwards, we will get
$ sleep 10 & killall sleep
[1] 9682
[1]+ Terminated sleep 10
as expected.
Signed-off-by: Jonathan Nieder <[email protected]>
---
src/killall.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/killall.c b/src/killall.c
index 93de30d..ac3a279 100644
--- a/src/killall.c
+++ b/src/killall.c
@@ -686,6 +686,17 @@ void print_version()
"For more information about these matters, see the files named
COPYING.\n"));
}
+static int
+have_proc_self_stat (void)
+{
+ char filename[128];
+ struct stat isproc;
+ pid_t pid = getpid();
+
+ snprintf(filename, sizeof(filename), PROC_BASE"/%d/stat", (int) pid);
+ return stat(filename, &isproc) == 0;
+}
+
int
main (int argc, char **argv)
{
@@ -694,7 +705,6 @@ main (int argc, char **argv)
int optc;
int myoptind;
struct passwd *pwent = NULL;
- struct stat isproc;
char yt[16];
char ot[16];
@@ -860,8 +870,8 @@ main (int argc, char **argv)
fprintf (stderr, _("Maximum number of names is %d\n"), MAX_NAMES);
exit (1);
}
- if (stat("/proc/self/stat", &isproc)==-1) {
- fprintf (stderr, _("%s is empty (not mounted ?)\n"), PROC_BASE);
+ if (!have_proc_self_stat()) {
+ fprintf (stderr, _("%s lacks process entries (not mounted ?)\n"),
PROC_BASE);
exit (1);
}
argv = argv + myoptind;
--
1.7.5.rc2
--- End Message ---
--- Begin Message ---
Source: psmisc
Source-Version: 22.14-1
We believe that the bug you reported is fixed in the latest version of
psmisc, which is due to be installed in the Debian FTP archive:
psmisc_22.14-1.diff.gz
to main/p/psmisc/psmisc_22.14-1.diff.gz
psmisc_22.14-1.dsc
to main/p/psmisc/psmisc_22.14-1.dsc
psmisc_22.14-1_amd64.deb
to main/p/psmisc/psmisc_22.14-1_amd64.deb
psmisc_22.14.orig.tar.gz
to main/p/psmisc/psmisc_22.14.orig.tar.gz
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Craig Small <[email protected]> (supplier of updated psmisc package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Mon, 20 Jun 2011 22:28:44 +1000
Source: psmisc
Binary: psmisc
Architecture: source amd64
Version: 22.14-1
Distribution: unstable
Urgency: low
Maintainer: Craig Small <[email protected]>
Changed-By: Craig Small <[email protected]>
Description:
psmisc - utilities that use the proc file system
Closes: 609904 623425
Changes:
psmisc (22.14-1) unstable; urgency=low
.
* New upstream release, many fixes including:
killall creates right size buffer instead of MAX_PATH Closes: #623425
fuser understands IPv6 addresses, removed comment in fuser.1 that it
doesn't Closes: #609904
* Updated to standards 3.9.2 no change
Checksums-Sha1:
cd6cb801082bc4444eb518044250c6297e394cb6 961 psmisc_22.14-1.dsc
dc6fc0ec131c11796d01512bbd80089719b04a66 382024 psmisc_22.14.orig.tar.gz
bf44240ebd88c097691eb9c789f98454af3dcf0e 5843 psmisc_22.14-1.diff.gz
834f82416694291d97b167761a3561d9e334be15 118380 psmisc_22.14-1_amd64.deb
Checksums-Sha256:
18af1a960929b42e81833660bcc6926e849868b92e250754d968c6879c67a306 961
psmisc_22.14-1.dsc
22bbf4561837af475c0d8d14e3b9cab453998c787212c107fac7faf2f281e26e 382024
psmisc_22.14.orig.tar.gz
8e17d57b9fa60b83eb40a7f45f2a86b93fdf7d6873a2bd5d304a2cc6f7efdf56 5843
psmisc_22.14-1.diff.gz
ae448d98b46ce04bc920c6117e3978cee5b32d9e372f969bcae47082c5b463e7 118380
psmisc_22.14-1_amd64.deb
Files:
562286aae58f79805221a389576e71f6 961 admin optional psmisc_22.14-1.dsc
ba3f4e971895c92bba7770d81c981503 382024 admin optional psmisc_22.14.orig.tar.gz
11d391a98da6654eab01c573ee46edaf 5843 admin optional psmisc_22.14-1.diff.gz
3db11be45159dce032ed984e83bba2ee 118380 admin optional psmisc_22.14-1_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEARECAAYFAk3/QPoACgkQx2zlrBLK36XucQCaAqR52kiBiUajtoTUC+uuVHrt
lFMAoIwIu+2bSWVIqhRAq4/dWR9p4A29
=62VT
-----END PGP SIGNATURE-----
--- End Message ---