]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/CIFSPlugin.pm
cifs: improve warning for password but no username set
[pve-storage.git] / PVE / Storage / CIFSPlugin.pm
index 7ec71642f925679a27c56d9bb6128e0c7d0727a7..02210692fddeaeef8f732d5baf30d7e9b29212e1 100644 (file)
@@ -59,9 +59,6 @@ sub get_cred_file {
 
     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;
 }
@@ -158,37 +155,43 @@ sub check_config {
 # 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 "ignoring password parameter\n";
+           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 "ignoring password parameter\n";
+           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 {
@@ -278,4 +281,13 @@ sub check_connection {
     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;