From: Michael Vogt Date: Mon, 27 Jun 2011 08:46:41 +0000 (+0200) Subject: * apt-pkg/deb/dpkgpm.cc: X-Git-Tag: 0.8.15~3^2 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/9c76a88155c346666325339c5581a528d70b1f69 * apt-pkg/deb/dpkgpm.cc: - set permissions of term.log to root.adm and 644 (LP: #404724) --- diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index b37980b7e..ca544e778 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include @@ -667,7 +669,13 @@ bool pkgDPkgPM::OpenLog() return _error->WarningE("OpenLog", _("Could not open file '%s'"), logfile_name.c_str()); setvbuf(term_out, NULL, _IONBF, 0); SetCloseExec(fileno(term_out), true); - chmod(logfile_name.c_str(), 0600); + struct passwd *pw; + struct group *gr; + pw = getpwnam("root"); + gr = getgrnam("adm"); + if (pw != NULL && gr != NULL) + chown(logfile_name.c_str(), pw->pw_uid, gr->gr_gid); + chmod(logfile_name.c_str(), 0644); fprintf(term_out, "\nLog started: %s\n", timestr); } diff --git a/debian/changelog b/debian/changelog index 2c296b597..16c0990d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -86,6 +86,10 @@ apt (0.8.15) UNRELEASED; urgency=low * apt-pkg/deb/debindexfile.cc: - remove some no longer valid checks for "TranslationsAvailable()" + [ Kenneth Solbø Andersen ] + * apt-pkg/deb/dpkgpm.cc: + - set permissions of term.log to root.adm and 644 (LP: #404724) + -- Michael Vogt Mon, 16 May 2011 14:57:52 +0200 apt (0.8.14.1) unstable; urgency=low