diff --git a/src/core/fsservices.h b/src/core/fsservices.h index 77e7e1b..0175f49 100644 --- a/src/core/fsservices.h +++ b/src/core/fsservices.h @@ -290,8 +290,6 @@ class iFSServices virtual bool Rename( const TSTRING& strOldName, const TSTRING& strNewName, bool fOverWrite = true ) const = 0; // rename a file - virtual bool GetOwnerForFile( const TSTRING& tstrFilename, TSTRING& tstrUser ) const = 0; - virtual bool GetGroupForFile( const TSTRING& tstrFilename, TSTRING& tstrGroup ) const = 0; virtual bool GetUserName( uid_t user_id, TSTRING& tstrUser ) const = 0; virtual bool GetGroupName( gid_t group_id, TSTRING& tstrGroup ) const = 0; diff --git a/src/core/unixfsservices.cpp b/src/core/unixfsservices.cpp index 7f58ba9..934196f 100644 --- a/src/core/unixfsservices.cpp +++ b/src/core/unixfsservices.cpp @@ -497,43 +497,6 @@ void cUnixFSServices::SetResolveNames(bool resolve) mResolveNames=resolve; } -bool cUnixFSServices::GetOwnerForFile( const TSTRING& tstrFilename, TSTRING& tstrUser ) const -{ - bool fSuccess = true; - - struct stat statbuf; - int ret = lstat(tstrFilename.c_str(), &statbuf); - if(ret < 0) - { - fSuccess = false; - } - else - { - fSuccess = GetUserName(statbuf.st_uid, tstrUser); - } - - return( fSuccess ); -} - - -bool cUnixFSServices::GetGroupForFile( const TSTRING& tstrFilename, TSTRING& tstrGroup ) const -{ - bool fSuccess = true; - struct stat statbuf; - - int ret = lstat(tstrFilename.c_str(), &statbuf); - if(ret < 0) - { - fSuccess = false; - } - else - { - fSuccess = GetGroupName(statbuf.st_gid, tstrGroup); - } - - return( fSuccess ); -} - bool cUnixFSServices::GetUserName( uid_t user_id, TSTRING& tstrUser ) const { diff --git a/src/core/unixfsservices.h b/src/core/unixfsservices.h index 333bb71..c008dc0 100644 --- a/src/core/unixfsservices.h +++ b/src/core/unixfsservices.h @@ -132,8 +132,6 @@ class cUnixFSServices : public iFSServices virtual bool Rename( const TSTRING& strOldName, const TSTRING& strNewName, bool fOverWrite = true ) const; // rename a file - virtual bool GetOwnerForFile( const TSTRING& tstrFilename, TSTRING& tstrUser ) const; - virtual bool GetGroupForFile( const TSTRING& tstrFilename, TSTRING& tstrGroup ) const; virtual bool GetUserName( uid_t user_id, TSTRING& tstrUser ) const; virtual bool GetGroupName( gid_t group_id, TSTRING& tstrGroup ) const; diff --git a/src/twtest/unixfsservices_t.cpp b/src/twtest/unixfsservices_t.cpp index 448a80b..9dab3de 100644 --- a/src/twtest/unixfsservices_t.cpp +++ b/src/twtest/unixfsservices_t.cpp @@ -153,18 +153,6 @@ void TestUnixFSServices() TSTRING newtestfile = _T("/tmp/new.tmp"); TEST( pFSServices->Rename( testfile, newtestfile ) ); - // test GetOwnerForFile - d.TraceDetail("Testing GetOwnerForFile:\n"); - TSTRING ownername; - TEST( pFSServices->GetOwnerForFile( newtestfile, ownername ) ); - d.TraceDetail("GetOwnerForFile returned owner %s.\n", ownername.c_str()); - - // test GetGroupForFile - d.TraceDetail("Testing GetGroupForFile:\n"); - TSTRING groupname; - TEST( pFSServices->GetGroupForFile( newtestfile, groupname ) ); - d.TraceDetail("GetGroupForFile returned group %s.\n", groupname.c_str()); - // test FileDelete d.TraceDetail("Testing FileDelete:\n"); TEST( pFSServices->FileDelete( newtestfile ) );