Commit 429f1f51 authored by Mike Hibler's avatar Mike Hibler

Tweak os_islocaldir for m400 admin MFS where nothing is local.

Because the m400 MFS is NFS-mounted our traditional check to see if
a user homedir was local or NFS-mounted didn't work right. Now a homedir
is local if either it is really local or it is NFS-mounted but on the
same FS as "/". And we only do that latter on an MFS right now.
parent edb52102
......@@ -1295,6 +1295,18 @@ sub MapShell($)
return $fullpath;
}
sub os_samefs($$)
{
my ($d1,$d2) = @_;
my $d1dev = `stat -c '%d' $d1`;
chomp($d1dev) if ($? == 0);
my $d2dev = `stat -c '%d' $d2`;
chomp($d2dev) if ($? == 0);
return ($d1dev && $d2dev && $d1dev == $d2dev) ? 1 : 0;
}
# Return non-zero if given directory is on a "local" filesystem
sub os_islocaldir($)
{
......@@ -1305,6 +1317,15 @@ sub os_islocaldir($)
if (grep(!/^filesystem/i, @dfoutput) > 0) {
$rv = 1;
}
#
# XXX hack for NFS-based MFS. We treat it as a local directory
# if it is on the same FS as /.
#
if ($rv == 0 && libsetup::MFS() && os_samefs("/", $dir)) {
$rv = 1;
}
return $rv;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment