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:
Shan Jiang
2008-09-09 09:56:03 +00:00
parent 867b643fad
commit 4ff750168d

View File

@@ -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)
{