X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/6dd55be709d9dffdd380467193e0256ded60beb8..bebdca4bf63ae661c60bc1e0f4e03e6bbb7a7cc5:/apt-pkg/deb/dpkgpm.cc?ds=sidebyside diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 9322a868d..f8c59d844 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: dpkgpm.cc,v 1.6 1999/01/31 08:49:39 jgg Exp $ +// $Id: dpkgpm.cc,v 1.8 1999/03/05 19:36:49 jgg Exp $ /* ###################################################################### DPKG Package Manager - Provide an interface to dpkg @@ -140,7 +140,7 @@ bool pkgDPkgPM::RunScripts(const char *Cnf) { Count -= 100; for (; Opts != 0 && Count != 1; Opts = Opts->Next, Count--); - _error->Error("Probablem executing scripts %s '%s'",Cnf,Opts->Value.c_str()); + _error->Error("Problem executing scripts %s '%s'",Cnf,Opts->Value.c_str()); } return _error->Error("Sub-process returned an error code"); @@ -213,6 +213,8 @@ bool pkgDPkgPM::Go() { for (;I != J && Size < 1024; I++) { + if (I->File[0] != '/') + return _error->Error("Internal Error, Pathname to install is not absolute '%s'",I->File.c_str()); Args[n++] = I->File.c_str(); Size += strlen(Args[n-1]); } @@ -262,7 +264,7 @@ bool pkgDPkgPM::Go() signal(SIGCONT,SIG_DFL); signal(SIGTSTP,SIG_DFL); - if (chdir(_config->FindDir("Dir::Cache::Archives").c_str()) != 0) + if (chdir(_config->FindDir("DPkg::Run-Directory","/").c_str()) != 0) _exit(100); // Close all of our FDs - just in case @@ -308,7 +310,13 @@ bool pkgDPkgPM::Go() if (WIFEXITED(Status) == 0 || WEXITSTATUS(Status) != 0) { RunScripts("DPkg::Post-Invoke"); - return _error->Error("Sub-process returned an error code"); + if (WIFSIGNALED(Status) != 0 && WTERMSIG(Status) == SIGSEGV) + return _error->Error("Sub-process recieved a segmentation fault."); + + if (WIFEXITED(Status) != 0) + return _error->Error("Sub-process returned an error code (%u)",WEXITSTATUS(Status)); + + return _error->Error("Sub-process exited unexpectedly"); } }