• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
FSGetCatalogInfo returns zero permissions for /Volumes/VolumeName directory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: FSGetCatalogInfo returns zero permissions for /Volumes/VolumeName directory
      • From: Jim Luther <email@hidden>
  • Prev by Date: Re: FSCopyObjectAsync still buggy and useless after all these years
  • Next by Date: Re: FSGetCatalogInfo returns zero permissions for /Volumes/VolumeName directory
  • Previous by thread: Re: wrong atime created by NFS clients (Mac OX 10.5 and 10.6).
  • Next by thread: Re: FSGetCatalogInfo returns zero permissions for /Volumes/VolumeName directory
  • Index(es):
    • Date
    • Thread