Skip to content

Commit

Permalink
make-automaps: Replace 'nfsd41' by 'nfs40'
Browse files Browse the repository at this point in the history
We used to tag hosts, which are trusted to serve nfs with version >4.0
with the tag 'nfsd41'. Now we want to switch that to a alternative tag
for hosts, which are not trusted to server nfs>4.0. The new tag is
'nfs40' and the meaning is the opposite.

Change code to honor the 'nfs40' tag instead of the 'nfsd41' tag.
  • Loading branch information
donald committed Feb 28, 2019
1 parent fc348be commit 8d34998
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions make-automaps/make-automaps
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ use warnings;
chomp (my $hostname=`uname -n`);$hostname=~s/\..*//;

{
my %SERVER_CAN_41;
my %SERVER_LIMIT_NFS40;
sub server_vers_opt {
my ($servername)=@_;
unless (exists $SERVER_CAN_41{$servername}) {
unless (exists $SERVER_LIMIT_NFS40{$servername}) {
my $pid=fork;
if (defined $pid) {
unless ($pid) {
open STDERR,'>','/dev/null';
exec 'hostconfig','--host',$servername,'nfsd41';
exec 'hostconfig','--host',$servername,'nfs40';
die "exec failed: $!\n";
}
wait;
$SERVER_CAN_41{$servername} = $? ? 0 : 1;
$SERVER_LIMIT_NFS40{$servername} = $? ? 0 : 1;
} else {
$SERVER_CAN_41{$servername} = 0;
$SERVER_LIMIT_NFS40{$servername} = 0;
}
}
return $SERVER_CAN_41{$servername} ? () : ('-vers=4.0');
return $SERVER_LIMIT_NFS40{$servername} ? ('-vers=4.0') : ();
}
}

Expand Down

0 comments on commit 8d34998

Please sign in to comment.