From e1dbbef72ff0d8a8b450855cc2bd3c8e645b9d9f Mon Sep 17 00:00:00 2001 From: Shan Jiang Date: Tue, 9 Sep 2008 10:15:30 +0000 Subject: [PATCH] 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) --- Foundation/src/File_UNIX.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Foundation/src/File_UNIX.cpp b/Foundation/src/File_UNIX.cpp index e1b2950da..62032bc43 100644 --- a/Foundation/src/File_UNIX.cpp +++ b/Foundation/src/File_UNIX.cpp @@ -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;