• 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
Re: SMB and ACLs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SMB and ACLs


  • Subject: Re: SMB and ACLs
  • From: Jim Luther <email@hidden>
  • Date: Thu, 01 Sep 2016 15:53:07 -0700

I'm guessing TextEdit is using NSURLIsWritableKey like this:

        NSURL *url = "">NSURL fileURLWithPath:@"/System/" isDirectory:YES]; // "/System/" isn't writable for most users
        NSError *error;
        NSNumber *isWritable = nil;
        if ( [url getResourceValue:&isWritable forKey:NSURLIsWritableKey error:&error] ) {
            NSLog(@"%@ is %@writable", url, [isWritable boolValue] ? @"" : @"not ");
        }
        else {
            NSLog(@"Error: %@", error);
        }

The NSURLIsWritableKey property reflects W_OK bit in the effective permissions of the current user as returned by access(2) or getattrlist(2) with the ATTR_CMN_USERACCESS attribute.

On Sep 1, 2016, at 2:44 PM, Jeff Schindler <email@hidden> wrote:

Hi,

I am accessing a file from a Windows server over SMB.  The file has an ACL applied to it on the Windows side such that it is effectively read-only.  SMB seems to pick this up, as the associated app (TextEdit) says that the file is locked, but I'm trying to figure out how I can determine the read-only state of that file on the Mac side myself, either from code or the command line.  Based on what I see, it does not have the com.apple.system.Security extended attribute applied to it (I *think* you should be able to see that via "ls -ahel@"), and the normal posix permissions don't reflect its read-only state, so I'm trying to figure out how TextEdit is picking that up, and how I might do the same from code.

Thanks!
Jeff
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: SMB and ACLs
      • From: Jeff Schindler <email@hidden>
References: 
 >SMB and ACLs (From: Jeff Schindler <email@hidden>)

  • Prev by Date: SMB and ACLs
  • Next by Date: Re: SMB and ACLs
  • Previous by thread: SMB and ACLs
  • Next by thread: Re: SMB and ACLs
  • Index(es):
    • Date
    • Thread