diff options
author | Julian Andres Klode <jak@debian.org> | 2021-01-11 11:07:48 +0000 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2021-01-11 11:07:48 +0000 |
commit | ab34ccb25f9e8b54fef14142457d00beb3723ab1 (patch) | |
tree | 2396781be02376963df042a06f07ae46f6652d0c | |
parent | 8ecd0d2c572b0c36142f39a8691ace91ed90c8ca (diff) | |
parent | 229e73afa4d6e862262f898a7e58942c90939306 (diff) |
Merge branch 'pu/misc-fixes-2-1-16' into 'master'
Misc fixes
See merge request apt-team/apt!152
-rw-r--r-- | apt-pkg/algorithms.cc | 7 | ||||
-rw-r--r-- | apt-pkg/aptconfiguration.cc | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 260a8ac41..4c267c91c 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1606,7 +1606,12 @@ std::string GetProtectedKernelsRegex(pkgCache *cache, bool ReturnRemove) } } - auto re = ss.str().substr(1); + auto re_with_leading_or = ss.str(); + + if (re_with_leading_or.empty()) + return ""; + + auto re = re_with_leading_or.substr(1); if (Debug) std::clog << "Kernel protection regex: " << re << "\n"; diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index e88029f58..671c3d553 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -529,6 +529,7 @@ bool Configuration::isChroot() auto binary = _config->FindFile("Dir::Bin::ischroot", "/usr/bin/ischroot"); const char *const Args[] = { binary.c_str(), + "-t", nullptr}; execvp(Args[0], const_cast<char **>(Args)); _exit(127); |