Re: Problem with %attr/%defattr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 :
> 
> %files
> /var/qmail/bin
> /var/qmail/boot
> %config(noreplace) /var/qmail/control
> /var/qmail/doc
> /var/qmail/log
> /var/qmail/man
> %config(noreplace) /var/qmail/queue
> /var/qmail/users
> /var/qmail/rc
> 
> 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
> avail.

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.

%attr(-,qmails,root) /var/qmail/queue/remote
%attr(-,qmailq,root) /var/qmail/queue/remote

Hope this helps,

-- 
--    Jos Vos <jos@xxxxxx>
--    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
--    Amsterdam, The Netherlands        |     Fax: +31 20 6948204
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list


[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux