mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-30 21:50:47 +01:00
SF [2099671] Poco::File implementation on unix (reported by Lubomir Zavacky)
In canReadImpl/canWriteImpl, add effective user ID check for super user first. Tested on Ubuntu 8.04, gcc 4.2.3.
This commit is contained in:
@@ -97,6 +97,9 @@ bool FileImpl::canReadImpl() const
|
||||
{
|
||||
poco_assert (!_path.empty());
|
||||
|
||||
if(getegid() == 0)
|
||||
return true;
|
||||
|
||||
struct stat st;
|
||||
if (stat(_path.c_str(), &st) == 0)
|
||||
{
|
||||
@@ -116,6 +119,9 @@ bool FileImpl::canWriteImpl() const
|
||||
{
|
||||
poco_assert (!_path.empty());
|
||||
|
||||
if(getegid() == 0)
|
||||
return true;
|
||||
|
||||
struct stat st;
|
||||
if (stat(_path.c_str(), &st) == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user