diff options
-rw-r--r-- | Changelog | 2 | ||||
-rwxr-xr-x | ldap-scripts/applySystemQuotas.pl | 11 | ||||
-rwxr-xr-x | ldap-scripts/edquota_editor | 4 | ||||
-rw-r--r-- | mntopt.h | 1 | ||||
-rw-r--r-- | quotasys.c | 1 |
5 files changed, 14 insertions, 5 deletions
@@ -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 '*')) { @@ -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 */ @@ -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) || |