Problem with %attr/%defattr
jos at xos.nl
Fri Oct 7 12:57:17 UTC 2011
On Fri, Oct 07, 2011 at 06:11:15PM +0530, Amol Kulkarni wrote:
> The qmail makefile creates the files with appropriate permissions and
> ownerships. There is no code to set the permissions/ownership in spec file.
In %install a package should *never* set ownership of files, as you
should be able to build the package as *any* user (building a package
as root is almost a crime ;-)). If the Makefile does this, you should
apply a patch in your package to avoid this.
> In RHEL4, rpm was automatically taking the file permissions set on the files
> during the build/compile phase. But in RHEL6, it is changing the ownership
> to root.root.
> My files section is :
> %config(noreplace) /var/qmail/control
> %config(noreplace) /var/qmail/queue
> After searching the net, I tried using %defattr(-,-,-,-) macro at global
> level and the %attr(-,-,-) macro per entry in the %files section. But to no
You don't need to use %defattr (defaults to -,root,root), but use %attr
for the files/dirs that need a non-root owner/group, e.g.
Hope this helps,
-- Jos Vos <jos at xos.nl>
-- X/OS Experts in Open Systems BV | Phone: +31 20 6938364
-- Amsterdam, The Netherlands | Fax: +31 20 6948204
More information about the Rpm-list