[pve-devel] [PATCH V2 storage 02/10] Add set CIFS credentials.

Wolfgang Link w.link at proxmox.com
Fri Mar 16 10:22:51 CET 2018


---
 PVE/API2/Storage/Config.pm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/PVE/API2/Storage/Config.pm b/PVE/API2/Storage/Config.pm
index aa8c931..2d76e59 100755
--- a/PVE/API2/Storage/Config.pm
+++ b/PVE/API2/Storage/Config.pm
@@ -36,6 +36,18 @@ my $api_storage_config = sub {
     return $scfg;
 };
 
+my $set_cifs_credentials = sub {
+    my ($password, $storeid) = @_;
+
+    my $cred_path = '/etc/pve/priv/';
+
+    my $cred_file = $cred_path.$storeid.".cred";
+
+    PVE::Tools::file_set_contents($cred_file, "password=$password\n");
+
+    return $cred_file;
+};
+
 __PACKAGE__->register_method ({
     name => 'index', 
     path => '',
-- 
2.11.0





More information about the pve-devel mailing list