Permission problems on Windows

44 views
Skip to first unread message

Armindo Silva

unread,
Sep 1, 2014, 1:35:47 PM9/1/14
to puppet...@googlegroups.com
Hi,

I have a zip file that has some binaries inside, if I unzip it (with 7z) manually and try to run one of the binaries and it just works, if I unzip it using puppet agent:

  exec { 'eMZP':
    command => 'cmd /c 7z x c:\myfolder\my.zip -oc:\myfolder\',
    creates => 'c:/myfolder/mybin.exe',
    require => File['c:/myfolder/my.zip'],
  }

the unziped files don't have exec permissions so I am not able to run them.
As workaround I have been setting the folder's mode but setting the mode on windows is deprecated.

Any ideas/pointers?

Best regards,
Armindo

Rob Reynolds

unread,
Sep 2, 2014, 2:53:01 PM9/2/14
to puppet...@googlegroups.com
On Mon, Sep 1, 2014 at 12:35 PM, Armindo Silva <deatho...@gmail.com> wrote:
Hi,

I have a zip file that has some binaries inside, if I unzip it (with 7z) manually and try to run one of the binaries and it just works, if I unzip it using puppet agent:

  exec { 'eMZP':
    command => 'cmd /c 7z x c:\myfolder\my.zip -oc:\myfolder\',
    creates => 'c:/myfolder/mybin.exe',
    require => File['c:/myfolder/my.zip'],
  }

the unziped files don't have exec permissions so I am not able to run them.

This is likely due to how Puppet does not inherit permissions down to the folder from the folder above. I thought we had fixed that in a newer version of Puppet though. What version of Puppet are you running on the box(es) in question?

 
As workaround I have been setting the folder's mode but setting the mode on windows is deprecated.

Deprecated, but still usable. The replacement is the acl module[1].

 

Any ideas/pointers?

Best regards,
Armindo

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/32d3a423-9307-4beb-b423-7ff9f0d35b77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Rob Reynolds
Developer, Puppet Labs

Join us at PuppetConf 2014September 20-24 in San Francisco
Register by September 8th to take advantage of the Final Countdown save $149!

Helen Paterson

unread,
Sep 8, 2014, 12:17:46 PM9/8/14
to puppet...@googlegroups.com
You could try

if $osfamily == 'windows' {
  File {
    source_permissions => ignore }
  # Puppet defaults to applying the ownership and permissions from the source files.(linux permission)

Renu Chuppala

unread,
Dec 10, 2014, 7:44:23 PM12/10/14
to puppet...@googlegroups.com
Hi Silva , Did you able to unzip the file using 7 zip using above code.I was trying but it is unable to find the zip file.Please help me to fix this.

Thanks
Renu
Reply all
Reply to author
Forward
0 new messages