if (-e $cred_file) {
return $cred_file;
- } elsif (-e "/etc/pve/priv/${storeid}.cred") {
- # FIXME: remove fallback with 7.0 by doing a rename on upgrade from 6.x
- return "/etc/pve/priv/${storeid}.cred";
}
return undef;
}
nodes => { optional => 1 },
disable => { optional => 1 },
maxfiles => { optional => 1 },
+ 'prune-backups' => { optional => 1 },
content => { optional => 1 },
format => { optional => 1 },
username => { optional => 1 },
# Storage implementation
sub on_add_hook {
- my ($class, $storeid, $scfg, %param) = @_;
+ my ($class, $storeid, $scfg, %sensitive) = @_;
- if (defined($param{password})) {
- cifs_set_credentials($param{password}, $storeid);
+ if (defined($sensitive{password})) {
+ cifs_set_credentials($sensitive{password}, $storeid);
+ if (!exists($scfg->{username})) {
+ warn "storage $storeid: ignoring password parameter, no user set\n";
+ }
} else {
cifs_delete_credentials($storeid);
}
+
+ return;
}
sub on_update_hook {
- my ($class, $storeid, $scfg, %param) = @_;
+ my ($class, $storeid, $scfg, %sensitive) = @_;
- return if !exists($param{password});
+ return if !exists($sensitive{password});
- if (defined($param{password})) {
- cifs_set_credentials($param{password}, $storeid);
+ if (defined($sensitive{password})) {
+ cifs_set_credentials($sensitive{password}, $storeid);
+ if (!exists($scfg->{username})) {
+ warn "storage $storeid: ignoring password parameter, no user set\n";
+ }
} else {
cifs_delete_credentials($storeid);
}
+
+ return;
}
sub on_delete_hook {
my ($class, $storeid, $scfg) = @_;
cifs_delete_credentials($storeid);
+
+ return;
}
sub status {
} else {
push @$cmd, '-U', 'Guest','-N';
}
-
push @$cmd, '-c', 'echo 1 0';
my $out_str;
- eval {
- run_command($cmd, timeout => 2, outfunc => sub {$out_str .= shift;},
- errfunc => sub {});
- };
+ my $out = sub { $out_str .= shift };
+
+ eval { run_command($cmd, timeout => 10, outfunc => $out, errfunc => sub {}) };
if (my $err = $@) {
die "$out_str\n" if defined($out_str) &&
return 1;
}
+sub get_volume_notes {
+ my $class = shift;
+ PVE::Storage::DirPlugin::get_volume_notes($class, @_);
+}
+sub update_volume_notes {
+ my $class = shift;
+ PVE::Storage::DirPlugin::update_volume_notes($class, @_);
+}
+
1;