Le Saturday 4 June 2005 02:36, Jeff Johnson a écrit :
> On Jun 3, 2005, at 7:10 PM, Olivier Thauvin wrote:
> > RPM is allways complaining about non existing user/group when
> > installing
> > src.rpm. Those information are very usefull. To avoid this a quick
> > solution
> > is to set root/root as owner (uid=gid=0) of all files in src.rpm.
>
> (after looking at source line no's ;0(
>
> This is the right place, but you can avoid some problems with getpwnam
> (3) lookup if the macros are either
> constant strings (like "root") or string valued (i.e. "%_sources_user
> root" in default macro config) rather
> than logical variables that change program flow.
>
> Something like
> u = rpmExpand("%{?_sources_user}", NULL)
> flp->uname = (u && *u ? u : getUname(flp->fl_uid))
> similarly for flp->gname;
>
> (Note: there's a memory leak for u that needs fixing).
I made the patch quickely, and in fact was thinking to use this schema.
And yes only this line add a memory leaks easy to avoid.
Tomorrow I reworks this and resend.
>
> Otherwise looks okay.
pgpC94dA8ca7B.pgp
Description: PGP signature
_______________________________________________
Rpm-devel mailing list
Rpm-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
|