]> git.proxmox.com Git - pve-storage.git/commitdiff
Add set CIFS credentials.
authorWolfgang Link <w.link@proxmox.com>
Fri, 16 Mar 2018 09:22:51 +0000 (10:22 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 16 Mar 2018 10:58:34 +0000 (11:58 +0100)
PVE/API2/Storage/Config.pm

index aa8c931dca1dd18305fb33f2c025456524f5619f..2d76e599ebfae13cf4cf01c771c27041e4623e44 100755 (executable)
@@ -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 => '',