[pve-devel] [PATCH storage 04/11] Add set CIFS credentials.

Wolfgang Link w.link at proxmox.com
Tue Mar 13 15:11:04 CET 2018


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

diff --git a/PVE/API2/Storage/Config.pm b/PVE/API2/Storage/Config.pm
index fa8d4de..a321204 100755
--- a/PVE/API2/Storage/Config.pm
+++ b/PVE/API2/Storage/Config.pm
@@ -52,6 +52,17 @@ my $extract_cifs_credentials = sub {
     return "password=$password\n";
 };
 
+my $set_cifs_credentials = sub {
+    my ($user_data, $storeid) = @_;
+
+    my $cred_path = '/etc/pve/priv/';
+
+    my $cred_file = $cred_path.$storeid.".cred";
+    PVE::Tools::file_set_contents($cred_file, $user_data);
+
+    return $cred_file;
+};
+
 __PACKAGE__->register_method ({
     name => 'index', 
     path => '',
-- 
2.11.0





More information about the pve-devel mailing list