2

I'm setting up jail shells using puppet to maintain a copy of the required libraries within the jails.

Using the following puppet code I can successfully copy the files across:

file { "/home/${username}/lib/x86_64-linux-gnu/libdl.so.2":
        ensure => present,
        source => "/lib/x86_64-linux-gnu/libdl.so.2",
        mode => '0700',
        links => 'manage',
        owner => $username,
        group => $username,
        require => File["/home/${username}/lib/x86_64-linux-gnu/"]
}

It appears though that the source file permissions are being changed to $username:$username as well as the destination file permissions.

The file /lib/x86_64-linux-gnu/libdl.so.2 end's up with the following permissions:

-rwx------ 1 $username $username ld-2.19.so

The jailed users are obviously able to login with this setup, but for everyone else that would be using /bin/bash in the real /lib folder it is breaking the login.

  • I ran your code on a test machine, and it works fine for me, i.e. it creates a broken symbolic link. Is there any chance that the resource File["/home/${username}/lib/x86_64-linux-gnu/"] might be causing the issue, i.e. your permissions are changed there? Please add the output of the puppet run with -v and --debug. – M. Glatki Jun 8 '16 at 22:22
0

You have to quote:

owner => '$username',

| improve this answer | |
  • it's not the fact that it is setting the file permissions incorrectly, i.e the $username is just a placeholder in the permissions example above. The problem is that the permissions are being set on the source file as well as the destination file – Stephen Mahood Jun 7 '16 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.