From 9f476f9567e0de93fe65018c0be13c068a9737c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 9 Dec 2021 17:05:34 +0100 Subject: [PATCH] Open target file in read only mode (fixes case of running it from non-root for root owned files etc). --- xfs_lsprojid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xfs_lsprojid b/xfs_lsprojid index 75a847d..ff630a4 100644 --- a/xfs_lsprojid +++ b/xfs_lsprojid @@ -2,7 +2,7 @@ # simple wrapper to show project id for specified paths, arekm@maven.pl 20111117 -xfs_io -p "$0" -c "stat" $@ | awk ' +xfs_io -r -p "$0" -c "stat" $@ | awk ' /^fd\.path =/ { projid=""; path=$3; gsub(/^\"/, "", path); gsub(/\"$/, "", path); } /^fsxattr\.projid =/ { projid=$3; print path ": " projid; } ' -- 2.43.0