Everytime i create a new file, the permissions are not set correctly.
else
# If the file doesn't exist then create it
File.new(resource[:file], "w", resource[:mode])
mech(resource[:file])
return false
end
This triggers the new file creation in httpauth/lib/puppet/provider/httpauth/httpauth.rb:22.
Afterwards the file permissions are always 0600, even though the resource[:mode] is resource[:mode] is 0640.
My umask on the system is 0022 if that is of any consideration.
Even changing the code to:
else
# If the file doesn't exist then create it
File.new(resource[:file], "w")
File.chmod(resource[:mode], resource[:file])
mech(resource[:file])
return false
end
did not change anything.
If I run puppet again and it runs:
if File.exist?(resource[:file])
# Set file mode to given value
File.chmod(resource[:mode], resource[:file])
everything is set correctly.
I am out of ideas. I am not a ruby developer. Maybe the file operations are asynchronous or something is really, really wrong here.
Everytime i create a new file, the permissions are not set correctly.
This triggers the new file creation in
httpauth/lib/puppet/provider/httpauth/httpauth.rb:22
. Afterwards the file permissions are always0600
, even though theresource[:mode]
isresource[:mode]
is0640
. My umask on the system is0022
if that is of any consideration.Even changing the code to:
did not change anything.
If I run puppet again and it runs:
everything is set correctly.
I am out of ideas. I am not a ruby developer. Maybe the file operations are asynchronous or something is really, really wrong here.
Environment:
Example code: