FSGetCatalogInfo returns zero permissions for /Volumes/VolumeName directory
FSGetCatalogInfo returns zero permissions for /Volumes/VolumeName directory
- Subject: FSGetCatalogInfo returns zero permissions for /Volumes/VolumeName directory
- From: el tasiziso <email@hidden>
- Date: Tue, 28 Sep 2010 15:25:31 +0300
Hi Everyone!
I use 10.6.4 on Mac Pro.
For some reason on limited number of machines we have the following behavior:
The code
FSCatalogInfo catalogInfo={0};
err = FSGetCatalogInfo( &ref, kFSCatInfoNodeFlags | kFSCatInfoVolume |
kFSCatInfoPermissions, &catalogInfo, NULL, NULL, NULL );
if ( err == noErr )
{
UInt16 mode((reinterpret_cast<FSPermissionInfo*>(catalogInfo.permissions))->mode);
}
have mode containing zero. The ref is valid and pointing to HFS+
Journaled local volume. How can mode == 0?
The more interesting we have when we try
FSVolumeInfo volumeInfo={0};
// get volume flags
if (noErr == (err = FSGetVolumeInfo(catalogInfo.volume, 0, NULL,
kFSVolInfoFlags, &volumeInfo, NULL, NULL)))
{
// no error
if ( 0 != (volumeInfo.flags & kFSVolFlagHardwareLockedMask))
{
// volume is locked by hardware
ret = true;
}
}
for the catalogInfo returned at the top - we have the hardware lock
enabled return. Weird.
When we try stat function from sys/stat.h
if ( err == noErr )
{
UInt16 mode((reinterpret_cast<FSPermissionInfo*>(catalogInfo.permissions))->mode);
if (0 == mode)
{
struct stat s = {0};
stat(sFullPath.c_str(), &s);
if (!(s.st_mode & S_IWUSR))
{
// user does not have access to write
ret = TRUE; //<<<<<<< we do not get here, when more == 0
}
}
Can anyone explain this?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden