From 5a03d3f45a4f02cf171eb521b3e160d3ca3e76ca Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Tue, 9 Jan 2024 10:00:37 +0100 Subject: [PATCH] =?utf8?q?immudex-crypt=20-=20poprawienie=20sposobu=20na?= =?utf8?q?=20okre=C5=9Blenie=20RUID=20oraz=20RUSER.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- tools/sbin/immudex-crypt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/sbin/immudex-crypt b/tools/sbin/immudex-crypt index 91ffd80..d966fff 100755 --- a/tools/sbin/immudex-crypt +++ b/tools/sbin/immudex-crypt @@ -75,7 +75,7 @@ function open() { # Różnica w reprezentacji czasu modyfikacji miedzy Debian testing a stable i oldstable #dmDevice=$(ls -l /dev/mapper/immudex-crypt${index} | awk '{printf $10}' | cut -d "/" -f 2); lastField=$(ls -l /dev/mapper/immudex-crypt${index} | grep -o ' ' | wc -l); - dmDevice=$(ls -al /dev/mapper/immudex-crypt0 | cut -d " " -f ${lastField}- | cut -d "/" -f2); + dmDevice=$(ls -al /dev/mapper/immudex-crypt${index} | cut -d " " -f ${lastField}- | cut -d "/" -f2); if ! $(sudo file -s /dev/${dmDevice} | grep -q 'ext4'); then echo "Could not determine filesystem of unlocked device."; echo -n "Format this device to ext4? (y/n): " @@ -151,10 +151,10 @@ if [ "$1" ]; then exit 1; fi - immudexCryptPID=$$; - parentProcessPID=$((immudexCryptPID - 1)); + #immudexCryptPID=$$; + #parentProcessPID=$((immudexCryptPID - 1)); #immudex-crypt RUID is EUID of sudo, which spawning immudex-crypt - export RUID=$(grep '^Uid:' /proc/${parentProcessPID}/status | awk '{printf $2}'); + export RUID=$(grep '^Uid:' /proc/$(pidof -s sudo)/status | awk '{printf $2}'); export USER=$(grep "$RUID" /etc/passwd | cut -d ":" -f1); case $1 in -- 2.39.5