chantra / rpms / rpm

Forked from rpms/rpm 2 years ago
Clone
5523e9
--- rpm-4.11.3/build/files.c.old	2019-01-02 13:14:10.217068479 +0100
5523e9
+++ rpm-4.11.3/build/files.c	2019-03-20 13:18:38.290142740 +0100
5523e9
@@ -2015,23 +2015,32 @@
5523e9
 	    flp->fl_mode &= S_IFMT;
5523e9
 	    flp->fl_mode |= fl.def.ar.ar_fmode;
5523e9
 	}
5523e9
+
5523e9
 	if (fl.def.ar.ar_user) {
5523e9
 	    flp->uname = fl.def.ar.ar_user;
5523e9
 	} else {
5523e9
 	    flp->uname = rpmstrPoolId(fl.pool, rpmugUname(flp->fl_uid), 1);
5523e9
 	}
5523e9
+	if (! flp->uname) {
5523e9
+	    flp->uname = rpmstrPoolId(fl.pool, rpmugUname(getuid()), 1);
5523e9
+	}
5523e9
+	if (! flp->uname) {
5523e9
+	    flp->uname = rpmstrPoolId(fl.pool, "root", 1);
5523e9
+	}
5523e9
+
5523e9
 	if (fl.def.ar.ar_group) {
5523e9
 	    flp->gname = fl.def.ar.ar_group;
5523e9
 	} else {
5523e9
 	    flp->gname = rpmstrPoolId(fl.pool, rpmugGname(flp->fl_gid), 1);
5523e9
 	}
5523e9
-	flp->langs = xstrdup("");
5523e9
-	
5523e9
-	if (! (flp->uname && flp->gname)) {
5523e9
-	    rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), diskPath);
5523e9
-	    fl.processingFailed = 1;
5523e9
+	if (! flp->gname) {
5523e9
+	    flp->gname = rpmstrPoolId(fl.pool, rpmugGname(getgid()), 1);
5523e9
+	}
5523e9
+	if (! flp->gname) {
5523e9
+	    flp->gname = rpmstrPoolId(fl.pool, "root", 1);
5523e9
 	}
5523e9
 
5523e9
+	flp->langs = xstrdup("");
5523e9
 	fl.files.used++;
5523e9
     }
5523e9
     argvFree(files);
5523e9
--- rpm-4.11.3/build/parsePrep.c.old	2013-11-22 11:31:31.000000000 +0100
5523e9
+++ rpm-4.11.3/build/parsePrep.c	2019-03-20 13:19:33.705172465 +0100
5523e9
@@ -29,10 +29,6 @@
5523e9
 		urlfn, strerror(errno));
5523e9
 	return RPMRC_FAIL;
5523e9
     }
5523e9
-    if (!rpmugUname(sb.st_uid) || !rpmugGname(sb.st_gid)) {
5523e9
-	rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), urlfn);
5523e9
-	return RPMRC_FAIL;
5523e9
-    }
5523e9
 
5523e9
     return RPMRC_OK;
5523e9
 }