Merge ~grozzly/ubuntu/+source/cryptsetup:ubuntu/devel into ubuntu/+source/cryptsetup:ubuntu/devel

Proposed by Adam Vodopjan
Status: Needs review
Proposed branch: ~grozzly/ubuntu/+source/cryptsetup:ubuntu/devel
Merge into: ubuntu/+source/cryptsetup:ubuntu/devel
Diff against target: 20 lines (+2/-8)
1 file modified
debian/initramfs/cryptroot-unlock (+2/-8)
Reviewer Review Type Date Requested Status
Dan Bungert Pending
git-ubuntu import Pending
Review via email: mp+466145@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dan Bungert (dbungert) wrote :

LGTM, uploading.

Unmerged commits

0c79a7a... by Adam Vodopjan <email address hidden>

Clean up and fix pgrep_exe() in cryptroot-unlock

- minimize Debian vs Ubuntu differences in the code
- skip the header in "ps" output

This commit makes pgrep_exe() only look into the "pid" column of "ps" output.
As a side effect, the behaviour described in #1968636 no longer happens.

LP: #1968636

ea7fa22... by Julian Andres Klode

2:2.7.0-1ubuntu4 (patches unapplied)

Imported using git-ubuntu import.

4500c1e... by Steve Langasek

2:2.7.0-1ubuntu3 (patches unapplied)

Imported using git-ubuntu import.

ebbedbb... by Steve Langasek

2:2.7.0-1ubuntu2 (patches unapplied)

Imported using git-ubuntu import.

8fafc28... by Matthias Klose

2:2.7.0-1ubuntu1 (patches unapplied)

Imported using git-ubuntu import.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/initramfs/cryptroot-unlock b/debian/initramfs/cryptroot-unlock
2index 0e91701..f904acc 100644
3--- a/debian/initramfs/cryptroot-unlock
4+++ b/debian/initramfs/cryptroot-unlock
5@@ -40,14 +40,8 @@ fi
6 pgrep_exe() {
7 local exe pid
8 exe="$(readlink -f -- "$1" 2>/dev/null)" && [ -f "$exe" ] || return 0
9- ps | awk '{print $1, $5}' | while read LINE; do
10- set $LINE
11- local pid=$1
12- local cmd=$(readlink -f -- "$2")
13- if [ "$cmd" == "$exe" ]; then
14- echo $pid
15- break
16- fi
17+ ps | sed 1d | while read pid _; do
18+ [ "$(readlink -f "/proc/$pid/exe")" != "$exe" ] || printf '%d\n' "$pid"
19 done
20 }
21

Subscribers

People subscribed via source and target branches