diff -ur rpm-4.3.3/lib/rpmlock.c rpm-4.3.3-lock-in-root/lib/rpmlock.c
--- rpm-4.3.3/lib/rpmlock.c	2004-11-12 00:35:45.000000000 +0300
+++ rpm-4.3.3-lock-in-root/lib/rpmlock.c	2005-09-28 14:37:25.000000000 +0400
@@ -31,12 +31,16 @@
 static rpmlock *rpmlock_new(const char *rootdir)
 {
 	rpmlock *lock = (rpmlock *)malloc(sizeof(rpmlock));
+	char * rpmlock_file = (char *)malloc(strlen(rootdir) +
+		sizeof(RPMLOCK_FILE) + 1);
+	strcpy(rpmlock_file, rootdir);
+	strcat(rpmlock_file, RPMLOCK_FILE);
 	if (lock) {
 		mode_t oldmask = umask(022);
-		lock->fd = open(RPMLOCK_FILE, O_RDWR|O_CREAT, 0644);
+		lock->fd = open(rpmlock_file, O_RDWR|O_CREAT, 0644);
 		umask(oldmask);
 		if (lock->fd == -1) {
-			lock->fd = open(RPMLOCK_FILE, O_RDONLY);
+			lock->fd = open(rpmlock_file, O_RDONLY);
 			if (lock->fd == -1) {
 				free(lock);
 				lock = NULL;
