View Full Version : Stupid Permissions Questions...
WhatMeWorry
2005.08.17, 06:55 PM
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.
Skorche
2005.08.17, 07:36 PM
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.
ss2 cire
2005.08.19, 03:19 AM
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.
Andrew
2005.08.19, 07:56 AM
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! ;)
Skorche
2005.08.19, 10:24 AM
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. ;)
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.
WhatMeWorry
2005.08.21, 08:46 PM
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.
Skorche
2005.08.22, 12:44 AM
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.
WhatMeWorry
2005.08.23, 02:58 AM
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?
Steven
2005.08.23, 03:19 AM
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...
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.