mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Don't run xfsdb if we're not root.
This commit is contained in:
+4
-1
@@ -73,7 +73,7 @@ use File::Basename;
|
||||
chomp($os = `uname`);
|
||||
|
||||
#
|
||||
# fsinfo: get filesystem info put it into the global namespace, assigns:
|
||||
# fsinfo: get filesystem info put it into the global namespace, initialises:
|
||||
# $dev, $type, $blocks, $used, $avail, $cap, $mnt, $mnt_options
|
||||
# $fsblocks, $fsblocksize, $agblocks, $agcount, $imax_pct, $logblocks
|
||||
# $logstart, $internal
|
||||
@@ -101,6 +101,8 @@ sub fsinfo {
|
||||
@mtab = split(/ +/);
|
||||
$mnt_options = $mtab[3];
|
||||
|
||||
# if we're running as root run xfs_db on the filesystem
|
||||
if ($> == 0) {
|
||||
# xfs_db: read only, use the default superblock, print everything
|
||||
die("Error: $progname: can't read device: \"$dev\"\n") if (! -r $dev);
|
||||
$_=`xfs_db -r -c sb -c p $dev`;
|
||||
@@ -123,6 +125,7 @@ Filesystem information:
|
||||
agcount=$agcount; agblocks=$agblocks; logblocks=$logblocks; logstart=$logstart$internal
|
||||
EOF
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# returns numbers with a normal distribution
|
||||
|
||||
Reference in New Issue
Block a user