2 RCS File: /v/rpm/cvs/rpm/rpmdb/db3.c,v
3 rcsdiff -q -kk '-r1.71' '-r1.72' -u '/v/rpm/cvs/rpm/rpmdb/db3.c,v' 2>/dev/null
4 --- db3.c 2007/08/18 23:40:36 1.71
5 +++ db3.c 2007/09/24 02:38:57 1.72
8 /*@modifies dbi, *dbenvp, fileSystem @*/
10 + static int oneshot = 0;
11 rpmdb rpmdb = dbi->dbi_rpmdb;
18 +#if (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR != 0) || (DB_VERSION_MAJOR == 4)
19 + xx = db_env_set_func_open((int (*)(const char *, int, ...))Open);
20 + xx = cvtdberr(dbi, "db_env_set_func_open", xx, _debug);
28 Index: rpm/rpmdb/rpmdb.c
29 RCS File: /v/rpm/cvs/rpm/rpmdb/rpmdb.c,v
30 rcsdiff -q -kk '-r1.158' '-r1.159' -u '/v/rpm/cvs/rpm/rpmdb/rpmdb.c,v' 2>/dev/null
31 --- rpmdb.c 2007/09/09 19:06:51 1.158
32 +++ rpmdb.c 2007/09/24 02:38:57 1.159
34 if (db == NULL) return 0;
36 mi = rpmdbInitIterator(db, RPMTAG_BASENAMES, NULL, 0);
37 - if (mi == NULL) /* XXX should never happen */
39 +assert(mi); /* XXX will never happen. */
45 Index: rpm/rpmio/librpmio.vers
46 RCS File: /v/rpm/cvs/rpm/rpmio/librpmio.vers,v
47 rcsdiff -q -kk '-r2.12' '-r2.13' -u '/v/rpm/cvs/rpm/rpmio/librpmio.vers,v' 2>/dev/null
48 --- librpmio.vers 2007/09/09 20:32:43 2.12
49 +++ librpmio.vers 2007/09/24 02:38:57 2.13
59 Index: rpm/rpmio/rpmio.h
60 RCS File: /v/rpm/cvs/rpm/rpmio/rpmio.h,v
61 rcsdiff -q -kk '-r1.57' '-r1.58' -u '/v/rpm/cvs/rpm/rpmio/rpmio.h,v' 2>/dev/null
62 --- rpmio.h 2007/08/28 20:45:49 1.57
63 +++ rpmio.h 2007/09/24 02:38:57 1.58
65 /*@globals errno, h_errno, fileSystem, internalState @*/
66 /*@modifies errno, fileSystem, internalState @*/;
68 +/*@unchecked@*/ /*@observer@*/ /*@null@*/
69 +extern const char * _chroot_prefix;
73 * @todo Implement remotely.
75 int Chroot(const char * path)
76 + /*@globals _chroot_prefix, errno, fileSystem, internalState @*/
77 + /*@modifies _chroot_prefix, errno, fileSystem, internalState @*/;
81 + * @todo Implement remotely.
83 +int Open(const char * path, int flags, mode_t mode)
84 /*@globals errno, fileSystem, internalState @*/
85 /*@modifies errno, fileSystem, internalState @*/;
87 Index: rpm/rpmio/rpmrpc.c
88 RCS File: /v/rpm/cvs/rpm/rpmio/rpmrpc.c,v
89 rcsdiff -q -kk '-r2.54' '-r2.55' -u '/v/rpm/cvs/rpm/rpmio/rpmrpc.c,v' 2>/dev/null
90 --- rpmrpc.c 2007/07/10 18:00:30 2.54
91 +++ rpmrpc.c 2007/09/24 02:38:57 2.55
97 +const char * _chroot_prefix = NULL;
99 int Chroot(const char * path)
102 @@ -183,11 +186,56 @@
104 /*@notreached@*/ break;
107 + _chroot_prefix = _free(_chroot_prefix);
108 + if (strcmp(path, "."))
109 + _chroot_prefix = rpmGetPath(path, NULL);
116 +int Open(const char * path, int flags, mode_t mode)
118 + const char * lpath;
119 + int ut = urlPath(path, &lpath);
122 +fprintf(stderr, "*** Open(%s, 0x%x, 0%o)\n", path, flags, mode);
127 + case URL_IS_UNKNOWN:
131 + case URL_IS_FTP: /* XXX TODO: implement. */
132 + case URL_IS_HTTPS: /* XXX TODO: implement. */
133 + case URL_IS_HTTP: /* XXX TODO: implement. */
135 + errno = EINVAL; /* XXX W2DO? */
137 + /*@notreached@*/ break;
140 + if (_chroot_prefix && _chroot_prefix[0] == '/' && _chroot_prefix[1] != '\0')
142 + size_t nb = strlen(_chroot_prefix);
143 + size_t ob = strlen(path);
144 + while (nb > 0 && _chroot_prefix[nb-1] == '/')
146 + if (ob > nb && !strncmp(path, _chroot_prefix, nb) && path[nb] == '/')
149 +#ifdef NOTYET /* XXX likely sane default. */
153 + return open(path, flags, mode);
156 /* XXX rpmdb.c: analogue to rename(2). */
158 int Rename (const char * oldpath, const char * newpath)