summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-10-07 13:34:28 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-10-07 13:34:28 +0200
commit263a781e1fd7c00ef18a7787b9a8a860a1ea5c9e (patch)
tree25479736831f7b5e9c28431753d9a4c1ba5d0d11 /apt-pkg
parent373fa2b4b2caae977c41b2c10ea27e41308a05c3 (diff)
Ignore EINVAL from prctl(PR_SET_NO_NEW_PRIVS)
Ignore a EINVAL error here as it means that the kernel is too old to understand this option. We should not fail hard in this case but just ignore the error. closes: 764066
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/contrib/fileutl.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 1e1fb5957..dbf831a14 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -2189,8 +2189,9 @@ bool DropPrivileges()
#if __gnu_linux__
// see prctl(2), needs linux3.5
- int ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0,0, 0);
- if(ret < 0)
+ int ret = prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
+ // ignore EINVAL - kernel is too old to understand the option
+ if(ret < 0 && errno != EINVAL)
_error->Warning("PR_SET_NO_NEW_PRIVS failed with %i", ret);
#endif
// Do not change the order here, it might break things