summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-method.h1
-rw-r--r--apt-pkg/acquire-worker.h5
-rw-r--r--apt-pkg/contrib/macros.h2
-rw-r--r--apt-pkg/deb/dpkgpm.cc23
4 files changed, 28 insertions, 3 deletions
diff --git a/apt-pkg/acquire-method.h b/apt-pkg/acquire-method.h
index 48bd95672..399454892 100644
--- a/apt-pkg/acquire-method.h
+++ b/apt-pkg/acquire-method.h
@@ -44,6 +44,7 @@ class pkgAcqMethod
std::string Uri;
std::string DestFile;
+ int DestFileFd;
time_t LastModified;
bool IndexFile;
bool FailIgnore;
diff --git a/apt-pkg/acquire-worker.h b/apt-pkg/acquire-worker.h
index 67aee4b59..db8889c8e 100644
--- a/apt-pkg/acquire-worker.h
+++ b/apt-pkg/acquire-worker.h
@@ -101,6 +101,11 @@ class pkgAcquire::Worker : public WeakPointable
*/
int OutFd;
+ /** \brief The socket to send SCM_RIGHTS message through
+ */
+ int PrivSepSocketFd;
+ int PrivSepSocketFdChild;
+
/** \brief Set to \b true if the worker is in a state in which it
* might generate data or command responses.
*
diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h
index a0573398d..3a5e37c63 100644
--- a/apt-pkg/contrib/macros.h
+++ b/apt-pkg/contrib/macros.h
@@ -138,7 +138,7 @@
// Non-ABI-Breaks should only increase RELEASE number.
// See also buildlib/libversion.mak
#define APT_PKG_MAJOR 4
-#define APT_PKG_MINOR 14
+#define APT_PKG_MINOR 15
#define APT_PKG_RELEASE 0
#endif
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 95fae9a28..0cded32e1 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -55,6 +55,18 @@
using namespace std;
+APT_PURE static unsigned int
+EnvironmentSize()
+{
+ unsigned int size = 0;
+ char **envp = environ;
+
+ while (*envp != NULL)
+ size += strlen (*envp++) + 1;
+
+ return size;
+}
+
class pkgDPkgPMPrivate
{
public:
@@ -1230,8 +1242,15 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress)
fd_set rfds;
struct timespec tv;
- unsigned int const MaxArgs = _config->FindI("Dpkg::MaxArgs",8*1024);
- unsigned int const MaxArgBytes = _config->FindI("Dpkg::MaxArgBytes",32*1024);
+ // FIXME: do we really need this limit when we have MaxArgBytes?
+ unsigned int const MaxArgs = _config->FindI("Dpkg::MaxArgs",32*1024);
+
+ // try to figure out the max environment size
+ int OSArgMax = sysconf(_SC_ARG_MAX);
+ if(OSArgMax < 0)
+ OSArgMax = 32*1024;
+ OSArgMax -= EnvironmentSize() - 2*1024;
+ unsigned int const MaxArgBytes = _config->FindI("Dpkg::MaxArgBytes", OSArgMax);
bool const NoTriggers = _config->FindB("DPkg::NoTriggers", false);
if (RunScripts("DPkg::Pre-Invoke") == false)