python-provy / provy

provy is a provisioning system in python.

Home Page:http://docs.provy.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How about transactional change of ownership.

jbzdak opened this issue · comments

When changing ownership put_file works like that:

  1. Put the file in proper place
  2. chmod it

Whis mostly is OK, but sometimes it may hurt --- for example when updating sudoers file, a catually had to execute following command: mv {} /etc/sudoers && chmod 440 /etc/sudoers && chown root:root /etc/sudoers, because any after mv and before chown sudo is essentially unusable --- because it says thay sudoers have bar permissions.

I could patch put, replace file and so on to have following logic:

  1. Put the file in /tmp/
  2. Chmod and chown tempfile
  3. mv it to correct place.

This is better since file has correct permissions all along.

+1

On Tue, Oct 16, 2012 at 6:51 AM, Jacek Bzdak notifications@github.comwrote:

When changing ownership put_file works like that:

  1. Put the file in proper place
  2. chmod it

Whis mostly is OK, but sometimes it may hurt --- for example when updating
sudoers file, a catually had to execute following command: mv {}
/etc/sudoers && chmod 440 /etc/sudoers && chown root:root /etc/sudoers,
because any after mv and before chown sudo is essentially unusable ---
because it says thay sudoers have bar permissions.

I could patch put, replace file and so on to have following logic:

  1. Put the file in /tmp/
  2. Chmod and chown tempfile
  3. mv it to correct place.

This is better since file has correct permissions all along.


Reply to this email directly or view it on GitHubhttps://github.com/heynemann/provy/issues/66.

Will be done this way.