BSDConfigureNode.cpp [plain text]
#include "BSDConfigureNode.h"
BSDConfigureNode::BSDConfigureNode( CFStringRef inNodeName, uid_t inUID, uid_t inEffectiveUID ) : BDPIVirtualNode( inNodeName, inUID, inEffectiveUID )
{
}
BSDConfigureNode::~BSDConfigureNode( void )
{
}
CFMutableDictionaryRef BSDConfigureNode::CopyNodeInfo( CFArrayRef inAttributes )
{
CFMutableDictionaryRef cfNodeInfo = CFDictionaryCreateMutable( kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks );
CFMutableDictionaryRef cfAttributes = CFDictionaryCreateMutable( kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks );
CFRange cfAttribRange = CFRangeMake( 0, CFArrayGetCount(inAttributes) );
bool bNeedAll = CFArrayContainsValue( inAttributes, cfAttribRange, CFSTR(kDSAttributesAll) );
CFDictionarySetValue( cfNodeInfo, kBDPINameKey, CFSTR("DirectoryNodeInfo") );
CFDictionarySetValue( cfNodeInfo, kBDPITypeKey, CFSTR(kDSStdRecordTypeDirectoryNodeInfo) );
CFDictionarySetValue( cfNodeInfo, kBDPIAttributeKey, cfAttributes );
if (bNeedAll || CFArrayContainsValue(inAttributes, cfAttribRange, CFSTR(kDSNAttrNodePath)))
{
CFArrayRef cfNodePath = CFStringCreateArrayBySeparatingStrings( kCFAllocatorDefault, fNodeName, CFSTR("/") );
CFDictionarySetValue( cfAttributes, CFSTR(kDSNAttrNodePath), cfNodePath );
DSCFRelease( cfNodePath );
}
if (bNeedAll || CFArrayContainsValue(inAttributes, cfAttribRange, CFSTR(kDS1AttrReadOnlyNode)))
{
CFStringRef cfReadOnly = CFSTR("ReadOnly");
CFArrayRef cfValue = CFArrayCreate( kCFAllocatorDefault, (const void **) &cfReadOnly, 1, &kCFTypeArrayCallBacks );
CFDictionarySetValue( cfAttributes, CFSTR(kDS1AttrReadOnlyNode), cfValue );
DSCFRelease( cfValue );
}
if (bNeedAll || CFArrayContainsValue(inAttributes, cfAttribRange, CFSTR(kDS1AttrDistinguishedName)))
{
CFStringRef cfRealName = CFSTR("BSD Flat File and NIS Configure");
CFArrayRef cfValue = CFArrayCreate( kCFAllocatorDefault, (const void **) &cfRealName, 1, &kCFTypeArrayCallBacks );
CFDictionarySetValue( cfAttributes, CFSTR(kDS1AttrDistinguishedName), cfValue );
DSCFRelease( cfValue );
}
DSCFRelease( cfAttributes );
return cfNodeInfo;
}
tDirStatus BSDConfigureNode::SearchRecords( sBDPISearchRecordsContext *inContext, BDPIOpaqueBuffer inBuffer, UInt32 *outCount)
{
return eNotHandledByThisNode;
}