add a file type for IBM i (AS/400) native objects
This commit is contained in:
		
							parent
							
								
									458d8652b3
								
							
						
					
					
						commit
						b3f86242a8
					
				|  | @ -137,6 +137,7 @@ struct cFSStatArgs | ||||||
|         TY_DOOR, |         TY_DOOR, | ||||||
|         TY_PORT, |         TY_PORT, | ||||||
|         TY_NAMED, |         TY_NAMED, | ||||||
|  |         TY_NATIVE, | ||||||
|         TY_MESSAGE_QUEUE, |         TY_MESSAGE_QUEUE, | ||||||
|         TY_SEMAPHORE, |         TY_SEMAPHORE, | ||||||
|         TY_SHARED_MEMORY |         TY_SHARED_MEMORY | ||||||
|  |  | ||||||
|  | @ -127,6 +127,16 @@ | ||||||
| 
 | 
 | ||||||
| #define TW_SLASH _T('/') | #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
 | // OTHER DIRECTIVES
 | ||||||
| //=========================================================================
 | //=========================================================================
 | ||||||
|  | @ -425,6 +435,11 @@ void cUnixFSServices::Stat(const TSTRING& strNameC, cFSStatArgs& statArgs) const | ||||||
|         statArgs.mFileType = cFSStatArgs::TY_NAMED; |         statArgs.mFileType = cFSStatArgs::TY_NAMED; | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|  | #ifdef S_ISNATIVE | ||||||
|  |     else if (S_ISNATIVE(statbuf.st_mode)) | ||||||
|  |         statArgs.mFileType = cFSStatArgs::TY_NATIVE; | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
| #ifdef S_TYPEISMQ | #ifdef S_TYPEISMQ | ||||||
|     else if (S_TYPEISMQ(&statbuf)) |     else if (S_TYPEISMQ(&statbuf)) | ||||||
|         statArgs.mFileType = cFSStatArgs::TY_MESSAGE_QUEUE; |         statArgs.mFileType = cFSStatArgs::TY_MESSAGE_QUEUE; | ||||||
|  |  | ||||||
|  | @ -274,6 +274,9 @@ bool cFSDataSourceIter::InitializeTypeInfo(iFCO* pFCO) | ||||||
|     case cFSStatArgs::TY_NAMED: |     case cFSStatArgs::TY_NAMED: | ||||||
|         propSet.SetFileType(cFSPropSet::FT_NAMED); |         propSet.SetFileType(cFSPropSet::FT_NAMED); | ||||||
|         break; |         break; | ||||||
|  |     case cFSStatArgs::TY_NATIVE: | ||||||
|  |         propSet.SetFileType(cFSPropSet::FT_NATIVE); | ||||||
|  |         break; | ||||||
|     case cFSStatArgs::TY_MESSAGE_QUEUE: |     case cFSStatArgs::TY_MESSAGE_QUEUE: | ||||||
|         propSet.SetFileType(cFSPropSet::FT_MESSAGE_QUEUE); |         propSet.SetFileType(cFSPropSet::FT_MESSAGE_QUEUE); | ||||||
|         break; |         break; | ||||||
|  |  | ||||||
|  | @ -302,6 +302,9 @@ void cFSPropCalc::HandleStatProperties(const cFCOPropVector& propsToCheck, const | ||||||
|         case cFSStatArgs::TY_NAMED: |         case cFSStatArgs::TY_NAMED: | ||||||
|             propSet.SetFileType(cFSPropSet::FT_NAMED); |             propSet.SetFileType(cFSPropSet::FT_NAMED); | ||||||
|             break; |             break; | ||||||
|  |         case cFSStatArgs::TY_NATIVE: | ||||||
|  |             propSet.SetFileType(cFSPropSet::FT_NATIVE); | ||||||
|  |             break; | ||||||
|         case cFSStatArgs::TY_MESSAGE_QUEUE: |         case cFSStatArgs::TY_MESSAGE_QUEUE: | ||||||
|             propSet.SetFileType(cFSPropSet::FT_MESSAGE_QUEUE); |             propSet.SetFileType(cFSPropSet::FT_MESSAGE_QUEUE); | ||||||
|             break; |             break; | ||||||
|  | @ -325,7 +328,13 @@ void cFSPropCalc::HandleHashes(const cFCOPropVector& propsToCheck, const TSTRING | ||||||
|     // if the file type is not a regular file, we will
 |     // if the file type is not a regular file, we will
 | ||||||
|     // not try to open the file for signature generation
 |     // not try to open the file for signature generation
 | ||||||
|     ASSERT(propSet.GetValidVector().ContainsItem(cFSPropSet::PROP_FILETYPE)); |     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
 |         if ( // if we need to open the file
 | ||||||
|             propsToCheck.ContainsItem(cFSPropSet::PROP_CRC32) || propsToCheck.ContainsItem(cFSPropSet::PROP_MD5) || |             propsToCheck.ContainsItem(cFSPropSet::PROP_CRC32) || propsToCheck.ContainsItem(cFSPropSet::PROP_MD5) || | ||||||
|  |  | ||||||
|  | @ -60,6 +60,7 @@ TSTRING cFCOPropFileType::AsString() const | ||||||
|                               fs::STR_FT_DOOR, |                               fs::STR_FT_DOOR, | ||||||
|                               fs::STR_FT_PORT, |                               fs::STR_FT_PORT, | ||||||
|                               fs::STR_FT_NAMED, |                               fs::STR_FT_NAMED, | ||||||
|  |                               fs::STR_FT_NATIVE, | ||||||
|                               fs::STR_FT_MESSAGE_QUEUE, |                               fs::STR_FT_MESSAGE_QUEUE, | ||||||
|                               fs::STR_FT_SEMAPHORE, |                               fs::STR_FT_SEMAPHORE, | ||||||
|                               fs::STR_FT_SHARED_MEMORY}; |                               fs::STR_FT_SHARED_MEMORY}; | ||||||
|  |  | ||||||
|  | @ -112,6 +112,7 @@ public: | ||||||
|         FT_DOOR, |         FT_DOOR, | ||||||
|         FT_PORT, |         FT_PORT, | ||||||
|         FT_NAMED, |         FT_NAMED, | ||||||
|  |         FT_NATIVE, | ||||||
|         FT_MESSAGE_QUEUE, |         FT_MESSAGE_QUEUE, | ||||||
|         FT_SEMAPHORE, |         FT_SEMAPHORE, | ||||||
|         FT_SHARED_MEMORY, |         FT_SHARED_MEMORY, | ||||||
|  |  | ||||||
|  | @ -52,6 +52,7 @@ TSS_BeginStringtable(cFS) | ||||||
|     TSS_StringEntry(fs::STR_FT_DOOR,          _T("Door")), |     TSS_StringEntry(fs::STR_FT_DOOR,          _T("Door")), | ||||||
|     TSS_StringEntry(fs::STR_FT_PORT,          _T("Event Port")), |     TSS_StringEntry(fs::STR_FT_PORT,          _T("Event Port")), | ||||||
|     TSS_StringEntry(fs::STR_FT_NAMED,         _T("Named Special File")), |     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_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")), |     TSS_StringEntry(fs::STR_FT_SHARED_MEMORY, _T("Shared Memory")), | ||||||
|  |  | ||||||
|  | @ -46,7 +46,7 @@ TSS_BeginStringIds(fs) | ||||||
| 
 | 
 | ||||||
|     // file types
 |     // file types
 | ||||||
|     STR_FT_INVALID, |     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, |   STR_FT_MESSAGE_QUEUE, STR_FT_SEMAPHORE, STR_FT_SHARED_MEMORY, | ||||||
|     // property names
 |     // property names
 | ||||||
|     STR_PROP_DEV, STR_PROP_RDEV, STR_PROP_INODE, STR_PROP_MODE, STR_PROP_NLINK, STR_PROP_UID, STR_PROP_GID, |     STR_PROP_DEV, STR_PROP_RDEV, STR_PROP_INODE, STR_PROP_MODE, STR_PROP_NLINK, STR_PROP_UID, STR_PROP_GID, | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Brian Cox
						Brian Cox