1 --- rpm-4.5/rpmio/rpmrpc.c~ 2009-10-16 01:18:18.566743349 +0300
2 +++ rpm-4.5/rpmio/rpmrpc.c 2009-10-16 01:18:21.863999841 +0300
6 int ut = urlPath(path, &lpath);
14 - return open(path, flags, mode);
15 + fdno = open(path, flags, mode);
16 + /* XXX if the open(2) fails, try to strip a possible chroot(2) prefix. */
17 + if (fdno < 0 && errno == ENOENT) {
18 + const char *dbpath = rpmExpand("%{_dbpath}", "/", NULL);
19 + const char *fn = strstr(path + 1, dbpath);
21 + fdno = open(fn, flags, mode);
23 + dbpath = _free(dbpath);
28 /* XXX rpmdb.c: analogue to rename(2). */