diff --git a/src/core/fsservices.h b/src/core/fsservices.h index 811a046..92dbe17 100644 --- a/src/core/fsservices.h +++ b/src/core/fsservices.h @@ -137,9 +137,10 @@ struct cFSStatArgs TY_DOOR, TY_PORT, TY_NAMED, - TY_MESSAGE_QUEUE, - TY_SEMAPHORE, - TY_SHARED_MEMORY + TY_NATIVE, + TY_MESSAGE_QUEUE, + TY_SEMAPHORE, + TY_SHARED_MEMORY }; // attr is fs dependent? diff --git a/src/core/unixfsservices.cpp b/src/core/unixfsservices.cpp index ec0c34f..e45956e 100644 --- a/src/core/unixfsservices.cpp +++ b/src/core/unixfsservices.cpp @@ -127,6 +127,16 @@ #define TW_SLASH _T('/') +#if (IS_AIX || IS_OS400) + #ifndef _S_IFNATIVE + #define _S_IFNATIVE 02000000 /* OS/400 native object, of any object type that isn't treated as a directory */ + #endif + + #ifndef S_ISNATIVE + #define S_ISNATIVE(x) (((x) & 0370000) == _S_IFNATIVE) + #endif +#endif + //========================================================================= // OTHER DIRECTIVES //========================================================================= @@ -425,6 +435,11 @@ void cUnixFSServices::Stat(const TSTRING& strNameC, cFSStatArgs& statArgs) const statArgs.mFileType = cFSStatArgs::TY_NAMED; #endif +#ifdef S_ISNATIVE + else if (S_ISNATIVE(statbuf.st_mode)) + statArgs.mFileType = cFSStatArgs::TY_NATIVE; +#endif + #ifdef S_TYPEISMQ else if (S_TYPEISMQ(&statbuf)) statArgs.mFileType = cFSStatArgs::TY_MESSAGE_QUEUE; diff --git a/src/fs/fsdatasourceiter.cpp b/src/fs/fsdatasourceiter.cpp index 089726a..5404007 100644 --- a/src/fs/fsdatasourceiter.cpp +++ b/src/fs/fsdatasourceiter.cpp @@ -274,6 +274,9 @@ bool cFSDataSourceIter::InitializeTypeInfo(iFCO* pFCO) case cFSStatArgs::TY_NAMED: propSet.SetFileType(cFSPropSet::FT_NAMED); break; + case cFSStatArgs::TY_NATIVE: + propSet.SetFileType(cFSPropSet::FT_NATIVE); + break; case cFSStatArgs::TY_MESSAGE_QUEUE: propSet.SetFileType(cFSPropSet::FT_MESSAGE_QUEUE); break; diff --git a/src/fs/fspropcalc.cpp b/src/fs/fspropcalc.cpp index ec3bded..ff2d191 100644 --- a/src/fs/fspropcalc.cpp +++ b/src/fs/fspropcalc.cpp @@ -302,6 +302,9 @@ void cFSPropCalc::HandleStatProperties(const cFCOPropVector& propsToCheck, const case cFSStatArgs::TY_NAMED: propSet.SetFileType(cFSPropSet::FT_NAMED); break; + case cFSStatArgs::TY_NATIVE: + propSet.SetFileType(cFSPropSet::FT_NATIVE); + break; case cFSStatArgs::TY_MESSAGE_QUEUE: propSet.SetFileType(cFSPropSet::FT_MESSAGE_QUEUE); break; @@ -325,11 +328,17 @@ void cFSPropCalc::HandleHashes(const cFCOPropVector& propsToCheck, const TSTRING // if the file type is not a regular file, we will // not try to open the file for signature generation ASSERT(propSet.GetValidVector().ContainsItem(cFSPropSet::PROP_FILETYPE)); - if (propSet.GetFileType() == cFSPropSet::FT_FILE || propSet.GetFileType() == cFSPropSet::FT_SYMLINK) + + if ( propSet.GetFileType() == cFSPropSet::FT_FILE + || propSet.GetFileType() == cFSPropSet::FT_SYMLINK +#if (IS_AIX || IS_OS400) + || propSet.GetFileType() == cFSPropSet::FT_NATIVE +#endif + ) { if ( // if we need to open the file propsToCheck.ContainsItem(cFSPropSet::PROP_CRC32) || propsToCheck.ContainsItem(cFSPropSet::PROP_MD5) || - propsToCheck.ContainsItem(cFSPropSet::PROP_SHA) || propsToCheck.ContainsItem(cFSPropSet::PROP_HAVAL)) + propsToCheck.ContainsItem(cFSPropSet::PROP_SHA) || propsToCheck.ContainsItem(cFSPropSet::PROP_HAVAL)) { cFileArchive arch; cMemoryArchive memArch; diff --git a/src/fs/fspropset.cpp b/src/fs/fspropset.cpp index 0bb7e02..077fca0 100644 --- a/src/fs/fspropset.cpp +++ b/src/fs/fspropset.cpp @@ -60,6 +60,7 @@ TSTRING cFCOPropFileType::AsString() const fs::STR_FT_DOOR, fs::STR_FT_PORT, fs::STR_FT_NAMED, + fs::STR_FT_NATIVE, fs::STR_FT_MESSAGE_QUEUE, fs::STR_FT_SEMAPHORE, fs::STR_FT_SHARED_MEMORY}; diff --git a/src/fs/fspropset.h b/src/fs/fspropset.h index f716728..c52f1e3 100644 --- a/src/fs/fspropset.h +++ b/src/fs/fspropset.h @@ -112,9 +112,10 @@ public: FT_DOOR, FT_PORT, FT_NAMED, - FT_MESSAGE_QUEUE, - FT_SEMAPHORE, - FT_SHARED_MEMORY, + FT_NATIVE, + FT_MESSAGE_QUEUE, + FT_SEMAPHORE, + FT_SHARED_MEMORY, FT_NUMITEMS }; diff --git a/src/fs/fsstrings.cpp b/src/fs/fsstrings.cpp index 36cc3dd..7a9d927 100644 --- a/src/fs/fsstrings.cpp +++ b/src/fs/fsstrings.cpp @@ -41,19 +41,20 @@ TSS_BeginStringtable(cFS) - TSS_StringEntry(fs::STR_FT_INVALID, _T("Invalid")), - TSS_StringEntry(fs::STR_FT_FILE, _T("Regular File")), - TSS_StringEntry(fs::STR_FT_DIR, _T("Directory")), - TSS_StringEntry(fs::STR_FT_BLOCKDEV, _T("Block Device")), - TSS_StringEntry(fs::STR_FT_CHARDEV, _T("Character Device")), - TSS_StringEntry(fs::STR_FT_SYMLINK, _T("Symbolic Link")), - TSS_StringEntry(fs::STR_FT_FIFO, _T("FIFO")), - TSS_StringEntry(fs::STR_FT_SOCK, _T("Socket")), - TSS_StringEntry(fs::STR_FT_DOOR, _T("Door")), - TSS_StringEntry(fs::STR_FT_PORT, _T("Event Port")), - TSS_StringEntry(fs::STR_FT_NAMED, _T("Named Special File")), + TSS_StringEntry(fs::STR_FT_INVALID, _T("Invalid")), + TSS_StringEntry(fs::STR_FT_FILE, _T("Regular File")), + TSS_StringEntry(fs::STR_FT_DIR, _T("Directory")), + TSS_StringEntry(fs::STR_FT_BLOCKDEV, _T("Block Device")), + TSS_StringEntry(fs::STR_FT_CHARDEV, _T("Character Device")), + TSS_StringEntry(fs::STR_FT_SYMLINK, _T("Symbolic Link")), + TSS_StringEntry(fs::STR_FT_FIFO, _T("FIFO")), + TSS_StringEntry(fs::STR_FT_SOCK, _T("Socket")), + TSS_StringEntry(fs::STR_FT_DOOR, _T("Door")), + TSS_StringEntry(fs::STR_FT_PORT, _T("Event Port")), + TSS_StringEntry(fs::STR_FT_NAMED, _T("Named Special File")), + TSS_StringEntry(fs::STR_FT_NATIVE, _T("Native Object")), TSS_StringEntry(fs::STR_FT_MESSAGE_QUEUE, _T("Message Queue")), - TSS_StringEntry(fs::STR_FT_SEMAPHORE, _T("Semaphore")), + TSS_StringEntry(fs::STR_FT_SEMAPHORE, _T("Semaphore")), TSS_StringEntry(fs::STR_FT_SHARED_MEMORY, _T("Shared Memory")), // property names diff --git a/src/fs/fsstrings.h b/src/fs/fsstrings.h index dc7f279..55b3118 100644 --- a/src/fs/fsstrings.h +++ b/src/fs/fsstrings.h @@ -46,7 +46,7 @@ TSS_BeginStringIds(fs) // file types STR_FT_INVALID, - STR_FT_FILE, STR_FT_DIR, STR_FT_BLOCKDEV, STR_FT_CHARDEV, STR_FT_SYMLINK, STR_FT_FIFO, STR_FT_SOCK, STR_FT_DOOR, STR_FT_PORT, STR_FT_NAMED, + STR_FT_FILE, STR_FT_DIR, STR_FT_BLOCKDEV, STR_FT_CHARDEV, STR_FT_SYMLINK, STR_FT_FIFO, STR_FT_SOCK, STR_FT_DOOR, STR_FT_PORT, STR_FT_NAMED, STR_FT_NATIVE, STR_FT_MESSAGE_QUEUE, STR_FT_SEMAPHORE, STR_FT_SHARED_MEMORY, // property names STR_PROP_DEV, STR_PROP_RDEV, STR_PROP_INODE, STR_PROP_MODE, STR_PROP_NLINK, STR_PROP_UID, STR_PROP_GID,