Remove a possible race in the SUID sandbox (minor)
Remove a possible race in the SUID sandbox (minor)

The SUID sandbox can be used to set the oom_adj value for non-dumpable
processes owned by the same user. When doing so, we previously first
checked the directory owner and then opened the oom_adj file. In between
the check and the open, the process could have died and another process
could have taken that PID value. We would then adjust the OOM value of
the wrong process.

Given how PIDs are allocated, this is very hard to exploit and, even
then, a minor security issue at best, but we can avoid the issue
entirely with openat.

http://codereview.chromium.org/2118007

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@47801 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser