Unbreak file user/groupname handling in build
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 16 Dec 2010 07:35:08 +0000 (09:35 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 16 Dec 2010 07:40:27 +0000 (09:40 +0200)
- Fixes regression from commit a2d002a34bc567e8ce88c9ed30270d55d7c904fd,
  the librpmbuild "name cache" was used for unique string storage too
  and not just user/group-info lookup cache, duh.
- At least for now, making this separation explicit in the code
  by separating the "stash this string" operation from the actual
  user/group lookups.

build/files.c

index 2762578..71cc590 100644 (file)
@@ -1463,8 +1463,8 @@ static rpmRC addFile(FileList fl, const char * diskPath,
 
        flp->cpioPath = xstrdup(cpioPath);
        flp->diskPath = xstrdup(diskPath);
-       flp->uname = fileUname;
-       flp->gname = fileGname;
+       flp->uname = rpmugStashStr(fileUname);
+       flp->gname = rpmugStashStr(fileGname);
 
        if (fl->currentLangs && fl->nLangs > 0) {
            char * ncl;
@@ -2028,14 +2028,14 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags)
            flp->fl_mode |= fl.def_ar.ar_fmode;
        }
        if (fl.def_ar.ar_user) {
-           flp->uname = fl.def_ar.ar_user;
+           flp->uname = rpmugStashStr(fl.def_ar.ar_user);
        } else {
-           flp->uname = rpmugUname(flp->fl_uid);
+           flp->uname = rpmugStashStr(rpmugUname(flp->fl_uid));
        }
        if (fl.def_ar.ar_group) {
-           flp->gname = fl.def_ar.ar_group;
+           flp->gname = rpmugStashStr(fl.def_ar.ar_group);
        } else {
-           flp->gname = rpmugGname(flp->fl_gid);
+           flp->gname = rpmugStashStr(rpmugGname(flp->fl_gid));
        }
        flp->langs = xstrdup("");