4

Every time I update certain packages with rpm/yum, they reset certain permissions on their files / directories which I have intentionally changed for various reasons. Is there a way I can override the permissions that the packagers have specified in the RPMs, and force it to keep the permissions/owner/group that I've set?

On a Debian system, I would just use "dpkg-statoverride". I can't find any equivalent for RPM systems (CentOS 4 & 5 in my case).

2 Answers 2

1

I don't know the answer to your immediate question. However, I do know that when you run up against permissions problems like this it's a good idea to ask if perhaps there's a better way to go about solving the thing you're really trying to do. What package and files/directories are you changing the permissions on, and why?

Many packages use a specific group, maybe even one of their own, and by adding your user to that group you can get the freedom you need. If you really feel that the package should provide a way for non-root users to get at something in particular, report it as a bug against the package and maybe the maintainers will change it. Or, if you feel the permissions are too lax, report that as a bug too.

Another possibility is password-less sudo with restrictions. You can restrict it to particular users and to the running of particular commands. You could write a wrapper script for whatever it is that users need to do, and then allow password-less use of this script by users in a certain group.

Basically, there are lots of alternative approaches that you can use, which won't cause you to be fighting with the system all the time.

0

Built-in? Don't know of any. We use Puppet to manage our builds, so it's pretty easy to have File resources that depend on the RPM and enforce permissions.

Depending what sort of scale you're dealing with, a lighter solution might be as simple as a small script that chmod/chowns a list of directories/files that you run after each update.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .