summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/dpkgpm.cc
diff options
context:
space:
mode:
authorChristian PERRIER <bubulle@debian.org>2013-08-10 12:51:49 +0200
committerChristian PERRIER <bubulle@debian.org>2013-08-10 12:51:49 +0200
commit111f8cd9fccc0ebd8f8c5310a10343bc78569e81 (patch)
treeaa97c77d9d3b02730cf74c771cc43acb74a6cce9 /apt-pkg/deb/dpkgpm.cc
parentde81d69704bc5103ca55032a8f009820f30624c7 (diff)
parentf52037d629aea696f938015e7f1ec037eb079af8 (diff)
Merge branch 'debian/sid' of git://git.debian.org/git/apt/apt into debian/sid
Diffstat (limited to 'apt-pkg/deb/dpkgpm.cc')
-rw-r--r--apt-pkg/deb/dpkgpm.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index b0bd6b184..34ae4e593 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -134,7 +134,8 @@ static void dpkgChrootDirectory()
std::cerr << "Chrooting into " << chrootDir << std::endl;
if (chroot(chrootDir.c_str()) != 0)
_exit(100);
- chdir("/");
+ if (chdir("/") != 0)
+ _exit(100);
}
/*}}}*/
@@ -755,7 +756,8 @@ bool pkgDPkgPM::OpenLog()
pw = getpwnam("root");
gr = getgrnam("adm");
if (pw != NULL && gr != NULL)
- chown(logfile_name.c_str(), pw->pw_uid, gr->gr_gid);
+ if(chown(logfile_name.c_str(), pw->pw_uid, gr->gr_gid) != 0)
+ _error->Errno("OpenLog", "chown failed");
chmod(logfile_name.c_str(), 0640);
fprintf(d->term_out, "\nLog started: %s\n", timestr);
}