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. 

(The previous commit used wrong local repos copy, sorry about that)
This commit is contained in:
Shan Jiang 2008-09-09 10:15:30 +00:00
parent 4ff750168d
commit e1dbbef72f

View File

@ -97,7 +97,7 @@ bool FileImpl::canReadImpl() const
{
poco_assert (!_path.empty());
if(getegid() == 0)
if(geteuid() == 0)
return true;
struct stat st;
@ -119,7 +119,7 @@ bool FileImpl::canWriteImpl() const
{
poco_assert (!_path.empty());
if(getegid() == 0)
if(geteuid() == 0)
return true;
struct stat st;