Handle programs setting $0 incorrectly
E.g. like SpamAssassin's spamd, see
https://bugzilla.redhat.com/show_bug.cgi?id=755644
Thanks Wolodja Wentland!
Closes: #715000
Axel Beckert
10 years ago
537 | 537 |
if not data[-1]: data.pop()
|
538 | 538 |
# Strip first value, the interpreter
|
539 | 539 |
data.pop(0)
|
540 | |
# Strip all options following the interpreter, e.g. python's -O
|
541 | |
m = re.match("^-", data[0])
|
542 | |
while (m):
|
543 | |
data.pop(0)
|
|
540 |
# Check if something's left after the interpreter, see #715000
|
|
541 |
if data:
|
|
542 |
# Strip all options following the interpreter, e.g. python's -O
|
544 | 543 |
m = re.match("^-", data[0])
|
545 | |
if data and data[0]: data = data[0]
|
546 | |
data = self.which(data)
|
547 | |
m = re.search(r'^(/usr/\S+)$', data)
|
548 | |
if m:
|
549 | |
# store the real full path of script as the program
|
550 | |
self.program = m.group(1)
|
|
544 |
while (m):
|
|
545 |
data.pop(0)
|
|
546 |
m = re.match("^-", data[0])
|
|
547 |
if data and data[0]: data = data[0]
|
|
548 |
data = self.which(data)
|
|
549 |
m = re.search(r'^(/usr/\S+)$', data)
|
|
550 |
if m:
|
|
551 |
# store the real full path of script as the program
|
|
552 |
self.program = m.group(1)
|
551 | 553 |
except OSError, e:
|
552 | 554 |
if e.errno != errno.ENOENT:
|
553 | 555 |
if self.pid == 1:
|
0 | 0 |
debian-goodies (0.63) UNRELEASED; urgency=low
|
1 | 1 |
|
|
2 |
* [checkrestart]:
|
|
3 |
- Handle programs setting $0 / argv[0] incorrectly (e.g. spamd, see
|
|
4 |
https://bugzilla.redhat.com/show_bug.cgi?id=755644; Closes: #715000)
|
|
5 |
Thanks Wolodja Wentland!
|
2 | 6 |
* Mention check-enhancements in the long description
|
3 | 7 |
* Add example to checkrestart's man page (LP: #280793)
|
4 | 8 |
|