summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2007-04-24 15:36:38 +0000
committerjkar8572 <jkar8572>2007-04-24 15:36:38 +0000
commit77a79ea8a3669f6c51f9079d8cd350c8743f2ee5 (patch)
tree59199af005272ed1f2d2da7a577e89ea7cc31a0e
parent7003af5ad19d626f43913ba54478df47d46fc32e (diff)
Recognize ext4 filesystem (Jan Kara)
Fix LDAP scripts to use VISUAL instead of EDITOR (Michael Meskes)
-rw-r--r--Changelog2
-rwxr-xr-xldap-scripts/applySystemQuotas.pl11
-rwxr-xr-xldap-scripts/edquota_editor4
-rw-r--r--mntopt.h1
-rw-r--r--quotasys.c1
5 files changed, 14 insertions, 5 deletions
diff --git a/Changelog b/Changelog
index f6b6e37..e960732 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,6 @@
Changes in quota-tools from 3.14 to 3.15
+* fix LDAP scripts to set VISUAL instead of EDITOR (Michael Meskes)
+* added ext4 filesystem to the list of supported filesystems (Jan Kara)
* pot.o is now compiled with CFLAGS (Ladislav Michnovic)
* use -fPIE for compilation when available (Jan Kara, Ladislav Michnovic)
* fixed some more problems XFS quotaon (Kouta Ooizumi, Jan Kara)
diff --git a/ldap-scripts/applySystemQuotas.pl b/ldap-scripts/applySystemQuotas.pl
index 762eb82..41c74d9 100755
--- a/ldap-scripts/applySystemQuotas.pl
+++ b/ldap-scripts/applySystemQuotas.pl
@@ -49,8 +49,8 @@ my $i = 0;
my $max = $search->count;
for ( $i=0; $i<$max; $i++ ) {
my $entry = $search->entry($i);
- my $editor = $ENV{'EDITOR'} if $ENV{'EDITOR'};
- $ENV{'EDITOR'} = $edquota_editor;
+ my $editor = $ENV{'VISUAL'} if $ENV{'VISUAL'};
+ $ENV{'VISUAL'} = $edquota_editor;
$ENV{'QUOTA_USER'} = $entry->get_value('uid');
# Delete all existing quotas for QUOTA_USER
$ENV{'QUOTA_FILESYS'} = '*';
@@ -73,7 +73,12 @@ for ( $i=0; $i<$max; $i++ ) {
qx($edquota -u $ENV{'QUOTA_USER'});
}
}
- $ENV{'EDITOR'} = $editor if $editor;
+ if ($editor) {
+ $ENV{'VISUAL'} = $editor;
+ }
+ else {
+ delete $ENV{'VISUAL'};
+ }
}
$search = $ldap->unbind;
diff --git a/ldap-scripts/edquota_editor b/ldap-scripts/edquota_editor
index 95a03ee..fdebd09 100755
--- a/ldap-scripts/edquota_editor
+++ b/ldap-scripts/edquota_editor
@@ -10,7 +10,7 @@ die "QUOTA_SFILES environment variable not set\n" unless defined $ENV{'QUOTA_SFI
die "QUOTA_HFILES environment variable not set\n" unless defined $ENV{'QUOTA_HFILES'};
open FILE, $ARGV[0];
-$qdata = join '', (@_=<FILE>);
+my $qdata = join '', (@_=<FILE>);
close FILE;
open FILE, ">$ARGV[0]";
print FILE &edit_quota_file($qdata, $ENV{'QUOTA_FILESYS'}, $ENV{'QUOTA_SBLOCKS'}, $ENV{'QUOTA_HBLOCKS'}, $ENV{'QUOTA_SFILES'}, $ENV{'QUOTA_HFILES'});
@@ -18,7 +18,7 @@ close FILE;
# edit_quota_file(data, filesys, sblocks, hblocks, sfiles, hfiles)
sub edit_quota_file {
- local($rv, $line, @line, $i);
+ my($rv, $line, @line, $i);
@line = split /\n/, $_[0];
for ( $i=0; $i<@line; $i++ ) {
if ($line[$i] =~ /^\s+(\S+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/ && ($1 eq $_[1] || $_[1] eq '*')) {
diff --git a/mntopt.h b/mntopt.h
index dc377b1..f732eda 100644
--- a/mntopt.h
+++ b/mntopt.h
@@ -6,6 +6,7 @@
/* filesystem type */
#define MNTTYPE_EXT2 "ext2" /* 2nd Extended file system */
#define MNTTYPE_EXT3 "ext3" /* ext2 + journaling */
+#define MNTTYPE_EXT4 "ext4dev" /* ext4 filesystem */
#define MNTTYPE_MINIX "minix" /* MINIX file system */
#define MNTTYPE_UFS "ufs" /* UNIX file system */
#define MNTTYPE_UDF "udf" /* OSTA UDF file system */
diff --git a/quotasys.c b/quotasys.c
index 401994b..c4f913c 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -61,6 +61,7 @@ static int correct_fstype(char *type)
*next = 0;
if (!strcmp(type, MNTTYPE_EXT2) ||
!strcmp(type, MNTTYPE_EXT3) ||
+ !strcmp(type, MNTTYPE_EXT4) ||
!strcmp(type, MNTTYPE_JFS) ||
!strcmp(type, MNTTYPE_MINIX) ||
!strcmp(type, MNTTYPE_UFS) ||