[pve-devel] applied: [PATCH pve-client] Use a different path for the lock file

Dietmar Maurer dietmar at proxmox.com
Wed Jun 20 06:54:13 CEST 2018


applied, but we can further cleanup code, because we do not need
to call make_path() inside PVE::APIClient::Config::save() ?

> On June 19, 2018 at 4:59 PM René Jochum <r.jochum at proxmox.com> wrote:
> 
> 
> This prevents lock_file from creating the config file with wrong permissions.
> 
> ---
>  PVE/APIClient/Config.pm | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/PVE/APIClient/Config.pm b/PVE/APIClient/Config.pm
> index a4aa4c6..a783ab3 100644
> --- a/PVE/APIClient/Config.pm
> +++ b/PVE/APIClient/Config.pm
> @@ -67,7 +67,10 @@ sub config_filename {
>  sub lock_config {
>      my ($class, $timeout, $code, @param) = @_;
>  
> -    my $filename = $class->config_filename();
> +    my $dir = PVE::APIClient::Helpers::configuration_directory();
> +    make_path($dir);
> +
> +    my $filename = "$dir/.config.lck";
>  
>      my $res = PVE::APIClient::Tools::lock_file($filename, $timeout, $code,
> @param);
>  
> -- 
> 2.11.0
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list