cifs: move plugin related code into plugin

This commit is contained in:
Dietmar Maurer
2018-03-16 13:07:05 +01:00
parent 304344ce34
commit a9db2ca8a5
2 changed files with 22 additions and 24 deletions

View File

@ -28,15 +28,28 @@ sub cifs_is_mounted {
return undef;
}
sub cifs_cred_file_name {
my ($storeid) = @_;
return "/etc/pve/priv/${storeid}.cred";
}
sub cifs_set_credentials {
my ($password, $storeid) = @_;
my $cred_file = cifs_cred_file_name($storeid);
PVE::Tools::file_set_contents($cred_file, "password=$password\n");
return $cred_file;
}
sub get_cred_file {
my ($storeid) = @_;
my $cred_file = '/etc/pve/priv/'.$storeid.'.cred';
my $cred_file = cifs_cred_file_name($storeid);
if (-e $cred_file) {
return $cred_file;
}
return undef;
return -e $cred_file ? $cred_file : undef;
}
sub cifs_mount {