summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/depcache.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index fe8a617ac..27e0ff73f 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -26,6 +26,8 @@
#include <sstream>
#include <set>
+#include <sys/stat.h>
+
#include <apti18n.h>
pkgDepCache::ActionGroup::ActionGroup(pkgDepCache &cache) :
@@ -256,8 +258,9 @@ bool pkgDepCache::writeStateFile(OpProgress *prog, bool InstalledOnly)
}
fclose(OutFile);
- // move the outfile over the real file
+ // move the outfile over the real file and set permissions
rename(outfile.c_str(), state.c_str());
+ chmod(state.c_str(), 0644);
return true;
}