From 627f56f06cb190873fc988419cfc7fd03833b957 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Mon, 28 Jan 2013 19:44:37 -0800 Subject: [PATCH] If fstab has a usrquota=file directive, use it when checking if quotas are active https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3602466&group_id=17457 --- quota/linux-lib.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/quota/linux-lib.pl b/quota/linux-lib.pl index 22bd69740..a09be621b 100755 --- a/quota/linux-lib.pl +++ b/quota/linux-lib.pl @@ -103,6 +103,8 @@ sub quota_now local $rv = 0; local $dir = $_[0]->[0]; local %opts = map { $_, 1 } split(/,/, $_[0]->[3]); +local $ufile = $_[1]->[3] =~ /(usrquota|usrjquota)=([^, ]+)/ ? $2 : undef; +local $gfile = $_[1]->[3] =~ /(grpquota|grpjquota)=([^, ]+)/ ? $2 : undef; if ($_[0]->[2] eq "xfs") { # For XFS, assume enabled if setup in fstab $rv += 1 if ($opts{'quota'} || $opts{'usrquota'} || @@ -112,7 +114,8 @@ if ($_[0]->[2] eq "xfs") { } if ($_[0]->[4]%2 == 1) { # test user quotas - if (-r "$dir/quota.user" || -r "$dir/aquota.user") { + if (-r "$dir/quota.user" || -r "$dir/aquota.user" || + $ufile && -r "$dir/$ufile") { local $stout = &supports_status($dir, "user"); if ($stout =~ /is\s+(on|off|enabled|disabled)/) { # Can use output from -p mode @@ -144,7 +147,8 @@ if ($_[0]->[4]%2 == 1) { } if ($_[0]->[4] > 1) { # test group quotas - if (-r "$dir/quota.group" || -r "$dir/aquota.group") { + if (-r "$dir/quota.group" || -r "$dir/aquota.group" || + $gfile && -r "$dir/$gfile") { local $stout = &supports_status($dir, "group"); if ($stout =~ /is\s+(on|off|enabled|disabled)/) { # Can use output from -p mode