Subject: | Does not handle multi-line output from listusers |
The listusers method in the AFS::Command::BOS module does not correctly handle the multi-line output which occurs when you have lots of admin users. Attached is a fairly simple patch which rectifies the problem.
Regards,
Stephen Quinney
Subject: | AFS-Command-listusers.patch |
diff -ruNp AFS-Command-1.99.orig/lib/AFS/Command/BOS.pm AFS-Command-1.99/lib/AFS/Command/BOS.pm
--- AFS-Command-1.99.orig/lib/AFS/Command/BOS.pm 2010-10-15 17:38:39.000000000 +0100
+++ AFS-Command-1.99/lib/AFS/Command/BOS.pm 2014-11-21 12:07:48.000000000 +0000
@@ -272,16 +272,21 @@ sub listusers {
$errors++ unless $self->_exec_cmds();
+ my @susers;
while ( defined($_ = $self->{handle}->getline()) ) {
chomp;
if ( /^SUsers are: (.*)/ ) {
- $result->_setAttribute( susers => [split(/\s+/,$1)] );
- }
+ push @susers, split /\s+/, $1;
+ } else {
+ push @susers, split /\s+/, $_;
+ }
}
+ $result->_setAttribute( susers => \@susers );
+
$errors++ unless $self->_reap_cmds();
$errors++ unless $self->_restore_stderr();