From f79a699c13f928dbb2f6321b2265ca33bf2474ae Mon Sep 17 00:00:00 2001 From: Wolfgang Link Date: Fri, 16 Mar 2018 10:22:51 +0100 Subject: [PATCH] Add set CIFS credentials. --- 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.39.2