+2008-07-01 Egmont Koblinger <egmont@uhulinux.hu>
+
+ * src/processarc.c (process_archive): Properly lstat the correct
+ file on upgrade when using --root.
+
2008-07-01 Guillem Jover <guillem@debian.org>
* src/processarc.c (process_archive): Do not allocate a struct stat
systems. Based on a patch by Juergen Kreileder. Closes: #102144, #149961
* Do not silently enable --rename on dpkg-divert --remove. Closes: #160848
* Do not allocate memory when lstat fails during package upgrade.
+ * Properly lstat the correct file when using --root on package upgrade.
+ Thanks to Egmont Koblinger. Closes: #281057
[ Raphael Hertzog ]
* Enhance dpkg-shlibdeps's error message when a library can't be found to
*/
struct fileinlist *sameas = NULL;
static struct stat empty_stat;
+ struct varbuf cfilename = VARBUF_INIT;
/* If we can't stat the old or new file, or it's a directory,
* we leave it up to the normal code
if (!cfile->namenode->filestat) {
struct stat tmp_stat;
- if (lstat(cfile->namenode->name, &tmp_stat) == 0) {
+ varbufreset(&cfilename);
+ varbufaddstr(&cfilename, instdir);
+ varbufaddc(&cfilename, '/');
+ varbufaddstr(&cfilename, cfile->namenode->name);
+ varbufaddc(&cfilename, '\0');
+
+ if (lstat(cfilename.buf, &tmp_stat) == 0) {
cfile->namenode->filestat = nfmalloc(sizeof(struct stat));
memcpy(cfile->namenode->filestat, &tmp_stat, sizeof(struct stat));
} else {
}
}
+ varbuffree(&cfilename);
+
if ((namenode->flags & fnnf_old_conff)) {
if (sameas) {
if (sameas->namenode->flags & fnnf_new_conff) {