Stupid Permissions Questions...

Member
Posts: 321
Joined: 2004.10
Post: #1
I've been reading Mac OS X books until I'm blue in the face, but
I still can't seem to answer these questions for myself.

The Unix model supports a read/write/execute permissions. But
Apple's Finder (Get Info) only seems to allow a read/write setting. What
gives?

Also, is there a way to access the permissions of a bundle. Currenly
the Finder show the Application icon, can I access the Contents/MacOS/.app?
stuff. I've tried the terminal command but my Unix knowldege is atrocious.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #2
Well you can't easily execute unix executables from the Finder, so that's not really that much of an issue. If you need to set that, use the chmod command.

Do you mean you want to see what's inside a bundle? If you right-click on a bundle in the Finder, you can peek inside by using the 'show package contents' in the contextual menu.
Quote this message in a reply
Member
Posts: 34
Joined: 2004.07
Post: #3
skorche, do you mean "you can easily exectute..."?

if not, you actually can, if a file is executable, the finder usually opens the terminal for the given file and runs it as a shell script or as an actual application.
Quote this message in a reply
Member
Posts: 208
Joined: 2005.04
Post: #4
WhatMeWorry Wrote:I've tried the terminal command but my Unix knowldege is atrocious.

you mean chmod?

here's a brief explanation:

The permission codes are 3 digits long. The first digit represents the owner permissions. The second digit represents the group permissions. On Mac OS X, each user is the only member of their group by default, so you generally don't need to worry about this one too much. The third digit represents the permissions of "everyone else".

Each digit is composed by adding any combination the following codes together:

1 is execute
2 is write
4 is read

So if you wanted to make a file readable and writeable by you and only you, you'd type this:

chmod 600 myFile.txt

If you wanted everybody to be able to execute a file, but make it so that only you have read and write access, you would do this:

chmod 711 myExecutable

For directories, executable means "let people see what's in the folder".

Mac OS X extends chmod to include ACL (access control lists). If you'd like to learn all about the Mac OS X permission "extras", type man chmod or man acl. Beware, you might get overwhelmed! Wink
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #5
ss2 cire Wrote:skorche, do you mean "you can easily exectute..."?

if not, you actually can, if a file is executable, the finder usually opens the terminal for the given file and runs it as a shell script or as an actual application.

I do believe that I said "you can't easily execute". Didn't misspell it either. Wink
If you didn't know that it could be done, take an executable unix file and add '.command' as the extension. Now when you double click it, it will be launched in a terminal window.
Quote this message in a reply
Member
Posts: 321
Joined: 2004.10
Post: #6
I understand chmod, but why does Apple's Finder only list
Read and Write settings? Where's execute?

Edit: now I see your last several lines. Ok, I see how folders can get away with
just read and write. However, i went down my bundle (application) and selected.
The preview even says "Kind Unix Executable File". I did a show detail (or whatever
it is called) and it still only shows read and write (nothing about executable).

Did Apple assume that "execute" permission would only be settable via the unix command
line. Cause the Finder doesn't seem to show it.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #7
Like I said. It's because the files that the finder executes, application bundles and so on, are not unix executable files. To run a unix executable, you're still going to have to use the terminal.

Why should they have a setting like 'executable' that doesn't seem to work on any normal file? That would simple bewilder 99% of users out there why they would want to make a JPEG executable. Even more, why would you want to make an application not executable?

If you know that the executable flag exists, you know what to do with it.
Quote this message in a reply
Member
Posts: 321
Joined: 2004.10
Post: #8
Here's the deal. I am creating an Xcode application (C++/openGL) on my machine.

I then move it to another machine. I then get a "permissions" error on the
new machine when I try start it. It only works until I turn on the execute setting.
This isn't a unix application as far as I know.

Has anybody else had this similar problem with their builds?
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #9
That's very strange... is it setuid/setgid? Is your application bundled? What are you setting the execute bit on specifically? The bundle? The executable inside the MacOS folder?

What are you using to transfer it? I think old versions of Stuffit stripped the executable bit wantonly...

Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Really stupid general library question... WhatMeWorry 4 2,814 Dec 15, 2006 03:22 PM
Last Post: akb825