# File lib/puppet/util/settings.rb, line 714
714:   def writesub(default, file, *args, &bloc)
715:     obj = get_config_file_default(default)
716:     chown = nil
717:     if Puppet.features.root?
718:       chown = [obj.owner, obj.group]
719:     else
720:       chown = [nil, nil]
721:     end
722: 
723:     Puppet::Util::SUIDManager.asuser(*chown) do
724:       mode = obj.mode || 0640
725:       args << "w" if args.empty?
726: 
727:       args << mode
728: 
729:       # Update the umask to make non-executable files
730:       Puppet::Util.withumask(File.umask ^ 0111) do
731:         File.open(file, *args) do |file|
732:           yield file
733:         end
734:       end
735:     end
736:   end