[Rpm-maint] [Patch 17/19] Make fcntl lock sensitive to --root

Paul Nasrat pnasrat at redhat.com
Fri Feb 9 12:04:41 UTC 2007


This makes rpm fcntl locking sensitive to alternate root paths
(rh#151255).

--- rpm-4.4.2/lib/rpmlock.c.userlock	2006-02-23 15:24:46.000000000 -0500
+++ rpm-4.4.2/lib/rpmlock.c	2006-02-23 15:25:53.000000000 -0500
@@ -37,7 +37,7 @@
 
 	/* XXX oneshot to determine path for fcntl lock. */
 	if (rpmlock_path == NULL) {
-	    char * t = rpmExpand(rpmlock_path_default, NULL);
+	    char * t = rpmGenPath(rootdir, rpmlock_path_default, NULL);
 	    if (t == NULL || *t == '\0' || *t == '%')
 		t = RPMLOCK_PATH;
 	    rpmlock_path = xstrdup(t);
@@ -129,7 +129,7 @@
 	const char *rootDir = rpmtsRootDir(ts);
 	rpmlock lock;
 
-	if (!rootDir)
+	if (!rootDir || rpmtsChrootDone(ts))
 		rootDir = "/";
 	lock = rpmlock_new(rootDir);
 /*@-branchstate@*/





More information about the Rpm-maint mailing list